From 0acfc1d1083d148a606d380143176e218d437728 Mon Sep 17 00:00:00 2001 From: Arcturus Date: Fri, 1 Nov 2019 22:30:30 +0800 Subject: [PATCH] v36.0.0 (#6226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Generated from 368b5914a375e09ef413285c932b72038a8af7e4 (#5386) fix: sql preview model validation errors - Remove empty "body" for RESPONSE_SCHEMA_NOT_IN_SPEC errors - IsAzureMonitorTargetEnabled -> isAzureMonitorTargetEnabled - "State" -> "state" - emailAccountAdmins "true" -> true - Add 202 response for RestorePoints_Create - password -> certPassword for ManagedInstanceTdeCertificates_Create and TdeCertificates_Create * Tooling fixes (#5400) Return empty slice when no tags are found. Added module version string validation. Added optional arg 'initial module version' to versioner tool. * First commit of major-updater tool * Add autorest in parallel * Make subworks sub-commands * Add afterscript * Fixed operation order * Some refine * Refine output * Refine output * Fix bug in dep * Add afterscripts and lisence header * Fixed a bug with relative path * gofmt fix * Simplify * [AutoPR] hdinsight/resource-manager (#5396) * [AutoPR hdinsight/resource-manager] [HDInsight] Add Capabilities to Stable API version,Modify ApplicationType,AccessModes to enum (#5291) * Generated from 6fd28f5f0db51b2cf7a71835ac10e3dc2c4cb390 Add Capabilities to stable version, Modify ApplicationType and AccessMode to Enum. In order to be consistent with the response from RP side, add suppression for DefinitionsPropertiesNamesCamelCase * Generated from cef6f97615ded43f65dab5eda4a5837d5ec45621 Add Capabilities to stable version, Modify ApplicationType and AccessMode to Enum. In order to be consistent with the response from RP side, add suppression for DefinitionsPropertiesNamesCamelCase * Generated from a22cf02eb2898daaac88819d82f4ccc1fba62a75 Add Capabilities to stable version, Modify ApplicationType and AccessMode to Enum. In order to be consistent with the response from RP side, add suppression for DefinitionsPropertiesNamesCamelCase * Generated from 18e8f73649a26d6acdba575f35b0e3af6fe3cd8c (#5381) Problem: in previous pr #6665 we modify accessModes and applicationType to enum, this will bring breaking change in java sdk. Solution: remove the two enum, change it to string type * [AutoPR] datafactory/resource-manager (#5405) * [AutoPR datafactory/resource-manager] Enable Avro Dataset in public swagger (#5385) * Generated from ec112148bf30430557ff3fac0c74f0706b1042de Enable Avro Dataset in public swagger * Generated from e41431428e45beaa5bbb12344d3332479c095e31 UPDATE * Generated from 1399f090601abea10de38ae50242895878947a74 (#5390) Add paramref into custom-words.txt * Generated from 814795cce5766e56d08e877d7f359c2d6380a8be (#5411) update example * [AutoPR cognitiveservices/data-plane/QnAMaker] add QnAMaker runtime to Go SDK (#5368) * Generated from 67a0600b9c098d384b275c79d1ab1b6b870e6e77 add QnAMaker runtime to Go SDK * Generated from 3d6f73607f9caee9054b290237825245306d7408 ensure package directory and namespace match * [AutoPR compute/resource-manager] Add terminate profile and scheduled events profile to Microsoft.Compute (#5310) * Generated from 9bb1d5b7f21a0e03e97ce3817554307244d45422 Correct definition format * Generated from 49bbc9237680dc7963f9d24f7cde1d05e8f14260 Merge branch 'master' into dev/szimmer/AddTerminateProfile * [AutoPR compute/resource-manager] Add missing Gallery Application API in 2019-07-01 version (#5354) * Generated from 01293ebd64fa96d11d30d9b0ef1391cbe8e62443 Add missing Gallery Application API in 2019-07-01 version * Generated from 6637309053b80e0b62b01f1c240d72749e30f1c2 Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs * Generated from 1929243cc853b5f21c5e6cef8a2867fb4d26b4dc (#5421) updating description - clarify encryption enabled by default * Generated from 3061f166bc14a327fd8506ee1b85f966db9d26fb (#5424) chore: jsonfmt logic * [AutoPR logic/resource-manager] RosettaNet Process configuration apis (#5416) * Generated from eaa9b184f467a7f80c8044d487a72d596b45fbc9 updated examples path * Generated from 68568e93d6bc5b687899488523cade3f66893779 fixes CI errors Fixed casing as required by CI * Generated from 3cd428eebae03353ad64c51526318c1890219a15 merge conflicts * Generated from b2fdc8872f13016495f8cf26d31ed4e902ee1a9e removed breaking changes * Generated from 901423e3e7dee55389f4fcc9fc5d7c793fa202ae pr feedback * Generated from 2838c1142bf4bf7b382e819cfe73e3dfcc2794d7 Merge branch 'master' into AzureLogic-rosettanet-apis * [AutoPR cognitiveservices/data-plane/InkRecognizer] [Hub Generated] Review request for InkRecognizer to add version preview/v1.0 (#5372) * Generated from 34c67e4beeb3721701921ded0f374c834723b2f7 re-naming inputDevice to inputDeviceKind * Generated from ae13f3bcaab268fc0365a1e0452535827d2bda64 Update specification/cognitiveservices/data-plane/InkRecognizer/preview/v1.0/InkRecognizer.json Co-Authored-By: Nick Schonning * [AutoPR compute/resource-manager] add HyperVGeneation in GetVMImage (#5344) * Generated from 4b3b012a4c684afd2e931bb2ac4c01bbf894eec4 add HyperVGeneation in SharedVMImageVersion * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * Generated from bcef281153fa689dac376755754aed8aac925815 (#5313) fix: servicefabric character encoding * Fix table query continuation token (#5423) * When aborting with error, delete the branch just created (if exists) * Change Delete to DeleteBranch for explicity * Generated from e2aaa71c099725ee90c36c388f88398bc33c000c (#5436) Merge https://github.com/Azure/azure-rest-api-specs * Merge pull request #5439 from Azure/restapi_auto_portal/resource-manager [AutoPR] portal/resource-manager * Generated from a415a4352bc3818452589c8eed1e9e4be1cb8260 (#5442) Update Tasks.json Fixed incorrect discriminator for Oracle to PostgreSQL scenario. * Generated from ca46ecf5c4baeb43c5fc1afb355c065bf49efd90 (#5449) Update OracleAzureDbPostgreSqlSyncTask.json Added "caseManipulation" to MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object * Generated from b3623415bfb03b5a528c8a2a20caad53aba43ce2 Adding managed resource group and log Analytics Workspace to the GET API * Generated from f1354d954d03c2283656d3c820a88dcfc2ddf79e Updating fields in the list and patch APIs * Generated from df3fa85139fca07f04373031470bed637e7b8126 Update Batch Swagger documentation * [AutoPR servicefabric/resource-manager] Moving sfrp release 2019-03-01 to stable (#5314) * Generated from b1a5bbf475639da8e8bf4783ba33a4af17caa08c remove location and tags from proxyResource * Generated from 14c9abcc8bd1b6e9635a60226e3966b774951e28 Revert "remove location and tags from proxyResource" This reverts commit b1a5bbf475639da8e8bf4783ba33a4af17caa08c. * Generated from 2380d7af2f3e2d507c5486d8fb6abfd816a65bed change location description in ProxyResource to dcument as deprecated * Generated from 17ffb0840e98cd725c5c999160787b8605c414d6 rename put operations to *_CreateOrUpdate * Generated from e8805bf5ca1ff7c125b84a637eb483af9efd5ff5 (#5459) add readme go * Generated from 27e7dd3c7e4a6b855c902cfaf35380e273760cde (#5462) Update readme.md files missed from previous commit * Generated from 3acbc3b4106db3097de5be5e4df47afb38d51ec0 (#5473) Use cors definition from blob.json * Generated from 408cd70f35f18e81fc46aa6538822c850bd8ced4 (#5489) Updating the skus names and clarified capacity description * [AutoPR containerservice/resource-manager] [Hub Generated] Review request for Microsoft.ContainerService to add version stable/2019-08-01 (#5444) * Generated from 9e6d4ac959af23add7e84ec0531c0643e3bde433 Update tags for 2019-08-01 SDK generation * Generated from 2307de018692dde013d3bf3ed0557c6d8f84519d Add private link resources * Generated from 9e6d4ac959af23add7e84ec0531c0643e3bde433 Update tags for 2019-08-01 SDK generation * Generated from 70862cb4e798bea3905a652d60569cf436a8f0c7 (#5501) Add config for go * Generated from faa8f71aa05aaed68631716cc9ef24451d760b3e (#5465) remove redundent schema reference * [AutoPR recoveryservicesbackup/resource-manager] Adding non mandatory fields in ProtectedItem and AzureVmWorkloadProte… (#5392) * Generated from 142bb9d9a841dde1be669e35ba1586138ed1a599 Adding non mandatory fields in ProtectedItem and AzureVmWorkloadProtectionPolicy Adding additional fields for ProtectedItem related to soft delete feature ; description of each field is in the fields. In AzureVmWorkloadProtectionPolicy adding another field for fixup of policy * Generated from ad48ba50e1864e1adb4845d4bbf73ee192354cde Rehydrate removal from description Rehydrated is not in dictionary of swagger valiation and thus removed from description * Generated from bd73c95f36f3758171783a5b37b8e097b9726524 Updating the Field for deferred deleted Time Updating the new field for deleted time in ProtectedItem while keeping the syncTime for MABfileFolderProtectedItem * Generated from ac509691885fb8f4bf7e0cec8219571c0dfd23ac Undo change to AzureVmWorkloadProtectionPolicy Removed the change to AzureVmWorkloadProtectionPolicy as this requires new api version * Generated from d0e65933a9e0764079436e3f000fe80796479542 Fixing camelcasing Camelcasing of isDeferredDeleteScheduleUpcoming field * Generated from dea881c0a4daf7b8a1472e9e33efffdd6247d0de (#5529) Add missing json to package-composite-v2, package-composite-v1, package-pure-2017-03-preview and package-2017-03-preview * [AutoPR billing/resource-manager] [Do not merge] [Microsoft.Billing] Customers resource for partner-channel (#5343) * Generated from 7f7f0f2009acea6f3d52c4e1f8f4f4af37b5ae5b Update examples. * Generated from 967632713b1ea0e839baef7d47f3f857923f9ad1 Fix reseller property on billingSubscription. * compute/resource-manager] Swagger: Allowing for VMSS reference during VM creation (#5408) * Generated from 547a98bc34516d8788adff951ebd929d8d5125ae Swagger: Allowing for VMSS reference during VM creation * Generated from 2723517c6c29f1c6945bdf05b9c4e42f85159011 fixing typo * Generated from 004d77657b470329193715edd882bc1934d0785a (#5534) Fix bad discriminator value on ConnectionInfo which was breaking node/js SDK generation * Generated from 7c78ea20f697176d9e9017b076e0dc76e09aa303 Update custom-words.txt * Generated from f1ef9612fd56160b7976caeae1830276cd848761 (#5547) fix bad 'unknown' discriminator value in the rest of our datamigration models * Generated from 92b46a61425bf808ff7b4ffef9d3bb063713558b (#5531) Mark ownerEmail as required properties for workspace RP * Update to latest Go code generator (#5583) * [AutoPR hanaonazure/resource-manager] Added Key Vault ID for GET and LIST SapMonitor (#5410) * Generated from b39adb6b69cc5d847e3158430da68bfe4b935ec2 Added Key Vault ID for GET and LIST SapMonitor * Generated from c5d2bc253fb4880b9543bd5edb6a38138fb40e64 Added Key Vault ID for GET and LIST SapMonitor * datalakegen2 endpoints require https (#5572) * datalakegen2 endpoints require https * regenerate with 2.1.136 of autorest.go * Generated from 27425d2151bbc9609e18833c5479739f8266de47 (#5538) Update readme.md * Generated from a9e6716031821eff25f2cbb422960fa56742c0e9 (#5586) Merge branch 'master' into akpati/ssh-property-change * [AutoPR containerregistry/resource-manager] [ACR] Update retention policy schema (#5571) * Generated from 1afeec1884ccf139e6c1bda82ab81227b3df9d2b update retention policy schema * Generated from c136d1fcf1a161f68944223dad032c4407154c6f remove unnecessary breaking change * Generated from 287fcbfdc1fc8b0926588963393574052e0bb9ed fix typo * Merge pull request #5610 from Azure/restapi_auto_reservations/resource-manager [AutoPR] reservations/resource-manager * Generated from 4e144aa43b738e1792883408252e26570a777706 (#5587) Add codegen config for kusto 2019-05-15 * [AutoPR resources/resource-manager] Adding a new api version 2019-06-01 for Microsoft.Authorization policy artifacts (#5585) * Generated from 75581e4277112188117db523a260ae818d949523 added stable/2019-06-01 version for Authorization RP * Generated from edd74f0a1be6f17caa185525a63e594aef956acc Addressed review comments. * Merge pull request #5622 from Azure/restapi_auto_storage/resource-manager [AutoPR] storage/resource-manager * Generated from 65b2f8a37695f3d9cf53c50a05a61c4179857199 (#5605) updated readme with correct version. * Change log level from verbose to normal * Minor change * v33.0.0 draft * Fix vet failure * Update readme * Now major updater reads the config file * Change rel path to abs path * Fix compile error * Execute after script from config file * Refine output * [AutoPR] compute/resource-manager (#5656) * [AutoPR compute/resource-manager] removing non-ascii character (#5325) * Generated from 090b727225320af61034c7278c3ccf51dcbef8a2 removing non-ascii character * Generated from 56ccb1151588cff87c1c92eee0e6c56e42c7f2f4 corrected the description * [AutoPR compute/resource-manager] Add terminate profile and scheduled events profile to Microsoft.Compute (#5310) * Generated from 9bb1d5b7f21a0e03e97ce3817554307244d45422 Correct definition format * Generated from 49bbc9237680dc7963f9d24f7cde1d05e8f14260 Merge branch 'master' into dev/szimmer/AddTerminateProfile * [AutoPR compute/resource-manager] Add missing Gallery Application API in 2019-07-01 version (#5354) * Generated from 01293ebd64fa96d11d30d9b0ef1391cbe8e62443 Add missing Gallery Application API in 2019-07-01 version * Generated from 6637309053b80e0b62b01f1c240d72749e30f1c2 Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs * [AutoPR compute/resource-manager] add HyperVGeneation in GetVMImage (#5344) * Generated from 4b3b012a4c684afd2e931bb2ac4c01bbf894eec4 add HyperVGeneation in SharedVMImageVersion * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * compute/resource-manager] Swagger: Allowing for VMSS reference during VM creation (#5408) * Generated from 547a98bc34516d8788adff951ebd929d8d5125ae Swagger: Allowing for VMSS reference during VM creation * Generated from 2723517c6c29f1c6945bdf05b9c4e42f85159011 fixing typo * [AutoPR compute/resource-manager] [Do not merge yet] DiskRP Swagger changes for 2019-03-01 (#5398) * Generated from a308b6604cb4bfdb8085d78f998aa3718cf9ae36 adding unique id * Generated from b7b0ecc49d6694ea41c66ef9936f05da9bae38f3 fixing typo * Generated from 34c96075059bf06bf052835f6f405b2d0649d1b7 removing diskSizeBytes from snapshot\disk update properties and adding a unique id for disk properties * Generated from 1ad0c2e2dd85dad2a363072eb4cdcbe250e1522b pr comments * Generated from 4f5dbad04518d0674689ac2a2388ea823d28cadf pr comments * [AutoPR compute/resource-manager] Adding low priority and variable pricing feature for standalone VMs. Added priority, eviction policy and billing profile to VirtualMachineProperties. Also, adding optional billing profile to VMSS Create and Update APIs. (#5523) * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 9d5e30df16e3ea43cb3b21b5f5264373d8ed2397 (#5596) updating an incorrect description for uploadsizebytes * Generated from 79b1099e7cf1d0a077c2f5b38b4c83408b97a59b (#5652) Add missing $expand parameter to AvSet list by subscription API * Generated from 027c5530dd98ce87a84ba78c3e3cf8d2451d0c13 (#5569) Fixed the formatting * [AutoPR eventhub/resource-manager] Eventhub: added NetworkRuleSets list API (#5627) * Generated from 46cb463f5dbcd442661875e4eb9d963af3bd1225 added NetworkRuleSets list API * Generated from c09ca0cf8b2a8d98ee64b897e1858f4be8a67f95 added x-ms-pageable and formating * Generated from 8bc2a7edfeebb1a6bb30abbbb03d08bf1f8a8dbc update * Generated from 111d1bc1666fe89cebb960135cf2f5336bbcb35a (#5615) Removed rogue file * [AutoPR machinelearningservices/resource-manager] [NEED DESIGN REVIEW, DO NOT MERGE] Adding workspace level quota management APIs in version 2019-05-01 (#5641) * Generated from f5ddfe85225c2d4f86f7de8e99760b95d1dea6bf Merge branch 'master' into leizhao/workspaceQuotaManagementInVersion2019-05-01 * Generated from c89caf92470c4c334883662fd98e6bd07881807d migrate quota management from 2019-05-01 to 2019-06-01, no content changes * [AutoPR storagecache/resource-manager] Dev storagecache microsoft.storagecache 2019 06 01 preview (#5623) * Generated from 570b6f73542c34f1eb0ab0a85e44b4d929ff55b6 Fix output folder path for GO SDK and fix typo in Tag * Generated from 908e3cd2e18a38be0711e03035c7acdc7ab6d1f2 Fix version in the path of output folder for GO SDK * Generated from 10811b8f33c5e36350b618955cdd8edc9dd67c11 (#5673) Fix bad package name for storagecache in go sdk * Fix bad package name * Fix profile and fmt * Generated from 54eb3260d53865005eb6ccfdc9843e7ab10d9da5 (#5551) adding maintenanceConfiguration list and resourceId for updates * Generated from be2943341d08ab5972e4d2385b1860d34ee61f59 (#5675) Fix bad namespace in service maintenance * Fix wrong namespace * Fix profile and fmt * Generated from 3bcf3602288f763a70a2f3cb10100406e0e53257 (#5672) Addressed misspelled word and mode error * Generated from 5e1bb35d5c3314d8f4fead76c3d69a2522be026b (#5651) Update review comments * [AutoPR datafactory/resource-manager] support Express Custom Setup (#5536) * Generated from 696212c605edef333cba0f0e86d42ba344f4fc42 address the comments * Generated from 4de64a2262df8e2e971620c95f7c3a2ba91d49d9 address comments * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * [AutoPR datafactory/resource-manager] [Data Factory]Add ORC Dataset/Copy Source/Copy Sink (#5611) * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Fix CI failure and conflict * [AutoPR] compute/resource-manager (#5688) * [AutoPR compute/resource-manager] removing non-ascii character (#5325) * Generated from 090b727225320af61034c7278c3ccf51dcbef8a2 removing non-ascii character * Generated from 56ccb1151588cff87c1c92eee0e6c56e42c7f2f4 corrected the description * [AutoPR compute/resource-manager] Add terminate profile and scheduled events profile to Microsoft.Compute (#5310) * Generated from 9bb1d5b7f21a0e03e97ce3817554307244d45422 Correct definition format * Generated from 49bbc9237680dc7963f9d24f7cde1d05e8f14260 Merge branch 'master' into dev/szimmer/AddTerminateProfile * [AutoPR compute/resource-manager] Add missing Gallery Application API in 2019-07-01 version (#5354) * Generated from 01293ebd64fa96d11d30d9b0ef1391cbe8e62443 Add missing Gallery Application API in 2019-07-01 version * Generated from 6637309053b80e0b62b01f1c240d72749e30f1c2 Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs * [AutoPR compute/resource-manager] add HyperVGeneation in GetVMImage (#5344) * Generated from 4b3b012a4c684afd2e931bb2ac4c01bbf894eec4 add HyperVGeneation in SharedVMImageVersion * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * compute/resource-manager] Swagger: Allowing for VMSS reference during VM creation (#5408) * Generated from 547a98bc34516d8788adff951ebd929d8d5125ae Swagger: Allowing for VMSS reference during VM creation * Generated from 2723517c6c29f1c6945bdf05b9c4e42f85159011 fixing typo * [AutoPR compute/resource-manager] [Do not merge yet] DiskRP Swagger changes for 2019-03-01 (#5398) * Generated from a308b6604cb4bfdb8085d78f998aa3718cf9ae36 adding unique id * Generated from b7b0ecc49d6694ea41c66ef9936f05da9bae38f3 fixing typo * Generated from 34c96075059bf06bf052835f6f405b2d0649d1b7 removing diskSizeBytes from snapshot\disk update properties and adding a unique id for disk properties * Generated from 1ad0c2e2dd85dad2a363072eb4cdcbe250e1522b pr comments * Generated from 4f5dbad04518d0674689ac2a2388ea823d28cadf pr comments * [AutoPR compute/resource-manager] Adding low priority and variable pricing feature for standalone VMs. Added priority, eviction policy and billing profile to VirtualMachineProperties. Also, adding optional billing profile to VMSS Create and Update APIs. (#5523) * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 9d5e30df16e3ea43cb3b21b5f5264373d8ed2397 (#5596) updating an incorrect description for uploadsizebytes * Generated from 79b1099e7cf1d0a077c2f5b38b4c83408b97a59b (#5652) Add missing $expand parameter to AvSet list by subscription API * [AutoPR] securityinsights/resource-manager (#5683) * Generated from 878390cbb0806c9194cc9ceaed923284d2d8f2ac (#5288) Fix mistake * [AutoPR securityinsights/resource-manager] SecurityInsights: Investigation swagger updates (#5292) * Generated from 27abe226e56bd1a6d13985c9bc8871148a8c34ad Merge branch 'master' into InvestigationSwagger * Generated from ebb1f1f5bdab7f12639fbee775adf16611d092ad removed cases changes (will be in another PR) * Generated from ab899e75a364a5b6dbf21370c1db65b769094ec8 removed bookmarkEntity from entities api (currently not supported) * [AutoPR securityinsights/resource-manager] Adding alertRuleTemplates swagger spec to securityInsight (#5504) * Generated from d731243f4645a2df9c8389e10e93be04ea78a620 Add alertRuleTemplates endpoint to securityInsight * Generated from d09f26c587fddd31fa13cb3d94d7a9bbe8d58ec8 fix merge conflict * Generated from efe14acff06c754692f29bffee877f29edb68b89 Bookmarks swagger updates * Generated from 07393c4915496b1768a08c5f408b05cdb2a27f10 fix typos * Generated from 98fdd0347934e59d39a7b6f803f170933c96d199 fix typo * Generated from e00e65896ca96c4c814528fa286e3f6e2d534122 (#5682) sort definitions and parameters by ABC * Resolved conflict manually * [AutoPR] network/resource-manager (#5692) * Generated from 3b992f9396f9c0bc7e34b11696efcffafa92575a (#5297) add network package-2019-06 to Go SDK * Generated from 36ba645d97091ead19fa04d57595069d73491c7e (#5511) Update PE/PLS * Generated from ec578e180c4515be63046f0b0991d7b9547e657d (#5522) Update description of "location" in serviceTags.json * [AutoPR network/resource-manager] chore: jsonfmt network (#5514) * Generated from 2c363ba11150b1894650db67b5d4a03166b95afd chore: jsonfmt network * Generated from 2c363ba11150b1894650db67b5d4a03166b95afd chore: jsonfmt network * Generated from 92006e420d65cb70e4b93bc5850af575da4efb78 (#5637) Mark "provisioningState" as read-only * [AutoPR network/resource-manager] Add missing read-only property "outboundRules" in LoadBalancer specs (#5647) * Generated from 658cfc162acc76fd35b81aa42b29406d9ba013cb Add missing read-only property "outboundRules" in LoadBalancer specs * Generated from 658cfc162acc76fd35b81aa42b29406d9ba013cb Add missing read-only property "outboundRules" in LoadBalancer specs * [AutoPR] storage/resource-manager (#5695) * Generated from 3acbc3b4106db3097de5be5e4df47afb38d51ec0 (#5473) Use cors definition from blob.json * Generated from 94667089d429b4f1aca38e60f85b13f5c0039219 (#5580) Align File swagger with the Blob swagger * Generated from 8264dcc49e0bc239013cd76ce9664f83f1041967 (#5678) Update Kusto.json with TSVE data format * [AutoPR eventgrid/data-plane] Create KeyVault.json (#5546) * Generated from 66c76158ca650e8f4bf0ff082bc5428e2544c457 Update readme with KeyVault.json * Generated from 7d4a2513c50a216bfe9cbf6a6f769d460d7211f4 Revert "Update readme with KeyVault.json" This reverts commit 66c76158ca650e8f4bf0ff082bc5428e2544c457. * Generated from 44674ab5aabc591e8dd6b10d326071e8fa3ccd49 Update readme.md * [AutoPR] compute/resource-manager (#5706) * [AutoPR compute/resource-manager] removing non-ascii character (#5325) * Generated from 090b727225320af61034c7278c3ccf51dcbef8a2 removing non-ascii character * Generated from 56ccb1151588cff87c1c92eee0e6c56e42c7f2f4 corrected the description * [AutoPR compute/resource-manager] Add terminate profile and scheduled events profile to Microsoft.Compute (#5310) * Generated from 9bb1d5b7f21a0e03e97ce3817554307244d45422 Correct definition format * Generated from 49bbc9237680dc7963f9d24f7cde1d05e8f14260 Merge branch 'master' into dev/szimmer/AddTerminateProfile * [AutoPR compute/resource-manager] Add missing Gallery Application API in 2019-07-01 version (#5354) * Generated from 01293ebd64fa96d11d30d9b0ef1391cbe8e62443 Add missing Gallery Application API in 2019-07-01 version * Generated from 6637309053b80e0b62b01f1c240d72749e30f1c2 Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs * [AutoPR compute/resource-manager] add HyperVGeneation in GetVMImage (#5344) * Generated from 4b3b012a4c684afd2e931bb2ac4c01bbf894eec4 add HyperVGeneation in SharedVMImageVersion * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * compute/resource-manager] Swagger: Allowing for VMSS reference during VM creation (#5408) * Generated from 547a98bc34516d8788adff951ebd929d8d5125ae Swagger: Allowing for VMSS reference during VM creation * Generated from 2723517c6c29f1c6945bdf05b9c4e42f85159011 fixing typo * [AutoPR compute/resource-manager] [Do not merge yet] DiskRP Swagger changes for 2019-03-01 (#5398) * Generated from a308b6604cb4bfdb8085d78f998aa3718cf9ae36 adding unique id * Generated from b7b0ecc49d6694ea41c66ef9936f05da9bae38f3 fixing typo * Generated from 34c96075059bf06bf052835f6f405b2d0649d1b7 removing diskSizeBytes from snapshot\disk update properties and adding a unique id for disk properties * Generated from 1ad0c2e2dd85dad2a363072eb4cdcbe250e1522b pr comments * Generated from 4f5dbad04518d0674689ac2a2388ea823d28cadf pr comments * [AutoPR compute/resource-manager] Adding low priority and variable pricing feature for standalone VMs. Added priority, eviction policy and billing profile to VirtualMachineProperties. Also, adding optional billing profile to VMSS Create and Update APIs. (#5523) * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 9d5e30df16e3ea43cb3b21b5f5264373d8ed2397 (#5596) updating an incorrect description for uploadsizebytes * Generated from 79b1099e7cf1d0a077c2f5b38b4c83408b97a59b (#5652) Add missing $expand parameter to AvSet list by subscription API * [AutoPR] storage/resource-manager (#5707) * Generated from 3acbc3b4106db3097de5be5e4df47afb38d51ec0 (#5473) Use cors definition from blob.json * Generated from 94667089d429b4f1aca38e60f85b13f5c0039219 (#5580) Align File swagger with the Blob swagger * [AutoPR storage/resource-manager] Add change feed properties to 2019-04-01 Storage. (#5621) * Generated from 774367438889ac553def1957b72b8ba63ad877e5 Add change feed properties to 2019-04-01 Storage. Add change feed properties to Storage Blob Services. * Generated from 774367438889ac553def1957b72b8ba63ad877e5 Add change feed properties to 2019-04-01 Storage. Add change feed properties to Storage Blob Services. * Generated from 34d744550227bee7b380604d38fc1de6c9af6397 (#5708) Update netapp.json * Merge pull request #5714 from Azure/restapi_auto_compute/resource-manager [AutoPR] compute/resource-manager * Update swagger_to_sdk_config.json Update autorest.go to new version * Generated from 5ea5da031f993e6dd8061f42abbea77d58e66020 Clarify KeyVault time as seconds since Unix epoch * Generated from b621ede227cd29651b1712782d964373fc2da6ec (#5717) Quick fix * Generated from 4eb71094207cc3188dfa1d604325731362a555a5 updating readmes * feature: support PutBlockFromURL API: https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url * Generated from 18efd73807c1182800e0521f67e1e5ae2ee70394 added missing packages to compute release * [AutoPR] compute/resource-manager (#5721) * [AutoPR compute/resource-manager] removing non-ascii character (#5325) * Generated from 090b727225320af61034c7278c3ccf51dcbef8a2 removing non-ascii character * Generated from 56ccb1151588cff87c1c92eee0e6c56e42c7f2f4 corrected the description * [AutoPR compute/resource-manager] Add terminate profile and scheduled events profile to Microsoft.Compute (#5310) * Generated from 9bb1d5b7f21a0e03e97ce3817554307244d45422 Correct definition format * Generated from 49bbc9237680dc7963f9d24f7cde1d05e8f14260 Merge branch 'master' into dev/szimmer/AddTerminateProfile * [AutoPR compute/resource-manager] Add missing Gallery Application API in 2019-07-01 version (#5354) * Generated from 01293ebd64fa96d11d30d9b0ef1391cbe8e62443 Add missing Gallery Application API in 2019-07-01 version * Generated from 6637309053b80e0b62b01f1c240d72749e30f1c2 Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs * [AutoPR compute/resource-manager] add HyperVGeneation in GetVMImage (#5344) * Generated from 4b3b012a4c684afd2e931bb2ac4c01bbf894eec4 add HyperVGeneation in SharedVMImageVersion * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * Generated from c34793bd9910de785d31e7bf8e6da1fd7e30de8b reuse HyperVGenerationType * compute/resource-manager] Swagger: Allowing for VMSS reference during VM creation (#5408) * Generated from 547a98bc34516d8788adff951ebd929d8d5125ae Swagger: Allowing for VMSS reference during VM creation * Generated from 2723517c6c29f1c6945bdf05b9c4e42f85159011 fixing typo * [AutoPR compute/resource-manager] [Do not merge yet] DiskRP Swagger changes for 2019-03-01 (#5398) * Generated from a308b6604cb4bfdb8085d78f998aa3718cf9ae36 adding unique id * Generated from b7b0ecc49d6694ea41c66ef9936f05da9bae38f3 fixing typo * Generated from 34c96075059bf06bf052835f6f405b2d0649d1b7 removing diskSizeBytes from snapshot\disk update properties and adding a unique id for disk properties * Generated from 1ad0c2e2dd85dad2a363072eb4cdcbe250e1522b pr comments * Generated from 4f5dbad04518d0674689ac2a2388ea823d28cadf pr comments * [AutoPR compute/resource-manager] Adding low priority and variable pricing feature for standalone VMs. Added priority, eviction policy and billing profile to VirtualMachineProperties. Also, adding optional billing profile to VMSS Create and Update APIs. (#5523) * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 10d72ee6c882c170c44d54928e192a421d1032a1 fixed typo * Generated from 9d5e30df16e3ea43cb3b21b5f5264373d8ed2397 (#5596) updating an incorrect description for uploadsizebytes * Generated from 79b1099e7cf1d0a077c2f5b38b4c83408b97a59b (#5652) Add missing $expand parameter to AvSet list by subscription API * [AutoPR compute/resource-manager] Add VMScaleSet ScaleIn Policy (#5606) * Generated from 5968c8d1d8f53fcce6b11bc71e4be3c6bc550617 Add VMScaleSet ScaleIn Policy Adds VMScaleSet ScaleIn policy that is supported with the 2019-03-01 header but not included in Swagger * Generated from 17a6aebc538afafffc9ce87f083fc07592a6b5c3 Update compute.json Fix indentation * [AutoPR] datafactory/resource-manager (#5730) * Generated from 5e1bb35d5c3314d8f4fead76c3d69a2522be026b (#5651) Update review comments * [AutoPR datafactory/resource-manager] support Express Custom Setup (#5536) * Generated from 696212c605edef333cba0f0e86d42ba344f4fc42 address the comments * Generated from 4de64a2262df8e2e971620c95f7c3a2ba91d49d9 address comments * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * [AutoPR datafactory/resource-manager] [Data Factory]Add ORC Dataset/Copy Source/Copy Sink (#5611) * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Fix CI failure and conflict * Generated from b07009df21da758efcb13fbbd25ce9e450751586 (#5729) [DataFactory] Update Databricks linked service swagger related to warm pools. * Generated from 4d7873fcb2eb980ac1eacad015893bd5634a5a37 (#5735) [ACR] Adding scopemap spec file for new SDK build For releasing ScopeMap and Token features, we need to retrieve models from the scopemap spec file. The existing SDK version doesn't incorporate changes from the scopemap spec file. Requesting a new SDK build. Please suggest changes if deemed necessary. * Generated from 68ccfd97b6bd4b29219d6988342451fff61b7031 (#5737) [Batch] Update documentation around app packages * [AutoPR servicebus/resource-manager] ServiceBus: added NetworkRuleSets list API (#5624) * Generated from 26fbb00e498d34206afb040c7c9eb7b79fa3fd5e added NetworkRuleSets list API * Generated from 87e06617e7103a97295b2fe25f4a47990371b397 added x-ms-pageable and formating * Generated from 2f83e3fb7917b9f6301fea15cf45e3e3fbeac7bb removed readonly for compatibilityLevel * [AutoPR cosmos-db/resource-manager] Add short url for all api resources (#5448) * Generated from 6b485b2047ec2cc073363b94a56778b108912940 Add short url for all api resources * Generated from d0f3adbb4578d7a5569d29a683663bf4772af38a Correct GremlinResources_ spell * Generated from a05be8787ab7cc8346e38c01ccbd45731ad95169 Add new api version * Generated from 72880ac9171c7118002c56eb2152265bb41442ba Fix spell error * Generated from 1ca1ae2151cd7248fac7b82624424ce63383a28a (#5745) fix: Double word "the" in datalake-analytics * [AutoPR] datafactory/resource-manager (#5751) * Generated from 5e1bb35d5c3314d8f4fead76c3d69a2522be026b (#5651) Update review comments * [AutoPR datafactory/resource-manager] support Express Custom Setup (#5536) * Generated from 696212c605edef333cba0f0e86d42ba344f4fc42 address the comments * Generated from 4de64a2262df8e2e971620c95f7c3a2ba91d49d9 address comments * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * [AutoPR datafactory/resource-manager] [Data Factory]Add ORC Dataset/Copy Source/Copy Sink (#5611) * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Fix CI failure and conflict * Generated from b07009df21da758efcb13fbbd25ce9e450751586 (#5729) [DataFactory] Update Databricks linked service swagger related to warm pools. * Generated from 5cc2c54ac1ba7f41fd2426ff39df46f785ce55f2 (#5748) Add a clearer description. * Generated from 94dbf0ac2518371373cf8f2eb74bba657b1e7b90 (#5414) Orphan property removed * Generated from 33d64b558114a9a861b82dc17518e359758d1688 (#5686) Fix SpellCheck Swagger Specification * Generated from 81fb55e8252598b44b1d5ee4db527eacba725546 (#5687) Fix Local Search Swagger * Generated from latest specs of network * Generated from af961540f808cb651ddb1dbac08619eafc06330e (#5789) Add 2019-07 version to network go code generation * Generated from 1baa9a51ee00db62b006b2081d2811297d48d3d4 (#5761) Updated 2019-02-01-preview api version to include operation.g * Generated from 7837d7e037f47c5a2414e0a241e1472c960ff055 (#5744) fix: Double word "the" in automation * [AutoPR datamigration/resource-manager] Correct the version (#5516) * Generated from 8de2c91a547e5ab394d4569aed0dda9b814c9cce Correct the version * Generated from 8de2c91a547e5ab394d4569aed0dda9b814c9cce Correct the version * Generated from 68427c1d0294d9f4acbe7355261c31cd407a2d95 (#5727) Add purge API details. * [AutoPR] frontdoor/resource-manager (#5784) * Generated from 27e7dd3c7e4a6b855c902cfaf35380e273760cde (#5462) Update readme.md files missed from previous commit * Generated from adca4cd9eac95f46998e3b35e1d5ae600498808f (#5508) add SocketAddr matchvariable * Generated from 88294366687bc74b0efc484eb8f0d08980de3804 (#5746) fix: Double word "the" in resources * [AutoPR] datafactory/resource-manager (#5795) * Generated from 5e1bb35d5c3314d8f4fead76c3d69a2522be026b (#5651) Update review comments * [AutoPR datafactory/resource-manager] support Express Custom Setup (#5536) * Generated from 696212c605edef333cba0f0e86d42ba344f4fc42 address the comments * Generated from 4de64a2262df8e2e971620c95f7c3a2ba91d49d9 address comments * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * [AutoPR datafactory/resource-manager] [Data Factory]Add ORC Dataset/Copy Source/Copy Sink (#5611) * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Fix CI failure and conflict * Generated from b07009df21da758efcb13fbbd25ce9e450751586 (#5729) [DataFactory] Update Databricks linked service swagger related to warm pools. * Generated from 5cc2c54ac1ba7f41fd2426ff39df46f785ce55f2 (#5748) Add a clearer description. * Generated from 9402dbf3fb3d5fffcb80f501b1fc857ff97ab723 (#5760) Fixing PR validation errors * Generated from 5927195a95dbda5a1729692d42a088b60c4a4a88 Adding new version of API * [AutoPR] datafactory/resource-manager (#5807) * Generated from 5e1bb35d5c3314d8f4fead76c3d69a2522be026b (#5651) Update review comments * [AutoPR datafactory/resource-manager] support Express Custom Setup (#5536) * Generated from 696212c605edef333cba0f0e86d42ba344f4fc42 address the comments * Generated from 4de64a2262df8e2e971620c95f7c3a2ba91d49d9 address comments * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * [AutoPR datafactory/resource-manager] [Data Factory]Add ORC Dataset/Copy Source/Copy Sink (#5611) * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Fix CI failure and conflict * Generated from b07009df21da758efcb13fbbd25ce9e450751586 (#5729) [DataFactory] Update Databricks linked service swagger related to warm pools. * Generated from 5cc2c54ac1ba7f41fd2426ff39df46f785ce55f2 (#5748) Add a clearer description. * [AutoPR reservations/resource-manager] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#5766) * Generated from f19a2e5b7f384018b74b21b7b8b8782d95b456f9 fixed x-ms-enum value * Generated from 2f56008117d578bec6cc8b8c832926f45a0fe52e fixed catalog definition * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * update README with info on customizing SendDecorators (#5832) * Generated from f3e85bf537e973832fd8b630394c4b951badce66 (#5798) Fix eligibility typo * Generated from d3620f1cf3fda9d30555c4b0e47a1ea521ca5404 (#5799) Review 1 + remove v3.0 preview * Generated from 67a8ba34e8eb3e3c0ffa6efdd019e46391b42571 (#5812) Update readme.go.md Updated output-folder (removed `stable`) * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 (#5773) fix getting agent pool available versions api path * [AutoPR logic/resource-manager] [LogicApps] New Api version (#5834) * Generated from acf43615d58480cc7285f4a26b1108971162fc4a Fixed error * Generated from c2f47d91b77ffe997d38994cff32f7b410b1a308 Fixed model errors * Generated from 4f11b92d108f861c21411092dacd997a32bb7076 Fixed more errors in Logic json * Generated from 7c5619dfd675cc3af284d52337539ca861732528 Fixed resource reference issue * Generated from 56286b280dda0ebf76f171c8e4f7288e5ea5141b Fixed Resubmit trigger histories * [AutoPR] datafactory/resource-manager (#5830) * Generated from 5e1bb35d5c3314d8f4fead76c3d69a2522be026b (#5651) Update review comments * [AutoPR datafactory/resource-manager] support Express Custom Setup (#5536) * Generated from 696212c605edef333cba0f0e86d42ba344f4fc42 address the comments * Generated from 4de64a2262df8e2e971620c95f7c3a2ba91d49d9 address comments * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * Generated from fc0bdde313743dbbed8e8c506dd9e07107d04142 Merge branch 'master' into ivan/support-express-custom-setup-for-manged-ir * [AutoPR datafactory/resource-manager] [Data Factory]Add ORC Dataset/Copy Source/Copy Sink (#5611) * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Generated from 864a2b3827b7237d7cb60d77069b693dcbaf7001 [DataFactory]Add support for ORC dataset * Fix CI failure and conflict * Generated from b07009df21da758efcb13fbbd25ce9e450751586 (#5729) [DataFactory] Update Databricks linked service swagger related to warm pools. * Generated from 5cc2c54ac1ba7f41fd2426ff39df46f785ce55f2 (#5748) Add a clearer description. * Generated from 239e696db0a17997d3bc2a77c9670180e527fcfc (#5797) Update location in ManagedNetwork * Generated from 0e25b55ea7d548f56eada51b4065224e02eab5e7 (#5815) Restoring expandChildren changes * Generated from 3ff7f07c725255fe7a891687890dd1b928c772ee enum name must be fixed here as well * Generated from 91579252e6aa0e9aa0b00749c82755240e5f5282 (#5845) Add aad domain name for windows login migration support * Generated from 0d3d4d1b56bbbb9e001f971a9ab2c7df8749a9f3 (#5850) Stablize 2019-04 and 2019-05 for frontdoor * [AutoPR sql/resource-manager] Add new APIs (two List APIs) and update examples (#5728) * Generated from b5c48e4b89006ae465040001f67683dcec790b4b Update DatabaseAuditingSettingsList.json * Generated from b5c48e4b89006ae465040001f67683dcec790b4b Update DatabaseAuditingSettingsList.json * Generated from 3ff8cd57b4a86c753b773d2dba460f7e6a62f4c1 (#5864) remove additional property for data flow enitty * Generated from 8188f2ed896ed7f345c5a324f3c62aaca926a35b (#5867) Removed one property which won't be exposed to public for now * Generated from 1cac6227f3d809cbabebc0ca1140469c9d2a7030 (#5872) remove unnecessary additional property * Generated from ad2716208f8089dd2d768faf9e9f765660fafc9c (#5873) Fixed unknown words * Generated from 51020f68a1a7cd0fd66f44a493e8a8b2a23f1e2a (#5875) Add nextLink * Generated from 16c7d5f2a872e3b7cc01c7dd8af608a586776fe9 (#5862) lowercase the collection types * Generated from edb4eee278a0a531af70668fcc2a55e04396d5b1 (#5886) update operation id on list all * [AutoPR security/resource-manager] Jit api add justification (#5866) * Generated from 162213184e0652221884ff84f11c93fe935ec78d Merge branch 'master' into jit-api-add-justification * Generated from 162213184e0652221884ff84f11c93fe935ec78d Merge branch 'master' into jit-api-add-justification * Generated from 63d0bd0751dd12efb7a19fd63807a26919c02b11 (#5868) Add support for attached databases * Generated from ebaee7c36eb7db67a4e648374f69f26a654b444f (#5885) [SRP] Add new storage account property largeFileSharesState * v34.0.0 * [AutoPR network/resource-manager] Network September release (#5940) * Generated from 10dc6bc902a0884218d9d336da7d993839599645 Add reference to Connection Monitor specs in 2019-08-01 (#7218) * Generated from 40628938c2d43d66b4cc5a778e35d470f4299727 Move new props to the end to avoid breaking changes in SDK (#7387) * Generated from d16da2ae0ccb63bad6796ad92e9f5b3deff263a1 (#5856) Removed extra file * [AutoPR compute/resource-manager] vmss: support for passing a health probe to update (#5914) * Generated from 5b6736a9b79ace44f3c0080596a48a2c5072c739 vmss: support for passing a health probe to update * Generated from 5b6736a9b79ace44f3c0080596a48a2c5072c739 vmss: support for passing a health probe to update * Generated from 907e4904d4d23c9808b0e9a1e9d6feed24a85674 (#5997) Add api version 2019-07-01 for features * Generated from 13b301ffb122a22f7c7ef6372c606bc677ebc31e (#5952) chore: jsonfmt network * Generated from acbfeadd901b2bb09d4f187e1d7d7dcb68382f0c (#5944) Add purge API details + saved search fixes * [AutoPR cdn/resource-manager] Add two match condition for CDN RulesEngine. (#5926) * Generated from e00cb79da22b7321a0d965f6516440f359180cff Add two match condition for CDN RulesEngine. * Generated from 0ce67b311a2c58faeee1f54bad56afdacc51adeb remove transfrom from HttpVersion condition * [AutoPR peering/resource-manager] API Version 2019-09-01-preview Peering (#5924) * Generated from ec35a7cbfa909dda0ae507af5db9452de833da5f updated 2019-09-01-preview * Generated from 3641a535aab99c93ab35860408e57b105dd40350 updated examples. * Generated from 5f9b9fdd92c5c96b1cb39448b7654103e8913c93 fixed comments in json. * Generated from 2f943553eee21d4184695927da52acdb469b6b43 (#5931) add signin tenant property * Generated from 15e50a07198dcba64bae4c75b4a32969fb50a882 (#5932) Fixing incorrect output of the CheckOCIDriver task. * Generated from afa8ccf350ace9279c30bc5f7df053fa3f65a476 (#5930) fix modal * Generated from aa9913e0d2ece26504f653d3b30d22a4a35a0b38 (#5946) fixing typo and indentation * Generated from faa4da7ea6662be44a9719ba392ca645bc23197b (#5927) fix password1 description * Generated from 4b1813edb7a61c029f7036506b08398a7da69221 (#5971) Add packages for API version for different languages * Generated from 71a7c364618a7112eb2ec351eb0b9827172bc120 (#5976) chore: jsonfmt mysql * Generated from ed7d3540d4a170541423dcf299d305d975442d71 (#5977) chore: jsonfmt postgresql * [AutoPR security/resource-manager] Add aggregated alert top devices information (#5960) * Generated from 235fdb6f20c94a84cda7b52321f27336106cc5e5 fix time field * Generated from 83f1e75cc7e010cba6c566f089194374933a0889 fix time field * [AutoPR recoveryservicesbackup/resource-manager] Azure Backup Version 2019-05-13 addition (#5923) * Generated from 3212ec12fc1821b1b577b0d68951cd67370846d5 Lintdiff Failure fix * Generated from 2826bc70cf4d5fb7c329219e9877b4d74f8a4c45 Semantics Failure fix * Generated from c2fc52d415140376e70e64d0e3d4703c23ec0e2a Camel casing failure * Generated from 10b920e497dd60808ea1c9f89325bf3f366af79a Update bms.json Adding azure vm workload policy back and copying IaaSVMRestoreRequest to 2017-07-01 * Generated from a2315a7436ffff90c2187103294035a4377c5fec Merge branch 'users/adit/generated' * Generated from 2ed2ddce7a58909f89fc4cd728c4fe2efe1ca0d7 Incorporating PR comments * Generated from 7f2f8e3f5b57d9fb2ab8c6731f8699a84b21ef43 Moving Get and Patch on vaultconfig to version 2019-05-13 Moving Patch and Get of vault config to 2019-05-13 * Generated from 1673d919ce100fe910b2e950b5ac297e30eb1c6a Fixing validation errors * Generated from e868833c4c6499353c9c04bbbfd3de261b750a9c Updating vault config feature flag name * Generated from 4b7c0f58757b9f9d86be85357070788cb8881978 Taken care of Ryan's comment Policy comment is still pending * Generated from f0e79eff1574dd894d881bbf697f016b0f5e8a6e Moved all policy actions to 2019-05-13 version * Generated from 94fc988ab4cbee533fa8fca60f8773a387e7f857 Mark additionalDetail as readonly * Generated from 99b812e62e2d6cb1d7634bfd393a69cf5b85f2fa (#5965) Update go & ruby for 3.1 * Generated from d3a4f2d1674a63bc9a4a57015f956833c7d40f7b (#6004) Update LUIS-Authoring.json fix semantic bugs * Generated from 2128273966bce4b74889c8d94b5f3b2cb6592bd8 (#6007) fixed spellcheck * Generated from 55e842916abe83a008e4078b3cfb384c5a49ebf6 (#6010) Modify SecureString to SecretBase * Generated from 16ff787a51dc55db850a3486cccf7780722c1e41 (#6018) Revert changes in input-files to avoid errors * Generated from 0e60fa1cd6adba0b91d7c91ebaaa4fc65c110b4b (#6017) fixing the build * Generated from fecc99c28f9ff6521a2cce0d481429b2b4ab78b5 (#6050) include property in update as well * Generated from 470b9dc33f877037875aca6fcedbbd845b88ba78 (#6028) Update advisor.json * Generated from f639fa1a11578b5cad9c3a155da216117d6e0059 (#6036) chore: jsonfmt appplatform * Generated from c7ff553c30947fdc9a3e133cc8c1ec3740abc0ac (#6046) [SRP] Support Active Directory and regenerate kerb keys * Add Go 1.13 to CI (#6061) Updated Ubuntu image to 18.04. Removed travis CI file. * [AutoPR policyinsights/resource-manager] Adding a baseline folder for PolicyInsights 2019-10-01. Contents are same as prior version, I will make changes once this PR is complete. (#6041) * Generated from 551a94e578553160c7a3ef54b75a2cdff76acc5a fix go build error * Generated from 964ec2957f79ce66ce1f0010e15d774904c753c7 Added spec json files for other resources to be added to the package. Also updated policyStates.json as per latest API changes. * Generated from 33073abb10a1576efd929ed0344af26b4db6037a Added new columns in the examples. Also, Removed metadata path. * Generated from 89e4b3f2e4d5f61efd6d0a1bdacfc1db7a912c85 (#6067) [DataFactory]Add CompressionCodec property for ORC Dataset * Generated from 7face07707cee94abd393c81397c13c71a64c161 (#6070) Fix mistakes. * Generated from 92dd4e7a8d556480e7db4c970c5463b380dfc08f (#6055) Small change - Modify the description for grace period * Generated from 08ad8aa32278a0ffb8ef88220d87820e539e51a6 Add "Allocating","Upgrading" and "Compiling" enum into DeploymentResourceStatus. * [AutoPR appplatform/resource-manager] Rest API for the RP Microsoft.AppPlatform (#6027) * Generated from ca372100531fa406bab65736d59fbd6ffbb7eff4 Rest API for the RP Microsoft.AppPlatform * Generated from db71a1982bb8b1c6c26fd5008b2eb4c2e7924d12 Fix spellcheck. * Generated from b03312169035627c37a4aeaf8d8abe52b5e3d346 Resolve comment of changing operation "CheckNameAvailability" to "Services_CheckNameAvailability". * Generated from d2dd204e7e9c42c2fdfe3d1c11c253aeac06fa56 Add "Allocating","Upgrading" and "Compiling" enum into DeploymentResourceStatus. * Generated from b1da08951a0828c7f9e0678549b54d137e15961a (#6078) Removing contentions APIs from spec * [AutoPR cost-management/resource-manager] CostManagement RP- Introducing API Version 2019-10-01 plus adding Modern Commerce Account Scopes to Query and Dimension APIs. (#6026) * Generated from 2faed1c1199a8cecdfad39af476c06231bcb16ab Added new item for Go Package * Generated from a019ceb117fb91e8f279230976814e9a09da4bcb Fixed some minor issues * Generated from 79e2ea6d6989acb5ad53ba470c36112302b72ff3 Fixed some minor issues and also added missing description for properties * Generated from a1e3eb2f88e93b67dba788fe6abcd993658f8aae addressed some minor issues * Generated from fc698e277dbb465389999eacb1de8e633b1ee90f Resolved conflicts with DiskRP definition names for the DiskEncryptionSet (#7340) * updated swagger * updated swagger * Removed example files which are not relevant and added links to examples for newly added property * fixed the syntax error * updated swagger * fixed the sytax error * updated code * udpated swagger to create DiskEncryptionSet as new property to initiate * resolved conflicts and updated swagger due to conflict in the DiskRP definitions * Generated from a44cd8f82ea92dc521067dd93f772408bf735735 Disk 2019-07-01 version (#7280) * Copy compute.json and runCommands.json from 2019-03-01 to 2019-07-01 * changes to add publicIpAddressVersion field (#7173) * Add diskEncryptionSet in swagger compute-2019-07 * resolve semantic conflicts * Fix model conflicts * Resolve readme * Resolve readme * Resolve description conflicts * Improve description * Fix spell error * Add some examples. * fix model error * Generated from b2a86857b04fa5de515663f5fb4c500784ac3d16 (#6015) updating the description of storage account id * [AutoPR compute/resource-manager] Private temp (#6000) * Generated from 8e9ad09f3def46e2ce770b078bafc1d045f02666 Remove uniqueId in swagger * Generated from cbef264cc94187b8115c04c10d598383572b4eb0 Remove required for diskEncryptionSetId * Generated from cbef264cc94187b8115c04c10d598383572b4eb0 Remove required for diskEncryptionSetId * Generated from b95c1f587e09552c59e22558497befa04e739714 Update 2019-07 from latest 2019-03 update. * Generated from f9b0aa74ce36ad89f61118c811984f961d76e1b7 Update swagger (#7510) * Copy compute.json and runCommands.json from 2019-03-01 to 2019-07-01 * changes to add publicIpAddressVersion field (#7173) * Add diskEncryptionSet in swagger compute-2019-07 * resolve semantic conflicts * Fix model conflicts * Resolve readme * Resolve readme * Resolve description conflicts * Improve description * Fix spell error * Add some examples. * fix model error * Update examples * Remove uniqueId in swagger * Remove required for diskEncryptionSetId * Update principalId and tenantId to be readonly * small space fix * Generated from b70af9184bd96b16fb8430d8f495666c4e98566f Add default responses to new APIs. * Generated from 1175f21020d781bcd32041246ab560177fe3edcf Updating swagger spec to fix billing plans schema in catalogs response. * Generated from 032bb9b160526aab1a3ee4a5f876a1a987e399fe (#6108) Add 2019-06-01 in storage for golang * Generated from c0d6fb888aea1d3ed46becd97c9c427ac4bff5ec (#6058) Fix formatting. * [AutoPR containerservice/resource-manager] [WIP]add aks rotate-certs operation for 2019-08-01 (#6088) * Generated from 018a5faf169cc9f24c74a0e8c79587dce1171129 remove 200 return code * Generated from 965878ad7cb4fb6cb6d8cc7467ccbb000dc05a36 feat: use 204 instead of 200 * Generated from e08f7a3ba78fe8ab91efcdacde25ab986c6eca0f (#6104) updating sdk tags for 2019-10-01 api version (#7550) * updating sdk tags for 2019-10-01 api version * fixing ci errors * Generated from 6fe4f8016ca318dac93474cf69f5c111c0671454 (#6097) fix build * Generated from 90ee9c9a19e9c1aafce78f6232b9dbbed15434a8 (#5966) Refactory CognitiveServicesAccount model specification. * [AutoPR eventgrid/data-plane] update-event-schema-for-azure-storage-event-grid-notification-for-cr… (#6044) * Generated from 428c006d60546419a3b147a7fe9aa41d541ebe65 update-event-schema-for-azure-storage-event-grid-notification-for-create-delete-directory-and-rename-blob-directory * Generated from e1e58a72a322f6a32ebf891169674985771267f1 update according to pr reviews * Generated from 74a61c2feb1bc51623d2c11545aa52532ed20198 update according to pr reviews * [AutoPR eventgrid/resource-manager] EventGrid: New preview API version with support for additional destination types, CloudEvents 1.0, and batching support. (#6102) * Generated from 2f3e7dfe09d45258a6bd27be7fd4b7bbfb67a9bc Add new API version to README files. * Generated from 227d311a35e44441be395c70515641008f39942e Made a minor rename to one property (azureActiveDirectoryApplicationObjectId) based on feedback. * Generated from 3df959debc8a270d8f8c7af0de16d63938009fe3 (#6119) Fix error in luis runtime readme * Removed preview package for luis/runtime/v3.0 since it has been made stable * Fix profiles * Generated from b83db8b3bbb9c1a82591d08e46903a69c16a9334 (#6118) Change go sdk from tag 2019-07-01 to 2019-07 * Generated from 7fae08b6292f00a279b78836e707791df4aff421 (#6139) Changed to v3 * Generated from 41580d13b1a5ad6bccf689f546884361c988e98e (#6138) Update ResourceIdentity to EncryptionSetIdentity * Generated from e914f092dbc78e6d6319f88f5e59381c98cdd7ce (#6131) Add minimumTLSVersion field to CustomDomainHttpsParameters in latest CDN API * Generated from 60f4598fd519843b5b992024169d9af2eab5bdbe (#6089) Changed WebActivity and webhook activity auth to support both AKV and Secrets * Generated from c4bc95d6f727f0702a8b3a588c22dddf69d3ee1c (#6112) Update data set related documentation comments * Generated from 88d6a1d2d54b122af05cdeb24a995650dba91336 added missing part from 2019-08-01 * Generated from 05c0da669c2d1eda1061114132d86dab698bbbef adding swagger-to-sdk section * Generated from 980a4a36c65ce19efc0707a489f0c94e8e291455 1. Make PUT and PATCH against App resource supports async. 2. Remove "Processing" enum from DeploymentResourceProperties's status property. 3. Rename "Processing" enum to "Updating" for DeploymentResourceProperties's provisioningState. * Generated from dc469e5db850fadb8dc524f9b136ac262e1233cd (#6150) update readme * Generated from 2bf8ae41b02cc56508afee3fb34fc9e742d65776 (#6152) Update Db2LinkedServiceTypeProperties * Generated from 3a72ff129dfe06292f39bbfd2c98c414db71a41a (#6163) Update cache flush,start,stop and upgrade firmware examples to reflext 204 status code. * [AutoPR vmwarecloudsimple/resource-manager] [DO NOT MERGE] Update Microsoft.VMwareCloudSimple provider schema to Cloudsimple 44 release (#6033) * Generated from 5bf923e3f6c39ce577407eae30403dfe835c7542 Update Microsoft.VMwareCloudSimple provider schema to 44 release of Cloudsimple * Generated from fe16507aa9029e891a7286e4cf1eceeda1361063 Update Microsoft.VMwareCloudSimple provider schema to 44 release of Cloudsimple * Generated from 3569147399df87983f430b30bc5df237dad128ac Update Microsoft.VMwareCloudSimple provider schema to 44 release of Cloudsimple * Generated from 483ebc4c0b35d13b11df0de3369a94ba62923e31 Update Microsoft.VMwareCloudSimple provider schema to 44 release of Cloudsimple * [AutoPR cognitiveservices/data-plane/VisualSearch] Adding EU compliance not to description (#6133) * Generated from e8a4e07f183bfd751502cfbd4cae3dd09f033bdd Adding EU compliance not to description * Generated from 9cf846d5a6be1cc6628a67a33b1724983a7f3e47 fixed strong tag * Generated from edd3ba7afcbc2d1d338ccecd7c4e30549901a105 remove html tags for note * Generated from 2bb157c778ece564f26a975ba078b5fe6ff28e34 (#6173) Add 2019-10-01 * [AutoPR domainservices/resource-manager] Remove ReplicaSet Nested Resource (#6149) * Generated from 7dcde316dc95ae117ec71fdbfee6c8d52c7197a0 Remove ReplicaSet Nested Resource * Generated from a7ad4520230d029f214826fb7ca1f442e6c95e8e Fix readyonly properties * Generated from 0d43fb7bbb031d638118feb926c31f5314e47ed6 (#6176) update path for readme.go.md * Generated from latest swagger * Fix profile * Generated from d2f677ddddfe6d366ae1211824e8290a7f922d08 (#6193) Add examples with new SKUs * [AutoPR cognitiveservices/data-plane/LUIS/Authoring] Update LUIS Authoring v3.0-preview swagger (#6181) * Generated from 80df648593854cd3baa52059d3215a8dc42f4399 update swagger * Generated from 72db358677deccc675193fe7ffa90eddb8d3515d Change url * Generated from f2c66704326720f700ccc97eb1a8cff88dda7ccd Add missing field * Generated from ce4650ccf744b4c047d64f332e7f808f04f49706 Adding import changes * Generated from 6a69569b69d2d6187f8b5cf83a420dd71146ae4e Changes * [AutoPR cosmos-db/resource-manager] Cosmos DB patch and multi-api support (#5937) * Generated from 3b7573ec3a5b925233a621247469bdb58e1121f0 revert changes to old api swagger * Generated from b14e1323073f43c8e66e7ec59241def9f4ca1c96 rebasing and adding preview versions to sdk generation * Generated from 032d4a3bf0d9a3e2980c6fdce73b735deedd0a5c create or update method with guidance in the description * Generated from b278a4f58378d5a1acb4978aa7aced5a1fa85578 minor text changes * Generated from b278a4f58378d5a1acb4978aa7aced5a1fa85578 minor text changes * Generated from b278a4f58378d5a1acb4978aa7aced5a1fa85578 minor text changes * Generated from 97720b86a19cbb565b45d0093dbe6c4709b24d81 (#6187) Web activity changes for IR * [AutoPR serialconsole/resource-manager] Update serial console swagger (#5988) * Generated from 90f54203590d5ea2fdf89e7e0d9356e873cee4f9 Make operationId casing consistent * Generated from 4e3f06765eb98cfbcd2c60a58107674541d6bb97 Describe GetOperations output * Generated from 968a389fe7812e416c766ea135b59bffb053e7de Add x-ms-parameter-location * Generated from 36f34b427f92c73da8d76011a5c11c52fe8ea741 rename GetSerialConsoleDisabledResult to SerialConsoleStatus and update example accordingly * Generated from edb7b3d76a28d5d6212092de9dc63052f768d11b (#6183) Remove FailoverDatabaseReadableSecondary.json and include the extra parameter in FailoverDatabase.json instead * Generated from eb302b3cbd2722aec702778e5e597d28da25bd77 (#6148) [SRP] Add delete retention policy for blob container and file share * Generated from c606d0445f3b6135d1f59d222377566d29337f8f (#6165) Add Azure Security Center for IoT to productFilter enum * Generated from 68e8f31b27ce7a56c13ee87dfa1108997844e87b (#6185) Improve Network's descriptions * [AutoPR network/resource-manager] Fix the typo for actionsRequired in PrivateLinkServiceConnectionState. (#6195) * Generated from 91d1a252fb1849bfe991da44bfa0599d7324f3e4 Correct it for all example and for all other API versions. * Generated from 91d1a252fb1849bfe991da44bfa0599d7324f3e4 Correct it for all example and for all other API versions. * Generated from 02252f119ea54774c081750c905ba6ab1bdad99d (#6219) Fix wrong preview pacakge path * Remove wrong placed preview package * Generated from ccbae4f1c77f972fb8d3290f0ce3a64253d14bdf (#6161) updating with warm store features * Generated from 21bd41666567ed08878c3ee13e68c94cb0e0b987 (#6155) fix missing status code in SignalR * Generated from 11b24359ee5776d40b34555f12fab33a1bd1e5cb (#6208) Rename management.JSON to management.json * Generated from 4d767ed6efbd682422827b26374a2a331ccfc852 (#6202) Fix reference * Add back some legacy packages * Generated from latest swagger * v36.0.0 --- CHANGELOG.md | 38 + Gopkg.lock | 4 +- Gopkg.toml | 2 +- .../datafactory/mgmt/datafactory/models.go | 6 +- .../machinelearning/mgmt/workspaces/models.go | 3 +- .../mgmt/workspaces/workspacesapi/models.go | 2 +- .../machinelearningservicesapi/models.go | 4 +- .../mgmt/machinelearningservices/models.go | 57 +- .../latest/resources/mgmt/policy/models.go | 24 +- .../resources/mgmt/policy/policyapi/models.go | 2 +- .../mgmt/serialconsole/models.go | 32 +- .../serialconsole/serialconsoleapi/models.go | 4 +- .../latest/signalr/mgmt/signalr/models.go | 13 + .../datafactory/mgmt/datafactory/models.go | 6 +- .../machinelearning/mgmt/workspaces/models.go | 3 +- .../mgmt/workspaces/workspacesapi/models.go | 2 +- .../machinelearningservicesapi/models.go | 4 +- .../mgmt/machinelearningservices/models.go | 57 +- .../luis/authoring/models.go | 2 + .../mgmt/documentdb/documentdbapi/models.go | 43 + .../cosmos-db/mgmt/documentdb/models.go | 543 +++ .../hanaonazure/mgmt/hanaonazure/models.go | 4 + .../managementgroupsapi/models.go | 2 +- .../resources/mgmt/managementgroups/models.go | 23 +- .../mgmt/securityinsight/models.go | 1 + .../preview/preview/sql/mgmt/sql/models.go | 10 + .../mgmt/timeseriesinsights/models.go | 16 + .../preview/resources/mgmt/policy/models.go | 24 +- .../resources/mgmt/policy/policyapi/models.go | 2 +- .../mgmt/serialconsole/models.go | 32 +- .../serialconsole/serialconsoleapi/models.go | 4 +- .../preview/signalr/mgmt/signalr/models.go | 13 + .../mgmt/2018-06-01/datafactory/models.go | 64 +- .../mgmt/2019-10-01/workspaces/client.go | 52 + .../mgmt/2019-10-01/workspaces/models.go | 503 +++ .../mgmt/2019-10-01/workspaces/operations.go | 110 + .../mgmt/2019-10-01/workspaces/version.go | 30 + .../mgmt/2019-10-01/workspaces/workspaces.go | 741 ++++ .../workspaces/workspacesapi/interfaces.go | 45 + .../machinelearningservices/client.go | 165 + .../machinelearningcompute.go | 646 ++++ .../machinelearningservicesapi/interfaces.go | 94 + .../machinelearningservices/models.go | 3341 +++++++++++++++++ .../machinelearningservices/operations.go | 109 + .../machinelearningservices/quotas.go | 245 ++ .../machinelearningservices/usages.go | 161 + .../machinelearningservices/version.go | 30 + .../virtualmachinesizes.go | 124 + .../workspacefeatures.go | 156 + .../machinelearningservices/workspaces.go | 741 ++++ .../network/mgmt/2019-04-01/network/models.go | 4 +- .../network/mgmt/2019-06-01/network/models.go | 4 +- .../network/mgmt/2019-07-01/network/models.go | 4 +- .../network/mgmt/2019-08-01/network/models.go | 4 +- .../mgmt/2019-09-01/network/ipgroups.go | 2 +- .../network/mgmt/2019-09-01/network/models.go | 38 +- .../v3.0/luis/authoring/apps.go | 44 +- .../v3.0/luis/authoring/azureaccounts.go | 8 +- .../v3.0/luis/authoring/examples.go | 8 +- .../v3.0/luis/authoring/features.go | 16 +- .../v3.0/luis/authoring/model.go | 220 +- .../v3.0/luis/authoring/models.go | 60 +- .../v3.0/luis/authoring/pattern.go | 16 +- .../v3.0/luis/authoring/permissions.go | 8 +- .../v3.0/luis/authoring/settings.go | 4 +- .../v3.0/luis/authoring/train.go | 4 +- .../v3.0/luis/authoring/versions.go | 16 +- .../documentdb/cassandraresources.go | 0 .../2019-08-01-preview/documentdb/client.go | 0 .../documentdb/collection.go | 0 .../documentdb/collectionpartition.go | 0 .../documentdb/collectionpartitionregion.go | 0 .../documentdb/collectionregion.go | 0 .../2019-08-01-preview/documentdb/database.go | 0 .../documentdb/databaseaccountregion.go | 0 .../documentdb/databaseaccounts.go | 0 .../documentdb/documentdbapi/interfaces.go | 2 +- .../documentdb/gremlinresources.go | 0 .../2019-08-01-preview/documentdb/models.go | 2 +- .../documentdb/mongodbresources.go | 0 .../documentdb/operations.go | 0 .../documentdb/partitionkeyrangeid.go | 0 .../documentdb/partitionkeyrangeidregion.go | 0 .../documentdb/percentile.go | 0 .../documentdb/percentilesourcetarget.go | 0 .../documentdb/percentiletarget.go | 0 .../documentdb/privateendpointconnections.go | 0 .../documentdb/privatelinkresources.go | 0 .../documentdb/sqlresources.go | 0 .../documentdb/tableresources.go | 0 .../2019-08-01-preview/documentdb/version.go | 0 .../2017-11-03-preview/hanaonazure/models.go | 12 +- .../2019-11-01/managementgroups/client.go | 262 ++ .../2019-11-01/managementgroups/entities.go | 210 ++ .../managementgroups/managementgroups.go | 637 ++++ .../managementgroupsapi/interfaces.go | 67 + .../2019-11-01/managementgroups/models.go | 1502 ++++++++ .../2019-11-01/managementgroups/operations.go | 149 + .../managementgroups/subscriptions.go | 209 ++ .../2019-11-01/managementgroups/version.go | 30 + .../securityinsight/models.go | 10 +- .../mgmt/2018-06-01-preview/sql/databases.go | 10 +- .../sql/mgmt/2018-06-01-preview/sql/models.go | 15 + .../sql/sqlapi/interfaces.go | 2 +- .../timeseriesinsights/environments.go | 11 +- .../timeseriesinsights/models.go | 351 +- .../timeseriesinsightsapi/interfaces.go | 2 +- .../mgmt/2019-09-01/policy/assignments.go | 966 +++++ .../mgmt/2019-09-01/policy/client.go | 51 + .../mgmt/2019-09-01/policy/definitions.go | 910 +++++ .../mgmt/2019-09-01/policy/models.go | 1120 ++++++ .../2019-09-01/policy/policyapi/interfaces.go | 71 + .../mgmt/2019-09-01/policy/setdefinitions.go | 927 +++++ .../mgmt/2019-09-01/policy/version.go | 30 + .../mgmt/2018-05-01/serialconsole/client.go | 299 +- .../mgmt/2018-05-01/serialconsole/console.go | 187 - .../mgmt/2018-05-01/serialconsole/list.go | 113 - .../2018-05-01/serialconsole/listconsole.go | 115 - .../mgmt/2018-05-01/serialconsole/models.go | 56 +- .../serialconsoleapi/interfaces.go | 26 +- .../signalr/mgmt/2018-10-01/signalr/models.go | 52 +- .../mgmt/2019-06-01/storage/blobservices.go | 6 + .../mgmt/2019-06-01/storage/fileservices.go | 11 +- .../storage/mgmt/2019-06-01/storage/models.go | 6 +- version/version.go | 2 +- 125 files changed, 16433 insertions(+), 797 deletions(-) create mode 100644 profiles/preview/preview/cosmos-db/mgmt/documentdb/documentdbapi/models.go create mode 100644 profiles/preview/preview/cosmos-db/mgmt/documentdb/models.go create mode 100644 services/machinelearning/mgmt/2019-10-01/workspaces/client.go create mode 100644 services/machinelearning/mgmt/2019-10-01/workspaces/models.go create mode 100644 services/machinelearning/mgmt/2019-10-01/workspaces/operations.go create mode 100644 services/machinelearning/mgmt/2019-10-01/workspaces/version.go create mode 100644 services/machinelearning/mgmt/2019-10-01/workspaces/workspaces.go create mode 100644 services/machinelearning/mgmt/2019-10-01/workspaces/workspacesapi/interfaces.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/client.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningcompute.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi/interfaces.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/models.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/operations.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/quotas.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/usages.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/version.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/virtualmachinesizes.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspacefeatures.go create mode 100644 services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspaces.go rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/cassandraresources.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/client.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/collection.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartition.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartitionregion.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionregion.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/database.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccountregion.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccounts.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/documentdbapi/interfaces.go (99%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/gremlinresources.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/models.go (99%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/mongodbresources.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/operations.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeid.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeidregion.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentile.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentilesourcetarget.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentiletarget.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/sqlresources.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/tableresources.go (100%) rename services/{ => preview}/cosmos-db/mgmt/2019-08-01-preview/documentdb/version.go (100%) create mode 100644 services/preview/resources/mgmt/2019-11-01/managementgroups/client.go create mode 100644 services/preview/resources/mgmt/2019-11-01/managementgroups/entities.go create mode 100644 services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroups.go create mode 100644 services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroupsapi/interfaces.go create mode 100644 services/preview/resources/mgmt/2019-11-01/managementgroups/models.go create mode 100644 services/preview/resources/mgmt/2019-11-01/managementgroups/operations.go create mode 100644 services/preview/resources/mgmt/2019-11-01/managementgroups/subscriptions.go create mode 100644 services/preview/resources/mgmt/2019-11-01/managementgroups/version.go create mode 100644 services/resources/mgmt/2019-09-01/policy/assignments.go create mode 100644 services/resources/mgmt/2019-09-01/policy/client.go create mode 100644 services/resources/mgmt/2019-09-01/policy/definitions.go create mode 100644 services/resources/mgmt/2019-09-01/policy/models.go create mode 100644 services/resources/mgmt/2019-09-01/policy/policyapi/interfaces.go create mode 100644 services/resources/mgmt/2019-09-01/policy/setdefinitions.go create mode 100644 services/resources/mgmt/2019-09-01/policy/version.go delete mode 100644 services/serialconsole/mgmt/2018-05-01/serialconsole/console.go delete mode 100644 services/serialconsole/mgmt/2018-05-01/serialconsole/list.go delete mode 100644 services/serialconsole/mgmt/2018-05-01/serialconsole/listconsole.go diff --git a/CHANGELOG.md b/CHANGELOG.md index af3cc95c8ea1..85a5a268a857 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # CHANGELOG +## `v36.0.0` + +### New Packages + +| Package Name | API Version | +| -----------: | :---------: | +| documentdb | 2019-08-01-preview | +| machinelearningservices | 2019-11-01 | +| managementgroups | 2019-11-01 | +| policy | 2019-09-01 | +| workspaces | 2019-10-01 | + +### Updated Packages + +| Package Name | API Version | +| -----------: | :---------: | +| datafactory | 2018-06-01 | +| hanaonazure | 2017-11-03-preview | +| securityinsight | 2017-08-01-preview | +| storage | 2019-06-01 | + +### BreakingChanges + +| Package Name | API Version | +| -----------: | :---------: | +| authoring | luis | +| network | 2019-04-01
2019-06-01
2019-07-01
2019-08-01
2019-09-01 | +| serialconsole | 2018-05-01 | +| signalr | 2018-10-01 | +| sql | 2018-06-01-preview | +| timeseriesinsights | 2018-08-15-preview | + +### Removed Packages + +| Package Name | API Version | +| -----------: | :---------: | +| documentdb | 2019-08-01-preview | + ## `v35.1.0` ### New Packages diff --git a/Gopkg.lock b/Gopkg.lock index bdff68621acf..3d076a8f590b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -154,7 +154,7 @@ [[projects]] branch = "master" - digest = "1:634f91b94015dfcb7fe2ab475ee7d6d05bffb0a8ada81839e07a3a3b43067802" + digest = "1:3a0c9d6a605d6a7c90e343ce34bdb8b894d69f6a9cbcda71351b5e48b8d754af" name = "golang.org/x/tools" packages = [ "go/ast/astutil", @@ -172,7 +172,7 @@ "internal/span", ] pruneopts = "UT" - revision = "80f3f9ca0853fa9dbf1ffdc81029677e3c23108b" + revision = "6d8f1af9ccc0737695ff54584220e9967e9e661b" [[projects]] branch = "v1" diff --git a/Gopkg.toml b/Gopkg.toml index 397fd11b923c..01b90caabc49 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -25,7 +25,7 @@ [[constraint]] name = "github.com/Azure/go-autorest" - version = "13.3.0" + version = "13.0.0" [[constraint]] branch = "master" diff --git a/profiles/latest/datafactory/mgmt/datafactory/models.go b/profiles/latest/datafactory/mgmt/datafactory/models.go index 7d563468dc89..1a4cb55ecc90 100644 --- a/profiles/latest/datafactory/mgmt/datafactory/models.go +++ b/profiles/latest/datafactory/mgmt/datafactory/models.go @@ -606,8 +606,9 @@ const ( type SsisPackageLocationType = original.SsisPackageLocationType const ( - File SsisPackageLocationType = original.File - SSISDB SsisPackageLocationType = original.SSISDB + File SsisPackageLocationType = original.File + InlinePackage SsisPackageLocationType = original.InlinePackage + SSISDB SsisPackageLocationType = original.SSISDB ) type StoredProcedureParameterType = original.StoredProcedureParameterType @@ -1848,6 +1849,7 @@ type SQLServerTableDatasetTypeProperties = original.SQLServerTableDatasetTypePro type SQLSink = original.SQLSink type SQLSource = original.SQLSource type SSISAccessCredential = original.SSISAccessCredential +type SSISChildPackage = original.SSISChildPackage type SSISExecutionCredential = original.SSISExecutionCredential type SSISExecutionParameter = original.SSISExecutionParameter type SSISLogLocation = original.SSISLogLocation diff --git a/profiles/latest/machinelearning/mgmt/workspaces/models.go b/profiles/latest/machinelearning/mgmt/workspaces/models.go index 9c326affd385..2d8d10ee0e19 100644 --- a/profiles/latest/machinelearning/mgmt/workspaces/models.go +++ b/profiles/latest/machinelearning/mgmt/workspaces/models.go @@ -22,7 +22,7 @@ package workspaces import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2016-04-01/workspaces" + original "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2019-10-01/workspaces" ) const ( @@ -65,6 +65,7 @@ type OperationsClient = original.OperationsClient type Properties = original.Properties type PropertiesUpdateParameters = original.PropertiesUpdateParameters type Resource = original.Resource +type Sku = original.Sku type UpdateParameters = original.UpdateParameters type Workspace = original.Workspace diff --git a/profiles/latest/machinelearning/mgmt/workspaces/workspacesapi/models.go b/profiles/latest/machinelearning/mgmt/workspaces/workspacesapi/models.go index fc9027d0588b..00eba9a41c36 100644 --- a/profiles/latest/machinelearning/mgmt/workspaces/workspacesapi/models.go +++ b/profiles/latest/machinelearning/mgmt/workspaces/workspacesapi/models.go @@ -19,7 +19,7 @@ package workspacesapi -import original "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2016-04-01/workspaces/workspacesapi" +import original "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2019-10-01/workspaces/workspacesapi" type ClientAPI = original.ClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index 7304674d88f3..c4a603b4c42c 100644 --- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go +++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go @@ -19,11 +19,13 @@ package machinelearningservicesapi -import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi" +type BaseClientAPI = original.BaseClientAPI type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI type OperationsClientAPI = original.OperationsClientAPI type QuotasClientAPI = original.QuotasClientAPI type UsagesClientAPI = original.UsagesClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI +type WorkspaceFeaturesClientAPI = original.WorkspaceFeaturesClientAPI type WorkspacesClientAPI = original.WorkspacesClientAPI diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go index ee20b507ed49..3b33f523c201 100644 --- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go +++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go @@ -22,7 +22,7 @@ package machinelearningservices import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices" + original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices" ) const ( @@ -106,12 +106,20 @@ const ( Count QuotaUnit = original.Count ) +type ReasonCode = original.ReasonCode + +const ( + NotAvailableForRegion ReasonCode = original.NotAvailableForRegion + NotAvailableForSubscription ReasonCode = original.NotAvailableForSubscription + NotSpecified ReasonCode = original.NotSpecified +) + type RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccess const ( - Disabled RemoteLoginPortPublicAccess = original.Disabled - Enabled RemoteLoginPortPublicAccess = original.Enabled - NotSpecified RemoteLoginPortPublicAccess = original.NotSpecified + RemoteLoginPortPublicAccessDisabled RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccessDisabled + RemoteLoginPortPublicAccessEnabled RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccessEnabled + RemoteLoginPortPublicAccessNotSpecified RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccessNotSpecified ) type ResourceIdentityType = original.ResourceIdentityType @@ -127,6 +135,8 @@ const ( InvalidQuotaBelowClusterMinimum Status = original.InvalidQuotaBelowClusterMinimum InvalidQuotaExceedsSubscriptionLimit Status = original.InvalidQuotaExceedsSubscriptionLimit InvalidVMFamilyName Status = original.InvalidVMFamilyName + OperationNotEnabledForRegion Status = original.OperationNotEnabledForRegion + OperationNotSupportedForSku Status = original.OperationNotSupportedForSku Success Status = original.Success Undefined Status = original.Undefined ) @@ -134,8 +144,8 @@ const ( type Status1 = original.Status1 const ( - Status1Disabled Status1 = original.Status1Disabled - Status1Enabled Status1 = original.Status1Enabled + Disabled Status1 = original.Disabled + Enabled Status1 = original.Enabled ) type UnderlyingResourceAction = original.UnderlyingResourceAction @@ -166,6 +176,7 @@ type AmlCompute = original.AmlCompute type AmlComputeNodeInformation = original.AmlComputeNodeInformation type AmlComputeNodesInformation = original.AmlComputeNodesInformation type AmlComputeProperties = original.AmlComputeProperties +type AmlUserFeature = original.AmlUserFeature type BaseClient = original.BaseClient type BasicCompute = original.BasicCompute type BasicComputeNodesInformation = original.BasicComputeNodesInformation @@ -189,6 +200,9 @@ type ErrorResponse = original.ErrorResponse type HDInsight = original.HDInsight type HDInsightProperties = original.HDInsightProperties type Identity = original.Identity +type ListAmlUserFeatureResult = original.ListAmlUserFeatureResult +type ListAmlUserFeatureResultIterator = original.ListAmlUserFeatureResultIterator +type ListAmlUserFeatureResultPage = original.ListAmlUserFeatureResultPage type ListUsagesResult = original.ListUsagesResult type ListUsagesResultIterator = original.ListUsagesResultIterator type ListUsagesResultPage = original.ListUsagesResultPage @@ -217,8 +231,16 @@ type Resource = original.Resource type ResourceID = original.ResourceID type ResourceName = original.ResourceName type ResourceQuota = original.ResourceQuota +type ResourceSkuLocationInfo = original.ResourceSkuLocationInfo +type ResourceSkuZoneDetails = original.ResourceSkuZoneDetails +type Restriction = original.Restriction +type SKUCapability = original.SKUCapability type ScaleSettings = original.ScaleSettings type ServicePrincipalCredentials = original.ServicePrincipalCredentials +type Sku = original.Sku +type SkuListResult = original.SkuListResult +type SkuListResultIterator = original.SkuListResultIterator +type SkuListResultPage = original.SkuListResultPage type SslConfiguration = original.SslConfiguration type SystemService = original.SystemService type UpdateWorkspaceQuotas = original.UpdateWorkspaceQuotas @@ -235,17 +257,25 @@ type VirtualMachineSize = original.VirtualMachineSize type VirtualMachineSizeListResult = original.VirtualMachineSizeListResult type VirtualMachineSizesClient = original.VirtualMachineSizesClient type Workspace = original.Workspace +type WorkspaceFeaturesClient = original.WorkspaceFeaturesClient type WorkspaceListResult = original.WorkspaceListResult type WorkspaceListResultIterator = original.WorkspaceListResultIterator type WorkspaceListResultPage = original.WorkspaceListResultPage type WorkspaceProperties = original.WorkspaceProperties type WorkspacePropertiesUpdateParameters = original.WorkspacePropertiesUpdateParameters +type WorkspaceSku = original.WorkspaceSku type WorkspaceUpdateParameters = original.WorkspaceUpdateParameters type WorkspacesClient = original.WorkspacesClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewListAmlUserFeatureResultIterator(page ListAmlUserFeatureResultPage) ListAmlUserFeatureResultIterator { + return original.NewListAmlUserFeatureResultIterator(page) +} +func NewListAmlUserFeatureResultPage(getNextPage func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error)) ListAmlUserFeatureResultPage { + return original.NewListAmlUserFeatureResultPage(getNextPage) +} func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { return original.NewListUsagesResultIterator(page) } @@ -282,6 +312,12 @@ func NewQuotasClient(subscriptionID string) QuotasClient { func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { return original.NewQuotasClientWithBaseURI(baseURI, subscriptionID) } +func NewSkuListResultIterator(page SkuListResultPage) SkuListResultIterator { + return original.NewSkuListResultIterator(page) +} +func NewSkuListResultPage(getNextPage func(context.Context, SkuListResult) (SkuListResult, error)) SkuListResultPage { + return original.NewSkuListResultPage(getNextPage) +} func NewUsagesClient(subscriptionID string) UsagesClient { return original.NewUsagesClient(subscriptionID) } @@ -297,6 +333,12 @@ func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID stri func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func NewWorkspaceFeaturesClient(subscriptionID string) WorkspaceFeaturesClient { + return original.NewWorkspaceFeaturesClient(subscriptionID) +} +func NewWorkspaceFeaturesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceFeaturesClient { + return original.NewWorkspaceFeaturesClientWithBaseURI(baseURI, subscriptionID) +} func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator { return original.NewWorkspaceListResultIterator(page) } @@ -333,6 +375,9 @@ func PossibleProvisioningStateValues() []ProvisioningState { func PossibleQuotaUnitValues() []QuotaUnit { return original.PossibleQuotaUnitValues() } +func PossibleReasonCodeValues() []ReasonCode { + return original.PossibleReasonCodeValues() +} func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { return original.PossibleRemoteLoginPortPublicAccessValues() } diff --git a/profiles/latest/resources/mgmt/policy/models.go b/profiles/latest/resources/mgmt/policy/models.go index a192ab1aeeee..10d313ff0499 100644 --- a/profiles/latest/resources/mgmt/policy/models.go +++ b/profiles/latest/resources/mgmt/policy/models.go @@ -22,7 +22,7 @@ package policy import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/policy" + original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-09-01/policy" ) const ( @@ -36,6 +36,18 @@ const ( DoNotEnforce EnforcementMode = original.DoNotEnforce ) +type ParameterType = original.ParameterType + +const ( + Array ParameterType = original.Array + Boolean ParameterType = original.Boolean + DateTime ParameterType = original.DateTime + Float ParameterType = original.Float + Integer ParameterType = original.Integer + Object ParameterType = original.Object + String ParameterType = original.String +) + type ResourceIdentityType = original.ResourceIdentityType const ( @@ -49,6 +61,7 @@ const ( BuiltIn Type = original.BuiltIn Custom Type = original.Custom NotSpecified Type = original.NotSpecified + Static Type = original.Static ) type Assignment = original.Assignment @@ -58,15 +71,21 @@ type AssignmentListResultPage = original.AssignmentListResultPage type AssignmentProperties = original.AssignmentProperties type AssignmentsClient = original.AssignmentsClient type BaseClient = original.BaseClient +type CloudError = original.CloudError type Definition = original.Definition +type DefinitionGroup = original.DefinitionGroup type DefinitionListResult = original.DefinitionListResult type DefinitionListResultIterator = original.DefinitionListResultIterator type DefinitionListResultPage = original.DefinitionListResultPage type DefinitionProperties = original.DefinitionProperties type DefinitionReference = original.DefinitionReference type DefinitionsClient = original.DefinitionsClient +type ErrorAdditionalInfo = original.ErrorAdditionalInfo type ErrorResponse = original.ErrorResponse type Identity = original.Identity +type ParameterDefinitionsValue = original.ParameterDefinitionsValue +type ParameterDefinitionsValueMetadata = original.ParameterDefinitionsValueMetadata +type ParameterValuesValue = original.ParameterValuesValue type SetDefinition = original.SetDefinition type SetDefinitionListResult = original.SetDefinitionListResult type SetDefinitionListResultIterator = original.SetDefinitionListResultIterator @@ -120,6 +139,9 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleEnforcementModeValues() []EnforcementMode { return original.PossibleEnforcementModeValues() } +func PossibleParameterTypeValues() []ParameterType { + return original.PossibleParameterTypeValues() +} func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return original.PossibleResourceIdentityTypeValues() } diff --git a/profiles/latest/resources/mgmt/policy/policyapi/models.go b/profiles/latest/resources/mgmt/policy/policyapi/models.go index be7cec1ae017..c57141c7a2f4 100644 --- a/profiles/latest/resources/mgmt/policy/policyapi/models.go +++ b/profiles/latest/resources/mgmt/policy/policyapi/models.go @@ -19,7 +19,7 @@ package policyapi -import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/policy/policyapi" +import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-09-01/policy/policyapi" type AssignmentsClientAPI = original.AssignmentsClientAPI type DefinitionsClientAPI = original.DefinitionsClientAPI diff --git a/profiles/latest/serialconsole/mgmt/serialconsole/models.go b/profiles/latest/serialconsole/mgmt/serialconsole/models.go index 01d78fe04ae4..e7b4b9fd4410 100644 --- a/profiles/latest/serialconsole/mgmt/serialconsole/models.go +++ b/profiles/latest/serialconsole/mgmt/serialconsole/models.go @@ -26,36 +26,18 @@ const ( ) type BaseClient = original.BaseClient -type ConsoleClient = original.ConsoleClient -type DeploymentValidateResult = original.DeploymentValidateResult -type GetDisabledResult = original.GetDisabledResult -type GetResult = original.GetResult -type ListClient = original.ListClient -type ListConsoleClient = original.ListConsoleClient +type DisableSerialConsoleResult = original.DisableSerialConsoleResult +type EnableSerialConsoleResult = original.EnableSerialConsoleResult +type GetSerialConsoleSubscriptionNotFound = original.GetSerialConsoleSubscriptionNotFound type Operations = original.Operations -type SetDisabledResult = original.SetDisabledResult +type OperationsValueItem = original.OperationsValueItem +type OperationsValueItemDisplay = original.OperationsValueItemDisplay +type SetObject = original.SetObject +type Status = original.Status func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewConsoleClient(subscriptionID string) ConsoleClient { - return original.NewConsoleClient(subscriptionID) -} -func NewConsoleClientWithBaseURI(baseURI string, subscriptionID string) ConsoleClient { - return original.NewConsoleClientWithBaseURI(baseURI, subscriptionID) -} -func NewListClient(subscriptionID string) ListClient { - return original.NewListClient(subscriptionID) -} -func NewListClientWithBaseURI(baseURI string, subscriptionID string) ListClient { - return original.NewListClientWithBaseURI(baseURI, subscriptionID) -} -func NewListConsoleClient(subscriptionID string) ListConsoleClient { - return original.NewListConsoleClient(subscriptionID) -} -func NewListConsoleClientWithBaseURI(baseURI string, subscriptionID string) ListConsoleClient { - return original.NewListConsoleClientWithBaseURI(baseURI, subscriptionID) -} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } diff --git a/profiles/latest/serialconsole/mgmt/serialconsole/serialconsoleapi/models.go b/profiles/latest/serialconsole/mgmt/serialconsole/serialconsoleapi/models.go index 1d3c2872f688..713d3c085568 100644 --- a/profiles/latest/serialconsole/mgmt/serialconsole/serialconsoleapi/models.go +++ b/profiles/latest/serialconsole/mgmt/serialconsole/serialconsoleapi/models.go @@ -21,6 +21,4 @@ package serialconsoleapi import original "github.com/Azure/azure-sdk-for-go/services/serialconsole/mgmt/2018-05-01/serialconsole/serialconsoleapi" -type ConsoleClientAPI = original.ConsoleClientAPI -type ListClientAPI = original.ListClientAPI -type ListConsoleClientAPI = original.ListConsoleClientAPI +type BaseClientAPI = original.BaseClientAPI diff --git a/profiles/latest/signalr/mgmt/signalr/models.go b/profiles/latest/signalr/mgmt/signalr/models.go index d7a4c612b6ab..571cef513466 100644 --- a/profiles/latest/signalr/mgmt/signalr/models.go +++ b/profiles/latest/signalr/mgmt/signalr/models.go @@ -29,6 +29,13 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) +type FeatureFlags = original.FeatureFlags + +const ( + EnableConnectivityLogs FeatureFlags = original.EnableConnectivityLogs + ServiceMode FeatureFlags = original.ServiceMode +) + type KeyType = original.KeyType const ( @@ -67,8 +74,11 @@ type CreateOrUpdateProperties = original.CreateOrUpdateProperties type CreateParameters = original.CreateParameters type DeleteFuture = original.DeleteFuture type Dimension = original.Dimension +type ErrorResponse = original.ErrorResponse +type ErrorResponseBody = original.ErrorResponseBody type Feature = original.Feature type Keys = original.Keys +type LogSpecification = original.LogSpecification type MetricSpecification = original.MetricSpecification type NameAvailability = original.NameAvailability type NameAvailabilityParameters = original.NameAvailabilityParameters @@ -142,6 +152,9 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleFeatureFlagsValues() []FeatureFlags { + return original.PossibleFeatureFlagsValues() +} func PossibleKeyTypeValues() []KeyType { return original.PossibleKeyTypeValues() } diff --git a/profiles/preview/datafactory/mgmt/datafactory/models.go b/profiles/preview/datafactory/mgmt/datafactory/models.go index 49ed031c0d23..d1fde85048f3 100644 --- a/profiles/preview/datafactory/mgmt/datafactory/models.go +++ b/profiles/preview/datafactory/mgmt/datafactory/models.go @@ -606,8 +606,9 @@ const ( type SsisPackageLocationType = original.SsisPackageLocationType const ( - File SsisPackageLocationType = original.File - SSISDB SsisPackageLocationType = original.SSISDB + File SsisPackageLocationType = original.File + InlinePackage SsisPackageLocationType = original.InlinePackage + SSISDB SsisPackageLocationType = original.SSISDB ) type StoredProcedureParameterType = original.StoredProcedureParameterType @@ -1848,6 +1849,7 @@ type SQLServerTableDatasetTypeProperties = original.SQLServerTableDatasetTypePro type SQLSink = original.SQLSink type SQLSource = original.SQLSource type SSISAccessCredential = original.SSISAccessCredential +type SSISChildPackage = original.SSISChildPackage type SSISExecutionCredential = original.SSISExecutionCredential type SSISExecutionParameter = original.SSISExecutionParameter type SSISLogLocation = original.SSISLogLocation diff --git a/profiles/preview/machinelearning/mgmt/workspaces/models.go b/profiles/preview/machinelearning/mgmt/workspaces/models.go index 227a5bc5b2f0..2edf2e649de1 100644 --- a/profiles/preview/machinelearning/mgmt/workspaces/models.go +++ b/profiles/preview/machinelearning/mgmt/workspaces/models.go @@ -22,7 +22,7 @@ package workspaces import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2016-04-01/workspaces" + original "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2019-10-01/workspaces" ) const ( @@ -65,6 +65,7 @@ type OperationsClient = original.OperationsClient type Properties = original.Properties type PropertiesUpdateParameters = original.PropertiesUpdateParameters type Resource = original.Resource +type Sku = original.Sku type UpdateParameters = original.UpdateParameters type Workspace = original.Workspace diff --git a/profiles/preview/machinelearning/mgmt/workspaces/workspacesapi/models.go b/profiles/preview/machinelearning/mgmt/workspaces/workspacesapi/models.go index fc9027d0588b..00eba9a41c36 100644 --- a/profiles/preview/machinelearning/mgmt/workspaces/workspacesapi/models.go +++ b/profiles/preview/machinelearning/mgmt/workspaces/workspacesapi/models.go @@ -19,7 +19,7 @@ package workspacesapi -import original "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2016-04-01/workspaces/workspacesapi" +import original "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2019-10-01/workspaces/workspacesapi" type ClientAPI = original.ClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index 7304674d88f3..c4a603b4c42c 100644 --- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go +++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go @@ -19,11 +19,13 @@ package machinelearningservicesapi -import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices/machinelearningservicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi" +type BaseClientAPI = original.BaseClientAPI type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI type OperationsClientAPI = original.OperationsClientAPI type QuotasClientAPI = original.QuotasClientAPI type UsagesClientAPI = original.UsagesClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI +type WorkspaceFeaturesClientAPI = original.WorkspaceFeaturesClientAPI type WorkspacesClientAPI = original.WorkspacesClientAPI diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go index d685dcb8580c..4f28e7ac6a8c 100644 --- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go +++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go @@ -22,7 +22,7 @@ package machinelearningservices import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices" + original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices" ) const ( @@ -106,12 +106,20 @@ const ( Count QuotaUnit = original.Count ) +type ReasonCode = original.ReasonCode + +const ( + NotAvailableForRegion ReasonCode = original.NotAvailableForRegion + NotAvailableForSubscription ReasonCode = original.NotAvailableForSubscription + NotSpecified ReasonCode = original.NotSpecified +) + type RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccess const ( - Disabled RemoteLoginPortPublicAccess = original.Disabled - Enabled RemoteLoginPortPublicAccess = original.Enabled - NotSpecified RemoteLoginPortPublicAccess = original.NotSpecified + RemoteLoginPortPublicAccessDisabled RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccessDisabled + RemoteLoginPortPublicAccessEnabled RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccessEnabled + RemoteLoginPortPublicAccessNotSpecified RemoteLoginPortPublicAccess = original.RemoteLoginPortPublicAccessNotSpecified ) type ResourceIdentityType = original.ResourceIdentityType @@ -127,6 +135,8 @@ const ( InvalidQuotaBelowClusterMinimum Status = original.InvalidQuotaBelowClusterMinimum InvalidQuotaExceedsSubscriptionLimit Status = original.InvalidQuotaExceedsSubscriptionLimit InvalidVMFamilyName Status = original.InvalidVMFamilyName + OperationNotEnabledForRegion Status = original.OperationNotEnabledForRegion + OperationNotSupportedForSku Status = original.OperationNotSupportedForSku Success Status = original.Success Undefined Status = original.Undefined ) @@ -134,8 +144,8 @@ const ( type Status1 = original.Status1 const ( - Status1Disabled Status1 = original.Status1Disabled - Status1Enabled Status1 = original.Status1Enabled + Disabled Status1 = original.Disabled + Enabled Status1 = original.Enabled ) type UnderlyingResourceAction = original.UnderlyingResourceAction @@ -166,6 +176,7 @@ type AmlCompute = original.AmlCompute type AmlComputeNodeInformation = original.AmlComputeNodeInformation type AmlComputeNodesInformation = original.AmlComputeNodesInformation type AmlComputeProperties = original.AmlComputeProperties +type AmlUserFeature = original.AmlUserFeature type BaseClient = original.BaseClient type BasicCompute = original.BasicCompute type BasicComputeNodesInformation = original.BasicComputeNodesInformation @@ -189,6 +200,9 @@ type ErrorResponse = original.ErrorResponse type HDInsight = original.HDInsight type HDInsightProperties = original.HDInsightProperties type Identity = original.Identity +type ListAmlUserFeatureResult = original.ListAmlUserFeatureResult +type ListAmlUserFeatureResultIterator = original.ListAmlUserFeatureResultIterator +type ListAmlUserFeatureResultPage = original.ListAmlUserFeatureResultPage type ListUsagesResult = original.ListUsagesResult type ListUsagesResultIterator = original.ListUsagesResultIterator type ListUsagesResultPage = original.ListUsagesResultPage @@ -217,8 +231,16 @@ type Resource = original.Resource type ResourceID = original.ResourceID type ResourceName = original.ResourceName type ResourceQuota = original.ResourceQuota +type ResourceSkuLocationInfo = original.ResourceSkuLocationInfo +type ResourceSkuZoneDetails = original.ResourceSkuZoneDetails +type Restriction = original.Restriction +type SKUCapability = original.SKUCapability type ScaleSettings = original.ScaleSettings type ServicePrincipalCredentials = original.ServicePrincipalCredentials +type Sku = original.Sku +type SkuListResult = original.SkuListResult +type SkuListResultIterator = original.SkuListResultIterator +type SkuListResultPage = original.SkuListResultPage type SslConfiguration = original.SslConfiguration type SystemService = original.SystemService type UpdateWorkspaceQuotas = original.UpdateWorkspaceQuotas @@ -235,17 +257,25 @@ type VirtualMachineSize = original.VirtualMachineSize type VirtualMachineSizeListResult = original.VirtualMachineSizeListResult type VirtualMachineSizesClient = original.VirtualMachineSizesClient type Workspace = original.Workspace +type WorkspaceFeaturesClient = original.WorkspaceFeaturesClient type WorkspaceListResult = original.WorkspaceListResult type WorkspaceListResultIterator = original.WorkspaceListResultIterator type WorkspaceListResultPage = original.WorkspaceListResultPage type WorkspaceProperties = original.WorkspaceProperties type WorkspacePropertiesUpdateParameters = original.WorkspacePropertiesUpdateParameters +type WorkspaceSku = original.WorkspaceSku type WorkspaceUpdateParameters = original.WorkspaceUpdateParameters type WorkspacesClient = original.WorkspacesClient func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewListAmlUserFeatureResultIterator(page ListAmlUserFeatureResultPage) ListAmlUserFeatureResultIterator { + return original.NewListAmlUserFeatureResultIterator(page) +} +func NewListAmlUserFeatureResultPage(getNextPage func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error)) ListAmlUserFeatureResultPage { + return original.NewListAmlUserFeatureResultPage(getNextPage) +} func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { return original.NewListUsagesResultIterator(page) } @@ -282,6 +312,12 @@ func NewQuotasClient(subscriptionID string) QuotasClient { func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { return original.NewQuotasClientWithBaseURI(baseURI, subscriptionID) } +func NewSkuListResultIterator(page SkuListResultPage) SkuListResultIterator { + return original.NewSkuListResultIterator(page) +} +func NewSkuListResultPage(getNextPage func(context.Context, SkuListResult) (SkuListResult, error)) SkuListResultPage { + return original.NewSkuListResultPage(getNextPage) +} func NewUsagesClient(subscriptionID string) UsagesClient { return original.NewUsagesClient(subscriptionID) } @@ -297,6 +333,12 @@ func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID stri func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func NewWorkspaceFeaturesClient(subscriptionID string) WorkspaceFeaturesClient { + return original.NewWorkspaceFeaturesClient(subscriptionID) +} +func NewWorkspaceFeaturesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceFeaturesClient { + return original.NewWorkspaceFeaturesClientWithBaseURI(baseURI, subscriptionID) +} func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator { return original.NewWorkspaceListResultIterator(page) } @@ -333,6 +375,9 @@ func PossibleProvisioningStateValues() []ProvisioningState { func PossibleQuotaUnitValues() []QuotaUnit { return original.PossibleQuotaUnitValues() } +func PossibleReasonCodeValues() []ReasonCode { + return original.PossibleReasonCodeValues() +} func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { return original.PossibleRemoteLoginPortPublicAccessValues() } diff --git a/profiles/preview/preview/cognitiveservices/luis/authoring/models.go b/profiles/preview/preview/cognitiveservices/luis/authoring/models.go index cec1f7e12769..419c0c92ba50 100644 --- a/profiles/preview/preview/cognitiveservices/luis/authoring/models.go +++ b/profiles/preview/preview/cognitiveservices/luis/authoring/models.go @@ -306,8 +306,10 @@ type Int64 = original.Int64 type IntentClassifier = original.IntentClassifier type IntentPrediction = original.IntentPrediction type IntentsSuggestionExample = original.IntentsSuggestionExample +type JSONChild = original.JSONChild type JSONEntity = original.JSONEntity type JSONModelFeature = original.JSONModelFeature +type JSONModelFeatureInformation = original.JSONModelFeatureInformation type JSONRegexFeature = original.JSONRegexFeature type JSONUtterance = original.JSONUtterance type LabelExampleResponse = original.LabelExampleResponse diff --git a/profiles/preview/preview/cosmos-db/mgmt/documentdb/documentdbapi/models.go b/profiles/preview/preview/cosmos-db/mgmt/documentdb/documentdbapi/models.go new file mode 100644 index 000000000000..adf8c82e8e89 --- /dev/null +++ b/profiles/preview/preview/cosmos-db/mgmt/documentdb/documentdbapi/models.go @@ -0,0 +1,43 @@ +// +build go1.9 + +// Copyright 2019 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package documentdbapi + +import original "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/documentdbapi" + +type CassandraResourcesClientAPI = original.CassandraResourcesClientAPI +type CollectionClientAPI = original.CollectionClientAPI +type CollectionPartitionClientAPI = original.CollectionPartitionClientAPI +type CollectionPartitionRegionClientAPI = original.CollectionPartitionRegionClientAPI +type CollectionRegionClientAPI = original.CollectionRegionClientAPI +type DatabaseAccountRegionClientAPI = original.DatabaseAccountRegionClientAPI +type DatabaseAccountsClientAPI = original.DatabaseAccountsClientAPI +type DatabaseClientAPI = original.DatabaseClientAPI +type GremlinResourcesClientAPI = original.GremlinResourcesClientAPI +type MongoDBResourcesClientAPI = original.MongoDBResourcesClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type PartitionKeyRangeIDClientAPI = original.PartitionKeyRangeIDClientAPI +type PartitionKeyRangeIDRegionClientAPI = original.PartitionKeyRangeIDRegionClientAPI +type PercentileClientAPI = original.PercentileClientAPI +type PercentileSourceTargetClientAPI = original.PercentileSourceTargetClientAPI +type PercentileTargetClientAPI = original.PercentileTargetClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI +type SQLResourcesClientAPI = original.SQLResourcesClientAPI +type TableResourcesClientAPI = original.TableResourcesClientAPI diff --git a/profiles/preview/preview/cosmos-db/mgmt/documentdb/models.go b/profiles/preview/preview/cosmos-db/mgmt/documentdb/models.go new file mode 100644 index 000000000000..52092fed9e02 --- /dev/null +++ b/profiles/preview/preview/cosmos-db/mgmt/documentdb/models.go @@ -0,0 +1,543 @@ +// +build go1.9 + +// Copyright 2019 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package documentdb + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type ConflictResolutionMode = original.ConflictResolutionMode + +const ( + Custom ConflictResolutionMode = original.Custom + LastWriterWins ConflictResolutionMode = original.LastWriterWins +) + +type ConnectorOffer = original.ConnectorOffer + +const ( + Small ConnectorOffer = original.Small +) + +type DataType = original.DataType + +const ( + LineString DataType = original.LineString + MultiPolygon DataType = original.MultiPolygon + Number DataType = original.Number + Point DataType = original.Point + Polygon DataType = original.Polygon + String DataType = original.String +) + +type DatabaseAccountKind = original.DatabaseAccountKind + +const ( + GlobalDocumentDB DatabaseAccountKind = original.GlobalDocumentDB + MongoDB DatabaseAccountKind = original.MongoDB + Parse DatabaseAccountKind = original.Parse +) + +type DatabaseAccountOfferType = original.DatabaseAccountOfferType + +const ( + Standard DatabaseAccountOfferType = original.Standard +) + +type DefaultConsistencyLevel = original.DefaultConsistencyLevel + +const ( + BoundedStaleness DefaultConsistencyLevel = original.BoundedStaleness + ConsistentPrefix DefaultConsistencyLevel = original.ConsistentPrefix + Eventual DefaultConsistencyLevel = original.Eventual + Session DefaultConsistencyLevel = original.Session + Strong DefaultConsistencyLevel = original.Strong +) + +type IndexKind = original.IndexKind + +const ( + Hash IndexKind = original.Hash + Range IndexKind = original.Range + Spatial IndexKind = original.Spatial +) + +type IndexingMode = original.IndexingMode + +const ( + Consistent IndexingMode = original.Consistent + Lazy IndexingMode = original.Lazy + None IndexingMode = original.None +) + +type KeyKind = original.KeyKind + +const ( + Primary KeyKind = original.Primary + PrimaryReadonly KeyKind = original.PrimaryReadonly + Secondary KeyKind = original.Secondary + SecondaryReadonly KeyKind = original.SecondaryReadonly +) + +type PartitionKind = original.PartitionKind + +const ( + PartitionKindHash PartitionKind = original.PartitionKindHash + PartitionKindRange PartitionKind = original.PartitionKindRange +) + +type PrimaryAggregationType = original.PrimaryAggregationType + +const ( + PrimaryAggregationTypeAverage PrimaryAggregationType = original.PrimaryAggregationTypeAverage + PrimaryAggregationTypeLast PrimaryAggregationType = original.PrimaryAggregationTypeLast + PrimaryAggregationTypeMaximum PrimaryAggregationType = original.PrimaryAggregationTypeMaximum + PrimaryAggregationTypeMinimum PrimaryAggregationType = original.PrimaryAggregationTypeMinimum + PrimaryAggregationTypeNone PrimaryAggregationType = original.PrimaryAggregationTypeNone + PrimaryAggregationTypeTotal PrimaryAggregationType = original.PrimaryAggregationTypeTotal +) + +type TriggerOperation = original.TriggerOperation + +const ( + All TriggerOperation = original.All + Create TriggerOperation = original.Create + Delete TriggerOperation = original.Delete + Replace TriggerOperation = original.Replace + Update TriggerOperation = original.Update +) + +type TriggerType = original.TriggerType + +const ( + Post TriggerType = original.Post + Pre TriggerType = original.Pre +) + +type UnitType = original.UnitType + +const ( + Bytes UnitType = original.Bytes + BytesPerSecond UnitType = original.BytesPerSecond + Count UnitType = original.Count + CountPerSecond UnitType = original.CountPerSecond + Milliseconds UnitType = original.Milliseconds + Percent UnitType = original.Percent + Seconds UnitType = original.Seconds +) + +type ARMProxyResource = original.ARMProxyResource +type ARMResourceProperties = original.ARMResourceProperties +type AzureEntityResource = original.AzureEntityResource +type BaseClient = original.BaseClient +type Capability = original.Capability +type CassandraKeyspaceCreateUpdateParameters = original.CassandraKeyspaceCreateUpdateParameters +type CassandraKeyspaceCreateUpdateProperties = original.CassandraKeyspaceCreateUpdateProperties +type CassandraKeyspaceGetProperties = original.CassandraKeyspaceGetProperties +type CassandraKeyspaceGetResults = original.CassandraKeyspaceGetResults +type CassandraKeyspaceListResult = original.CassandraKeyspaceListResult +type CassandraKeyspaceResource = original.CassandraKeyspaceResource +type CassandraPartitionKey = original.CassandraPartitionKey +type CassandraResourcesClient = original.CassandraResourcesClient +type CassandraResourcesCreateUpdateCassandraKeyspaceFuture = original.CassandraResourcesCreateUpdateCassandraKeyspaceFuture +type CassandraResourcesCreateUpdateCassandraTableFuture = original.CassandraResourcesCreateUpdateCassandraTableFuture +type CassandraResourcesDeleteCassandraKeyspaceFuture = original.CassandraResourcesDeleteCassandraKeyspaceFuture +type CassandraResourcesDeleteCassandraTableFuture = original.CassandraResourcesDeleteCassandraTableFuture +type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture = original.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture +type CassandraResourcesUpdateCassandraTableThroughputFuture = original.CassandraResourcesUpdateCassandraTableThroughputFuture +type CassandraSchema = original.CassandraSchema +type CassandraTableCreateUpdateParameters = original.CassandraTableCreateUpdateParameters +type CassandraTableCreateUpdateProperties = original.CassandraTableCreateUpdateProperties +type CassandraTableGetProperties = original.CassandraTableGetProperties +type CassandraTableGetResults = original.CassandraTableGetResults +type CassandraTableListResult = original.CassandraTableListResult +type CassandraTableResource = original.CassandraTableResource +type ClusterKey = original.ClusterKey +type CollectionClient = original.CollectionClient +type CollectionPartitionClient = original.CollectionPartitionClient +type CollectionPartitionRegionClient = original.CollectionPartitionRegionClient +type CollectionRegionClient = original.CollectionRegionClient +type Column = original.Column +type ConflictResolutionPolicy = original.ConflictResolutionPolicy +type ConsistencyPolicy = original.ConsistencyPolicy +type ContainerPartitionKey = original.ContainerPartitionKey +type DatabaseAccountConnectionString = original.DatabaseAccountConnectionString +type DatabaseAccountCreateUpdateParameters = original.DatabaseAccountCreateUpdateParameters +type DatabaseAccountCreateUpdateProperties = original.DatabaseAccountCreateUpdateProperties +type DatabaseAccountGetProperties = original.DatabaseAccountGetProperties +type DatabaseAccountGetResults = original.DatabaseAccountGetResults +type DatabaseAccountListConnectionStringsResult = original.DatabaseAccountListConnectionStringsResult +type DatabaseAccountListKeysResult = original.DatabaseAccountListKeysResult +type DatabaseAccountListReadOnlyKeysResult = original.DatabaseAccountListReadOnlyKeysResult +type DatabaseAccountRegenerateKeyParameters = original.DatabaseAccountRegenerateKeyParameters +type DatabaseAccountRegionClient = original.DatabaseAccountRegionClient +type DatabaseAccountUpdateParameters = original.DatabaseAccountUpdateParameters +type DatabaseAccountUpdateProperties = original.DatabaseAccountUpdateProperties +type DatabaseAccountsClient = original.DatabaseAccountsClient +type DatabaseAccountsCreateOrUpdateFuture = original.DatabaseAccountsCreateOrUpdateFuture +type DatabaseAccountsDeleteFuture = original.DatabaseAccountsDeleteFuture +type DatabaseAccountsFailoverPriorityChangeFuture = original.DatabaseAccountsFailoverPriorityChangeFuture +type DatabaseAccountsListResult = original.DatabaseAccountsListResult +type DatabaseAccountsOfflineRegionFuture = original.DatabaseAccountsOfflineRegionFuture +type DatabaseAccountsOnlineRegionFuture = original.DatabaseAccountsOnlineRegionFuture +type DatabaseAccountsRegenerateKeyFuture = original.DatabaseAccountsRegenerateKeyFuture +type DatabaseAccountsUpdateFuture = original.DatabaseAccountsUpdateFuture +type DatabaseClient = original.DatabaseClient +type ErrorResponse = original.ErrorResponse +type ExcludedPath = original.ExcludedPath +type ExtendedResourceProperties = original.ExtendedResourceProperties +type FailoverPolicies = original.FailoverPolicies +type FailoverPolicy = original.FailoverPolicy +type GremlinDatabaseCreateUpdateParameters = original.GremlinDatabaseCreateUpdateParameters +type GremlinDatabaseCreateUpdateProperties = original.GremlinDatabaseCreateUpdateProperties +type GremlinDatabaseGetProperties = original.GremlinDatabaseGetProperties +type GremlinDatabaseGetResults = original.GremlinDatabaseGetResults +type GremlinDatabaseListResult = original.GremlinDatabaseListResult +type GremlinDatabaseResource = original.GremlinDatabaseResource +type GremlinGraphCreateUpdateParameters = original.GremlinGraphCreateUpdateParameters +type GremlinGraphCreateUpdateProperties = original.GremlinGraphCreateUpdateProperties +type GremlinGraphGetProperties = original.GremlinGraphGetProperties +type GremlinGraphGetResults = original.GremlinGraphGetResults +type GremlinGraphListResult = original.GremlinGraphListResult +type GremlinGraphResource = original.GremlinGraphResource +type GremlinResourcesClient = original.GremlinResourcesClient +type GremlinResourcesCreateUpdateGremlinDatabaseFuture = original.GremlinResourcesCreateUpdateGremlinDatabaseFuture +type GremlinResourcesCreateUpdateGremlinGraphFuture = original.GremlinResourcesCreateUpdateGremlinGraphFuture +type GremlinResourcesDeleteGremlinDatabaseFuture = original.GremlinResourcesDeleteGremlinDatabaseFuture +type GremlinResourcesDeleteGremlinGraphFuture = original.GremlinResourcesDeleteGremlinGraphFuture +type GremlinResourcesUpdateGremlinDatabaseThroughputFuture = original.GremlinResourcesUpdateGremlinDatabaseThroughputFuture +type GremlinResourcesUpdateGremlinGraphThroughputFuture = original.GremlinResourcesUpdateGremlinGraphThroughputFuture +type IncludedPath = original.IncludedPath +type Indexes = original.Indexes +type IndexingPolicy = original.IndexingPolicy +type Location = original.Location +type Metric = original.Metric +type MetricAvailability = original.MetricAvailability +type MetricDefinition = original.MetricDefinition +type MetricDefinitionsListResult = original.MetricDefinitionsListResult +type MetricListResult = original.MetricListResult +type MetricName = original.MetricName +type MetricValue = original.MetricValue +type MongoDBCollectionCreateUpdateParameters = original.MongoDBCollectionCreateUpdateParameters +type MongoDBCollectionCreateUpdateProperties = original.MongoDBCollectionCreateUpdateProperties +type MongoDBCollectionGetProperties = original.MongoDBCollectionGetProperties +type MongoDBCollectionGetResults = original.MongoDBCollectionGetResults +type MongoDBCollectionListResult = original.MongoDBCollectionListResult +type MongoDBCollectionResource = original.MongoDBCollectionResource +type MongoDBDatabaseCreateUpdateParameters = original.MongoDBDatabaseCreateUpdateParameters +type MongoDBDatabaseCreateUpdateProperties = original.MongoDBDatabaseCreateUpdateProperties +type MongoDBDatabaseGetProperties = original.MongoDBDatabaseGetProperties +type MongoDBDatabaseGetResults = original.MongoDBDatabaseGetResults +type MongoDBDatabaseListResult = original.MongoDBDatabaseListResult +type MongoDBDatabaseResource = original.MongoDBDatabaseResource +type MongoDBResourcesClient = original.MongoDBResourcesClient +type MongoDBResourcesCreateUpdateMongoDBCollectionFuture = original.MongoDBResourcesCreateUpdateMongoDBCollectionFuture +type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture = original.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture +type MongoDBResourcesDeleteMongoDBCollectionFuture = original.MongoDBResourcesDeleteMongoDBCollectionFuture +type MongoDBResourcesDeleteMongoDBDatabaseFuture = original.MongoDBResourcesDeleteMongoDBDatabaseFuture +type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture = original.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture +type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture = original.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture +type MongoIndex = original.MongoIndex +type MongoIndexKeys = original.MongoIndexKeys +type MongoIndexOptions = original.MongoIndexOptions +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationListResult = original.OperationListResult +type OperationListResultIterator = original.OperationListResultIterator +type OperationListResultPage = original.OperationListResultPage +type OperationsClient = original.OperationsClient +type PartitionKeyRangeIDClient = original.PartitionKeyRangeIDClient +type PartitionKeyRangeIDRegionClient = original.PartitionKeyRangeIDRegionClient +type PartitionMetric = original.PartitionMetric +type PartitionMetricListResult = original.PartitionMetricListResult +type PartitionUsage = original.PartitionUsage +type PartitionUsagesResult = original.PartitionUsagesResult +type PercentileClient = original.PercentileClient +type PercentileMetric = original.PercentileMetric +type PercentileMetricListResult = original.PercentileMetricListResult +type PercentileMetricValue = original.PercentileMetricValue +type PercentileSourceTargetClient = original.PercentileSourceTargetClient +type PercentileTargetClient = original.PercentileTargetClient +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionListResult = original.PrivateEndpointConnectionListResult +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateEndpointConnectionsCreateOrUpdateFuture = original.PrivateEndpointConnectionsCreateOrUpdateFuture +type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture +type PrivateEndpointProperty = original.PrivateEndpointProperty +type PrivateLinkResource = original.PrivateLinkResource +type PrivateLinkResourceListResult = original.PrivateLinkResourceListResult +type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionStateProperty = original.PrivateLinkServiceConnectionStateProperty +type ProxyResource = original.ProxyResource +type RegionForOnlineOffline = original.RegionForOnlineOffline +type Resource = original.Resource +type SQLContainerCreateUpdateParameters = original.SQLContainerCreateUpdateParameters +type SQLContainerCreateUpdateProperties = original.SQLContainerCreateUpdateProperties +type SQLContainerGetProperties = original.SQLContainerGetProperties +type SQLContainerGetResults = original.SQLContainerGetResults +type SQLContainerListResult = original.SQLContainerListResult +type SQLContainerResource = original.SQLContainerResource +type SQLDatabaseCreateUpdateParameters = original.SQLDatabaseCreateUpdateParameters +type SQLDatabaseCreateUpdateProperties = original.SQLDatabaseCreateUpdateProperties +type SQLDatabaseGetProperties = original.SQLDatabaseGetProperties +type SQLDatabaseGetResults = original.SQLDatabaseGetResults +type SQLDatabaseListResult = original.SQLDatabaseListResult +type SQLDatabaseResource = original.SQLDatabaseResource +type SQLResourcesClient = original.SQLResourcesClient +type SQLResourcesCreateUpdateSQLContainerFuture = original.SQLResourcesCreateUpdateSQLContainerFuture +type SQLResourcesCreateUpdateSQLDatabaseFuture = original.SQLResourcesCreateUpdateSQLDatabaseFuture +type SQLResourcesCreateUpdateSQLStoredProcedureFuture = original.SQLResourcesCreateUpdateSQLStoredProcedureFuture +type SQLResourcesCreateUpdateSQLTriggerFuture = original.SQLResourcesCreateUpdateSQLTriggerFuture +type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture = original.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture +type SQLResourcesDeleteSQLContainerFuture = original.SQLResourcesDeleteSQLContainerFuture +type SQLResourcesDeleteSQLDatabaseFuture = original.SQLResourcesDeleteSQLDatabaseFuture +type SQLResourcesDeleteSQLStoredProcedureFuture = original.SQLResourcesDeleteSQLStoredProcedureFuture +type SQLResourcesDeleteSQLTriggerFuture = original.SQLResourcesDeleteSQLTriggerFuture +type SQLResourcesDeleteSQLUserDefinedFunctionFuture = original.SQLResourcesDeleteSQLUserDefinedFunctionFuture +type SQLResourcesUpdateSQLContainerThroughputFuture = original.SQLResourcesUpdateSQLContainerThroughputFuture +type SQLResourcesUpdateSQLDatabaseThroughputFuture = original.SQLResourcesUpdateSQLDatabaseThroughputFuture +type SQLStoredProcedureCreateUpdateParameters = original.SQLStoredProcedureCreateUpdateParameters +type SQLStoredProcedureCreateUpdateProperties = original.SQLStoredProcedureCreateUpdateProperties +type SQLStoredProcedureGetProperties = original.SQLStoredProcedureGetProperties +type SQLStoredProcedureGetResults = original.SQLStoredProcedureGetResults +type SQLStoredProcedureListResult = original.SQLStoredProcedureListResult +type SQLStoredProcedureResource = original.SQLStoredProcedureResource +type SQLTriggerCreateUpdateParameters = original.SQLTriggerCreateUpdateParameters +type SQLTriggerCreateUpdateProperties = original.SQLTriggerCreateUpdateProperties +type SQLTriggerGetProperties = original.SQLTriggerGetProperties +type SQLTriggerGetResults = original.SQLTriggerGetResults +type SQLTriggerListResult = original.SQLTriggerListResult +type SQLTriggerResource = original.SQLTriggerResource +type SQLUserDefinedFunctionCreateUpdateParameters = original.SQLUserDefinedFunctionCreateUpdateParameters +type SQLUserDefinedFunctionCreateUpdateProperties = original.SQLUserDefinedFunctionCreateUpdateProperties +type SQLUserDefinedFunctionGetProperties = original.SQLUserDefinedFunctionGetProperties +type SQLUserDefinedFunctionGetResults = original.SQLUserDefinedFunctionGetResults +type SQLUserDefinedFunctionListResult = original.SQLUserDefinedFunctionListResult +type SQLUserDefinedFunctionResource = original.SQLUserDefinedFunctionResource +type TableCreateUpdateParameters = original.TableCreateUpdateParameters +type TableCreateUpdateProperties = original.TableCreateUpdateProperties +type TableGetProperties = original.TableGetProperties +type TableGetResults = original.TableGetResults +type TableListResult = original.TableListResult +type TableResource = original.TableResource +type TableResourcesClient = original.TableResourcesClient +type TableResourcesCreateUpdateTableFuture = original.TableResourcesCreateUpdateTableFuture +type TableResourcesDeleteTableFuture = original.TableResourcesDeleteTableFuture +type TableResourcesUpdateTableThroughputFuture = original.TableResourcesUpdateTableThroughputFuture +type ThroughputSettingsGetProperties = original.ThroughputSettingsGetProperties +type ThroughputSettingsGetResults = original.ThroughputSettingsGetResults +type ThroughputSettingsResource = original.ThroughputSettingsResource +type ThroughputSettingsUpdateParameters = original.ThroughputSettingsUpdateParameters +type ThroughputSettingsUpdateProperties = original.ThroughputSettingsUpdateProperties +type TrackedResource = original.TrackedResource +type UniqueKey = original.UniqueKey +type UniqueKeyPolicy = original.UniqueKeyPolicy +type Usage = original.Usage +type UsagesResult = original.UsagesResult +type VirtualNetworkRule = original.VirtualNetworkRule + +func New(subscriptionID string, subscriptionID1 string) BaseClient { + return original.New(subscriptionID, subscriptionID1) +} +func NewCassandraResourcesClient(subscriptionID string, subscriptionID1 string) CassandraResourcesClient { + return original.NewCassandraResourcesClient(subscriptionID, subscriptionID1) +} +func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CassandraResourcesClient { + return original.NewCassandraResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewCollectionClient(subscriptionID string, subscriptionID1 string) CollectionClient { + return original.NewCollectionClient(subscriptionID, subscriptionID1) +} +func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionClient { + return original.NewCollectionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewCollectionPartitionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionClient { + return original.NewCollectionPartitionClient(subscriptionID, subscriptionID1) +} +func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionClient { + return original.NewCollectionPartitionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewCollectionPartitionRegionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { + return original.NewCollectionPartitionRegionClient(subscriptionID, subscriptionID1) +} +func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { + return original.NewCollectionPartitionRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewCollectionRegionClient(subscriptionID string, subscriptionID1 string) CollectionRegionClient { + return original.NewCollectionRegionClient(subscriptionID, subscriptionID1) +} +func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionRegionClient { + return original.NewCollectionRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewDatabaseAccountRegionClient(subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { + return original.NewDatabaseAccountRegionClient(subscriptionID, subscriptionID1) +} +func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { + return original.NewDatabaseAccountRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewDatabaseAccountsClient(subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { + return original.NewDatabaseAccountsClient(subscriptionID, subscriptionID1) +} +func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { + return original.NewDatabaseAccountsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewDatabaseClient(subscriptionID string, subscriptionID1 string) DatabaseClient { + return original.NewDatabaseClient(subscriptionID, subscriptionID1) +} +func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseClient { + return original.NewDatabaseClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewGremlinResourcesClient(subscriptionID string, subscriptionID1 string) GremlinResourcesClient { + return original.NewGremlinResourcesClient(subscriptionID, subscriptionID1) +} +func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) GremlinResourcesClient { + return original.NewGremlinResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewMongoDBResourcesClient(subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { + return original.NewMongoDBResourcesClient(subscriptionID, subscriptionID1) +} +func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { + return original.NewMongoDBResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return original.NewOperationListResultIterator(page) +} +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return original.NewOperationListResultPage(getNextPage) +} +func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { + return original.NewOperationsClient(subscriptionID, subscriptionID1) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewPartitionKeyRangeIDClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { + return original.NewPartitionKeyRangeIDClient(subscriptionID, subscriptionID1) +} +func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { + return original.NewPartitionKeyRangeIDClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewPartitionKeyRangeIDRegionClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { + return original.NewPartitionKeyRangeIDRegionClient(subscriptionID, subscriptionID1) +} +func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { + return original.NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewPercentileClient(subscriptionID string, subscriptionID1 string) PercentileClient { + return original.NewPercentileClient(subscriptionID, subscriptionID1) +} +func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileClient { + return original.NewPercentileClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewPercentileSourceTargetClient(subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { + return original.NewPercentileSourceTargetClient(subscriptionID, subscriptionID1) +} +func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { + return original.NewPercentileSourceTargetClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewPercentileTargetClient(subscriptionID string, subscriptionID1 string) PercentileTargetClient { + return original.NewPercentileTargetClient(subscriptionID, subscriptionID1) +} +func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileTargetClient { + return original.NewPercentileTargetClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewPrivateEndpointConnectionsClient(subscriptionID string, subscriptionID1 string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID, subscriptionID1) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewPrivateLinkResourcesClient(subscriptionID string, subscriptionID1 string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID, subscriptionID1) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewSQLResourcesClient(subscriptionID string, subscriptionID1 string) SQLResourcesClient { + return original.NewSQLResourcesClient(subscriptionID, subscriptionID1) +} +func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLResourcesClient { + return original.NewSQLResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewTableResourcesClient(subscriptionID string, subscriptionID1 string) TableResourcesClient { + return original.NewTableResourcesClient(subscriptionID, subscriptionID1) +} +func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) TableResourcesClient { + return original.NewTableResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func PossibleConflictResolutionModeValues() []ConflictResolutionMode { + return original.PossibleConflictResolutionModeValues() +} +func PossibleConnectorOfferValues() []ConnectorOffer { + return original.PossibleConnectorOfferValues() +} +func PossibleDataTypeValues() []DataType { + return original.PossibleDataTypeValues() +} +func PossibleDatabaseAccountKindValues() []DatabaseAccountKind { + return original.PossibleDatabaseAccountKindValues() +} +func PossibleDatabaseAccountOfferTypeValues() []DatabaseAccountOfferType { + return original.PossibleDatabaseAccountOfferTypeValues() +} +func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel { + return original.PossibleDefaultConsistencyLevelValues() +} +func PossibleIndexKindValues() []IndexKind { + return original.PossibleIndexKindValues() +} +func PossibleIndexingModeValues() []IndexingMode { + return original.PossibleIndexingModeValues() +} +func PossibleKeyKindValues() []KeyKind { + return original.PossibleKeyKindValues() +} +func PossiblePartitionKindValues() []PartitionKind { + return original.PossiblePartitionKindValues() +} +func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { + return original.PossiblePrimaryAggregationTypeValues() +} +func PossibleTriggerOperationValues() []TriggerOperation { + return original.PossibleTriggerOperationValues() +} +func PossibleTriggerTypeValues() []TriggerType { + return original.PossibleTriggerTypeValues() +} +func PossibleUnitTypeValues() []UnitType { + return original.PossibleUnitTypeValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/preview/hanaonazure/mgmt/hanaonazure/models.go b/profiles/preview/preview/hanaonazure/mgmt/hanaonazure/models.go index 9c3bafe16ebf..79c196a30907 100644 --- a/profiles/preview/preview/hanaonazure/mgmt/hanaonazure/models.go +++ b/profiles/preview/preview/hanaonazure/mgmt/hanaonazure/models.go @@ -50,6 +50,7 @@ const ( type HanaInstanceSizeNamesEnum = original.HanaInstanceSizeNamesEnum const ( + S112 HanaInstanceSizeNamesEnum = original.S112 S144 HanaInstanceSizeNamesEnum = original.S144 S144m HanaInstanceSizeNamesEnum = original.S144m S192 HanaInstanceSizeNamesEnum = original.S192 @@ -58,6 +59,9 @@ const ( S224m HanaInstanceSizeNamesEnum = original.S224m S224o HanaInstanceSizeNamesEnum = original.S224o S224om HanaInstanceSizeNamesEnum = original.S224om + S224oo HanaInstanceSizeNamesEnum = original.S224oo + S224oom HanaInstanceSizeNamesEnum = original.S224oom + S224ooo HanaInstanceSizeNamesEnum = original.S224ooo S224oxm HanaInstanceSizeNamesEnum = original.S224oxm S224oxxm HanaInstanceSizeNamesEnum = original.S224oxxm S384 HanaInstanceSizeNamesEnum = original.S384 diff --git a/profiles/preview/preview/resources/mgmt/managementgroups/managementgroupsapi/models.go b/profiles/preview/preview/resources/mgmt/managementgroups/managementgroupsapi/models.go index bc4208e24c23..80a6e0d0d215 100644 --- a/profiles/preview/preview/resources/mgmt/managementgroups/managementgroupsapi/models.go +++ b/profiles/preview/preview/resources/mgmt/managementgroups/managementgroupsapi/models.go @@ -19,7 +19,7 @@ package managementgroupsapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2018-03-01-preview/managementgroups/managementgroupsapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroupsapi" type BaseClientAPI = original.BaseClientAPI type ClientAPI = original.ClientAPI diff --git a/profiles/preview/preview/resources/mgmt/managementgroups/models.go b/profiles/preview/preview/resources/mgmt/managementgroups/models.go index 3c47cc3cacc3..8c750886b270 100644 --- a/profiles/preview/preview/resources/mgmt/managementgroups/models.go +++ b/profiles/preview/preview/resources/mgmt/managementgroups/models.go @@ -22,7 +22,7 @@ package managementgroups import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2018-03-01-preview/managementgroups" + original "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-11-01/managementgroups" ) const ( @@ -56,12 +56,6 @@ const ( Permissions1View Permissions1 = original.Permissions1View ) -type ProvisioningState = original.ProvisioningState - -const ( - Updating ProvisioningState = original.Updating -) - type Reason = original.Reason const ( @@ -83,21 +77,21 @@ const ( type Type = original.Type const ( - ProvidersMicrosoftManagementmanagementGroups Type = original.ProvidersMicrosoftManagementmanagementGroups + MicrosoftManagementmanagementGroups Type = original.MicrosoftManagementmanagementGroups ) type Type1 = original.Type1 const ( - Type1ProvidersMicrosoftManagementmanagementGroups Type1 = original.Type1ProvidersMicrosoftManagementmanagementGroups - Type1Subscriptions Type1 = original.Type1Subscriptions + Type1MicrosoftManagementmanagementGroups Type1 = original.Type1MicrosoftManagementmanagementGroups + Type1Subscriptions Type1 = original.Type1Subscriptions ) type Type2 = original.Type2 const ( - Type2ProvidersMicrosoftManagementmanagementGroups Type2 = original.Type2ProvidersMicrosoftManagementmanagementGroups - Type2Subscriptions Type2 = original.Type2Subscriptions + Type2MicrosoftManagementmanagementGroups Type2 = original.Type2MicrosoftManagementmanagementGroups + Type2Subscriptions Type2 = original.Type2Subscriptions ) type BaseClient = original.BaseClient @@ -142,10 +136,10 @@ type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type OperationResults = original.OperationResults -type OperationResultsProperties = original.OperationResultsProperties type OperationsClient = original.OperationsClient type ParentGroupInfo = original.ParentGroupInfo type PatchManagementGroupRequest = original.PatchManagementGroupRequest +type PathElement = original.PathElement type Properties = original.Properties type SetObject = original.SetObject type SubscriptionsClient = original.SubscriptionsClient @@ -214,9 +208,6 @@ func PossiblePermissions1Values() []Permissions1 { func PossiblePermissionsValues() []Permissions { return original.PossiblePermissionsValues() } -func PossibleProvisioningStateValues() []ProvisioningState { - return original.PossibleProvisioningStateValues() -} func PossibleReasonValues() []Reason { return original.PossibleReasonValues() } diff --git a/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go b/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go index 600b5eef0a5d..d2886b9dfefe 100644 --- a/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go +++ b/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go @@ -312,6 +312,7 @@ const ( AzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = original.AzureActiveDirectoryIdentityProtection AzureAdvancedThreatProtection MicrosoftSecurityProductName = original.AzureAdvancedThreatProtection AzureSecurityCenter MicrosoftSecurityProductName = original.AzureSecurityCenter + AzureSecurityCenterforIoT MicrosoftSecurityProductName = original.AzureSecurityCenterforIoT MicrosoftCloudAppSecurity MicrosoftSecurityProductName = original.MicrosoftCloudAppSecurity ) diff --git a/profiles/preview/preview/sql/mgmt/sql/models.go b/profiles/preview/preview/sql/mgmt/sql/models.go index 06ea636d3fe2..487de81e36f6 100644 --- a/profiles/preview/preview/sql/mgmt/sql/models.go +++ b/profiles/preview/preview/sql/mgmt/sql/models.go @@ -92,6 +92,13 @@ const ( ManagedServerCreateModePointInTimeRestore ManagedServerCreateMode = original.ManagedServerCreateModePointInTimeRestore ) +type ReplicaType = original.ReplicaType + +const ( + Primary ReplicaType = original.Primary + ReadableSecondary ReplicaType = original.ReadableSecondary +) + type SecurityAlertPolicyState = original.SecurityAlertPolicyState const ( @@ -350,6 +357,9 @@ func PossibleManagedInstanceProxyOverrideValues() []ManagedInstanceProxyOverride func PossibleManagedServerCreateModeValues() []ManagedServerCreateMode { return original.PossibleManagedServerCreateModeValues() } +func PossibleReplicaTypeValues() []ReplicaType { + return original.PossibleReplicaTypeValues() +} func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState { return original.PossibleSecurityAlertPolicyStateValues() } diff --git a/profiles/preview/preview/timeseriesinsights/mgmt/timeseriesinsights/models.go b/profiles/preview/preview/timeseriesinsights/mgmt/timeseriesinsights/models.go index 4e0f439b239d..190cf7e8450a 100644 --- a/profiles/preview/preview/timeseriesinsights/mgmt/timeseriesinsights/models.go +++ b/profiles/preview/preview/timeseriesinsights/mgmt/timeseriesinsights/models.go @@ -123,6 +123,7 @@ type SkuName = original.SkuName const ( L1 SkuName = original.L1 + P1 SkuName = original.P1 S1 SkuName = original.S1 S2 SkuName = original.S2 ) @@ -134,6 +135,14 @@ const ( PurgeOldData StorageLimitExceededBehavior = original.PurgeOldData ) +type WarmStoragePropertiesState = original.WarmStoragePropertiesState + +const ( + WarmStoragePropertiesStateError WarmStoragePropertiesState = original.WarmStoragePropertiesStateError + WarmStoragePropertiesStateOk WarmStoragePropertiesState = original.WarmStoragePropertiesStateOk + WarmStoragePropertiesStateUnknown WarmStoragePropertiesState = original.WarmStoragePropertiesStateUnknown +) + type AccessPoliciesClient = original.AccessPoliciesClient type AccessPolicyCreateOrUpdateParameters = original.AccessPolicyCreateOrUpdateParameters type AccessPolicyListResponse = original.AccessPolicyListResponse @@ -220,6 +229,10 @@ type StandardEnvironmentResourceProperties = original.StandardEnvironmentResourc type StandardEnvironmentUpdateParameters = original.StandardEnvironmentUpdateParameters type TimeSeriesIDProperty = original.TimeSeriesIDProperty type TrackedResource = original.TrackedResource +type WarmStorageEnvironmentStatus = original.WarmStorageEnvironmentStatus +type WarmStoragePropertiesUsage = original.WarmStoragePropertiesUsage +type WarmStoragePropertiesUsageStateDetails = original.WarmStoragePropertiesUsageStateDetails +type WarmStoreConfigurationProperties = original.WarmStoreConfigurationProperties func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -302,6 +315,9 @@ func PossibleSkuNameValues() []SkuName { func PossibleStorageLimitExceededBehaviorValues() []StorageLimitExceededBehavior { return original.PossibleStorageLimitExceededBehaviorValues() } +func PossibleWarmStoragePropertiesStateValues() []WarmStoragePropertiesState { + return original.PossibleWarmStoragePropertiesStateValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/resources/mgmt/policy/models.go b/profiles/preview/resources/mgmt/policy/models.go index 8827d97f90d7..e2ece98125d5 100644 --- a/profiles/preview/resources/mgmt/policy/models.go +++ b/profiles/preview/resources/mgmt/policy/models.go @@ -22,7 +22,7 @@ package policy import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/policy" + original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-09-01/policy" ) const ( @@ -36,6 +36,18 @@ const ( DoNotEnforce EnforcementMode = original.DoNotEnforce ) +type ParameterType = original.ParameterType + +const ( + Array ParameterType = original.Array + Boolean ParameterType = original.Boolean + DateTime ParameterType = original.DateTime + Float ParameterType = original.Float + Integer ParameterType = original.Integer + Object ParameterType = original.Object + String ParameterType = original.String +) + type ResourceIdentityType = original.ResourceIdentityType const ( @@ -49,6 +61,7 @@ const ( BuiltIn Type = original.BuiltIn Custom Type = original.Custom NotSpecified Type = original.NotSpecified + Static Type = original.Static ) type Assignment = original.Assignment @@ -58,15 +71,21 @@ type AssignmentListResultPage = original.AssignmentListResultPage type AssignmentProperties = original.AssignmentProperties type AssignmentsClient = original.AssignmentsClient type BaseClient = original.BaseClient +type CloudError = original.CloudError type Definition = original.Definition +type DefinitionGroup = original.DefinitionGroup type DefinitionListResult = original.DefinitionListResult type DefinitionListResultIterator = original.DefinitionListResultIterator type DefinitionListResultPage = original.DefinitionListResultPage type DefinitionProperties = original.DefinitionProperties type DefinitionReference = original.DefinitionReference type DefinitionsClient = original.DefinitionsClient +type ErrorAdditionalInfo = original.ErrorAdditionalInfo type ErrorResponse = original.ErrorResponse type Identity = original.Identity +type ParameterDefinitionsValue = original.ParameterDefinitionsValue +type ParameterDefinitionsValueMetadata = original.ParameterDefinitionsValueMetadata +type ParameterValuesValue = original.ParameterValuesValue type SetDefinition = original.SetDefinition type SetDefinitionListResult = original.SetDefinitionListResult type SetDefinitionListResultIterator = original.SetDefinitionListResultIterator @@ -120,6 +139,9 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleEnforcementModeValues() []EnforcementMode { return original.PossibleEnforcementModeValues() } +func PossibleParameterTypeValues() []ParameterType { + return original.PossibleParameterTypeValues() +} func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return original.PossibleResourceIdentityTypeValues() } diff --git a/profiles/preview/resources/mgmt/policy/policyapi/models.go b/profiles/preview/resources/mgmt/policy/policyapi/models.go index be7cec1ae017..c57141c7a2f4 100644 --- a/profiles/preview/resources/mgmt/policy/policyapi/models.go +++ b/profiles/preview/resources/mgmt/policy/policyapi/models.go @@ -19,7 +19,7 @@ package policyapi -import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/policy/policyapi" +import original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-09-01/policy/policyapi" type AssignmentsClientAPI = original.AssignmentsClientAPI type DefinitionsClientAPI = original.DefinitionsClientAPI diff --git a/profiles/preview/serialconsole/mgmt/serialconsole/models.go b/profiles/preview/serialconsole/mgmt/serialconsole/models.go index 7ef307a409a5..e42c52fc959f 100644 --- a/profiles/preview/serialconsole/mgmt/serialconsole/models.go +++ b/profiles/preview/serialconsole/mgmt/serialconsole/models.go @@ -26,36 +26,18 @@ const ( ) type BaseClient = original.BaseClient -type ConsoleClient = original.ConsoleClient -type DeploymentValidateResult = original.DeploymentValidateResult -type GetDisabledResult = original.GetDisabledResult -type GetResult = original.GetResult -type ListClient = original.ListClient -type ListConsoleClient = original.ListConsoleClient +type DisableSerialConsoleResult = original.DisableSerialConsoleResult +type EnableSerialConsoleResult = original.EnableSerialConsoleResult +type GetSerialConsoleSubscriptionNotFound = original.GetSerialConsoleSubscriptionNotFound type Operations = original.Operations -type SetDisabledResult = original.SetDisabledResult +type OperationsValueItem = original.OperationsValueItem +type OperationsValueItemDisplay = original.OperationsValueItemDisplay +type SetObject = original.SetObject +type Status = original.Status func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewConsoleClient(subscriptionID string) ConsoleClient { - return original.NewConsoleClient(subscriptionID) -} -func NewConsoleClientWithBaseURI(baseURI string, subscriptionID string) ConsoleClient { - return original.NewConsoleClientWithBaseURI(baseURI, subscriptionID) -} -func NewListClient(subscriptionID string) ListClient { - return original.NewListClient(subscriptionID) -} -func NewListClientWithBaseURI(baseURI string, subscriptionID string) ListClient { - return original.NewListClientWithBaseURI(baseURI, subscriptionID) -} -func NewListConsoleClient(subscriptionID string) ListConsoleClient { - return original.NewListConsoleClient(subscriptionID) -} -func NewListConsoleClientWithBaseURI(baseURI string, subscriptionID string) ListConsoleClient { - return original.NewListConsoleClientWithBaseURI(baseURI, subscriptionID) -} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } diff --git a/profiles/preview/serialconsole/mgmt/serialconsole/serialconsoleapi/models.go b/profiles/preview/serialconsole/mgmt/serialconsole/serialconsoleapi/models.go index 1d3c2872f688..713d3c085568 100644 --- a/profiles/preview/serialconsole/mgmt/serialconsole/serialconsoleapi/models.go +++ b/profiles/preview/serialconsole/mgmt/serialconsole/serialconsoleapi/models.go @@ -21,6 +21,4 @@ package serialconsoleapi import original "github.com/Azure/azure-sdk-for-go/services/serialconsole/mgmt/2018-05-01/serialconsole/serialconsoleapi" -type ConsoleClientAPI = original.ConsoleClientAPI -type ListClientAPI = original.ListClientAPI -type ListConsoleClientAPI = original.ListConsoleClientAPI +type BaseClientAPI = original.BaseClientAPI diff --git a/profiles/preview/signalr/mgmt/signalr/models.go b/profiles/preview/signalr/mgmt/signalr/models.go index 2e63915998b2..f3cacdeab936 100644 --- a/profiles/preview/signalr/mgmt/signalr/models.go +++ b/profiles/preview/signalr/mgmt/signalr/models.go @@ -29,6 +29,13 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) +type FeatureFlags = original.FeatureFlags + +const ( + EnableConnectivityLogs FeatureFlags = original.EnableConnectivityLogs + ServiceMode FeatureFlags = original.ServiceMode +) + type KeyType = original.KeyType const ( @@ -67,8 +74,11 @@ type CreateOrUpdateProperties = original.CreateOrUpdateProperties type CreateParameters = original.CreateParameters type DeleteFuture = original.DeleteFuture type Dimension = original.Dimension +type ErrorResponse = original.ErrorResponse +type ErrorResponseBody = original.ErrorResponseBody type Feature = original.Feature type Keys = original.Keys +type LogSpecification = original.LogSpecification type MetricSpecification = original.MetricSpecification type NameAvailability = original.NameAvailability type NameAvailabilityParameters = original.NameAvailabilityParameters @@ -142,6 +152,9 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleFeatureFlagsValues() []FeatureFlags { + return original.PossibleFeatureFlagsValues() +} func PossibleKeyTypeValues() []KeyType { return original.PossibleKeyTypeValues() } diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go index 210e26dfdf33..ee51b42532a7 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/models.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -1256,13 +1256,15 @@ type SsisPackageLocationType string const ( // File ... File SsisPackageLocationType = "File" + // InlinePackage ... + InlinePackage SsisPackageLocationType = "InlinePackage" // SSISDB ... SSISDB SsisPackageLocationType = "SSISDB" ) // PossibleSsisPackageLocationTypeValues returns an array of possible values for the SsisPackageLocationType const type. func PossibleSsisPackageLocationTypeValues() []SsisPackageLocationType { - return []SsisPackageLocationType{File, SSISDB} + return []SsisPackageLocationType{File, InlinePackage, SSISDB} } // StoredProcedureParameterType enumerates the values for stored procedure parameter type. @@ -202593,6 +202595,18 @@ func (sac *SSISAccessCredential) UnmarshalJSON(body []byte) error { return nil } +// SSISChildPackage SSIS embedded child package. +type SSISChildPackage struct { + // PackagePath - Path for embedded child package. Type: string (or Expression with resultType string). + PackagePath interface{} `json:"packagePath,omitempty"` + // PackageName - Name for embedded child package. + PackageName *string `json:"packageName,omitempty"` + // PackageContent - Content for embedded child package. Type: string (or Expression with resultType string). + PackageContent interface{} `json:"packageContent,omitempty"` + // PackageLastModifiedDate - Last modified date for embedded child package. + PackageLastModifiedDate *string `json:"packageLastModifiedDate,omitempty"` +} + // SsisEnvironment ssis environment. type SsisEnvironment struct { // FolderID - Folder id which contains environment. @@ -203086,7 +203100,7 @@ func (sp SsisPackage) AsBasicSsisObjectMetadata() (BasicSsisObjectMetadata, bool type SSISPackageLocation struct { // PackagePath - The SSIS package path. Type: string (or Expression with resultType string). PackagePath interface{} `json:"packagePath,omitempty"` - // Type - The type of SSIS package location. Possible values include: 'SSISDB', 'File' + // Type - The type of SSIS package location. Possible values include: 'SSISDB', 'File', 'InlinePackage' Type SsisPackageLocationType `json:"type,omitempty"` // SSISPackageLocationTypeProperties - SSIS package location properties. *SSISPackageLocationTypeProperties `json:"typeProperties,omitempty"` @@ -203157,6 +203171,14 @@ type SSISPackageLocationTypeProperties struct { AccessCredential *SSISAccessCredential `json:"accessCredential,omitempty"` // ConfigurationPath - The configuration file of the package execution. Type: string (or Expression with resultType string). ConfigurationPath interface{} `json:"configurationPath,omitempty"` + // PackageName - The package name. + PackageName *string `json:"packageName,omitempty"` + // PackageContent - The embedded package content. Type: string (or Expression with resultType string). + PackageContent interface{} `json:"packageContent,omitempty"` + // PackageLastModifiedDate - The embedded package last modified date. + PackageLastModifiedDate *string `json:"packageLastModifiedDate,omitempty"` + // ChildPackages - The embedded child package list. + ChildPackages *[]SSISChildPackage `json:"childPackages,omitempty"` } // UnmarshalJSON is the custom unmarshaler for SSISPackageLocationTypeProperties struct. @@ -203194,6 +203216,42 @@ func (spltp *SSISPackageLocationTypeProperties) UnmarshalJSON(body []byte) error } spltp.ConfigurationPath = configurationPath } + case "packageName": + if v != nil { + var packageName string + err = json.Unmarshal(*v, &packageName) + if err != nil { + return err + } + spltp.PackageName = &packageName + } + case "packageContent": + if v != nil { + var packageContent interface{} + err = json.Unmarshal(*v, &packageContent) + if err != nil { + return err + } + spltp.PackageContent = packageContent + } + case "packageLastModifiedDate": + if v != nil { + var packageLastModifiedDate string + err = json.Unmarshal(*v, &packageLastModifiedDate) + if err != nil { + return err + } + spltp.PackageLastModifiedDate = &packageLastModifiedDate + } + case "childPackages": + if v != nil { + var childPackages []SSISChildPackage + err = json.Unmarshal(*v, &childPackages) + if err != nil { + return err + } + spltp.ChildPackages = &childPackages + } } } @@ -213609,6 +213667,8 @@ type WebActivityTypeProperties struct { Datasets *[]DatasetReference `json:"datasets,omitempty"` // LinkedServices - List of linked services passed to web endpoint. LinkedServices *[]LinkedServiceReference `json:"linkedServices,omitempty"` + // ConnectVia - The integration runtime reference. + ConnectVia *IntegrationRuntimeReference `json:"connectVia,omitempty"` } // WebAnonymousAuthentication a WebLinkedService that uses anonymous authentication to communicate with an diff --git a/services/machinelearning/mgmt/2019-10-01/workspaces/client.go b/services/machinelearning/mgmt/2019-10-01/workspaces/client.go new file mode 100644 index 000000000000..6cb66b287a0c --- /dev/null +++ b/services/machinelearning/mgmt/2019-10-01/workspaces/client.go @@ -0,0 +1,52 @@ +// Package workspaces implements the Azure ARM Workspaces service API version 2019-10-01. +// +// These APIs allow end users to operate on Azure Machine Learning Workspace resources. They support CRUD operations +// for Azure Machine Learning Workspaces. +package workspaces + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Workspaces + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Workspaces. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/machinelearning/mgmt/2019-10-01/workspaces/models.go b/services/machinelearning/mgmt/2019-10-01/workspaces/models.go new file mode 100644 index 000000000000..eeaf1a59790f --- /dev/null +++ b/services/machinelearning/mgmt/2019-10-01/workspaces/models.go @@ -0,0 +1,503 @@ +package workspaces + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2019-10-01/workspaces" + +// State enumerates the values for state. +type State string + +const ( + // Deleted ... + Deleted State = "Deleted" + // Disabled ... + Disabled State = "Disabled" + // Enabled ... + Enabled State = "Enabled" + // Migrated ... + Migrated State = "Migrated" + // Registered ... + Registered State = "Registered" + // Unregistered ... + Unregistered State = "Unregistered" + // Updated ... + Updated State = "Updated" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{Deleted, Disabled, Enabled, Migrated, Registered, Unregistered, Updated} +} + +// WorkspaceType enumerates the values for workspace type. +type WorkspaceType string + +const ( + // Anonymous ... + Anonymous WorkspaceType = "Anonymous" + // Free ... + Free WorkspaceType = "Free" + // PaidPremium ... + PaidPremium WorkspaceType = "PaidPremium" + // PaidStandard ... + PaidStandard WorkspaceType = "PaidStandard" + // Production ... + Production WorkspaceType = "Production" +) + +// PossibleWorkspaceTypeValues returns an array of possible values for the WorkspaceType const type. +func PossibleWorkspaceTypeValues() []WorkspaceType { + return []WorkspaceType{Anonymous, Free, PaidPremium, PaidStandard, Production} +} + +// ErrorResponse the error response send when an operation fails. +type ErrorResponse struct { + // Code - error code + Code *string `json:"code,omitempty"` + // Message - error message + Message *string `json:"message,omitempty"` +} + +// KeysResponse workspace authorization keys for a workspace. +type KeysResponse struct { + autorest.Response `json:"-"` + // PrimaryToken - Primary authorization key for this workspace. + PrimaryToken *string `json:"primaryToken,omitempty"` + // SecondaryToken - Secondary authorization key for this workspace. + SecondaryToken *string `json:"secondaryToken,omitempty"` +} + +// ListResult the result of a request to list machine learning workspace keys. +type ListResult struct { + autorest.Response `json:"-"` + // Value - The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. + Value *[]Workspace `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of machine learning workspaces. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of Workspace values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListResultIterator) Response() ListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListResultIterator) Value() Workspace { + if !iter.page.NotDone() { + return Workspace{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of Workspace values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []Workspace { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// Operation azure Machine Learning Studio REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display name of operation + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay display name of operation +type OperationDisplay struct { + // Provider - The resource provider name: Microsoft.MachineLearning + Provider *string `json:"provider,omitempty"` + // Resource - The resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - The operation that users can perform. + Operation *string `json:"operation,omitempty"` + // Description - The description for the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult an array of operations supported by the resource provider. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of AML Studio operations supported by the AML Studio resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// Properties the properties of a machine learning workspace. +type Properties struct { + // UserStorageAccountID - The fully qualified arm id of the storage account associated with this workspace. + UserStorageAccountID *string `json:"userStorageAccountId,omitempty"` + // OwnerEmail - The email id of the owner for this workspace. + OwnerEmail *string `json:"ownerEmail,omitempty"` + // WorkspaceType - READ-ONLY; The type of this workspace. Possible values include: 'Production', 'Free', 'Anonymous', 'PaidStandard', 'PaidPremium' + WorkspaceType WorkspaceType `json:"workspaceType,omitempty"` + // WorkspaceState - READ-ONLY; The current state of workspace resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', 'Migrated', 'Updated', 'Registered', 'Unregistered' + WorkspaceState State `json:"workspaceState,omitempty"` + // WorkspaceID - READ-ONLY; The immutable id associated with this workspace. + WorkspaceID *string `json:"workspaceId,omitempty"` + // CreationTime - READ-ONLY; The creation time for this workspace resource. + CreationTime *string `json:"creationTime,omitempty"` + // StudioEndpoint - READ-ONLY; The regional endpoint for the machine learning studio service which hosts this workspace. + StudioEndpoint *string `json:"studioEndpoint,omitempty"` + // KeyVaultIdentifierID - The key vault identifier used for encrypted workspaces. + KeyVaultIdentifierID *string `json:"keyVaultIdentifierId,omitempty"` +} + +// PropertiesUpdateParameters the parameters for updating the properties of a machine learning workspace. +type PropertiesUpdateParameters struct { + // WorkspaceState - The current state of workspace resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', 'Migrated', 'Updated', 'Registered', 'Unregistered' + WorkspaceState State `json:"workspaceState,omitempty"` + // KeyVaultIdentifierID - The key vault identifier used for encrypted workspaces. + KeyVaultIdentifierID *string `json:"keyVaultIdentifierId,omitempty"` + // Sku - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// Resource an Azure resource. +type Resource struct { + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` + // Sku - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Sku != nil { + objectMap["sku"] = r.Sku + } + return json.Marshal(objectMap) +} + +// Sku sku of the resource +type Sku struct { + // Name - Name of the sku + Name *string `json:"name,omitempty"` + // Tier - Tier of the sku like Basic or Enterprise + Tier *string `json:"tier,omitempty"` +} + +// UpdateParameters the parameters for updating a machine learning workspace. +type UpdateParameters struct { + // Tags - The resource tags for the machine learning workspace. + Tags map[string]*string `json:"tags"` + // PropertiesUpdateParameters - The properties that the machine learning workspace will be updated with. + *PropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateParameters. +func (up UpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if up.Tags != nil { + objectMap["tags"] = up.Tags + } + if up.PropertiesUpdateParameters != nil { + objectMap["properties"] = up.PropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UpdateParameters struct. +func (up *UpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + up.Tags = tags + } + case "properties": + if v != nil { + var propertiesUpdateParameters PropertiesUpdateParameters + err = json.Unmarshal(*v, &propertiesUpdateParameters) + if err != nil { + return err + } + up.PropertiesUpdateParameters = &propertiesUpdateParameters + } + } + } + + return nil +} + +// Workspace an object that represents a machine learning workspace. +type Workspace struct { + autorest.Response `json:"-"` + // Properties - The properties of the machine learning workspace. + *Properties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` + // Sku - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.Properties != nil { + objectMap["properties"] = w.Properties + } + if w.Location != nil { + objectMap["location"] = w.Location + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Sku != nil { + objectMap["sku"] = w.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Workspace struct. +func (w *Workspace) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + w.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + w.Sku = &sku + } + } + } + + return nil +} diff --git a/services/machinelearning/mgmt/2019-10-01/workspaces/operations.go b/services/machinelearning/mgmt/2019-10-01/workspaces/operations.go new file mode 100644 index 000000000000..9eb5a17f1918 --- /dev/null +++ b/services/machinelearning/mgmt/2019-10-01/workspaces/operations.go @@ -0,0 +1,110 @@ +package workspaces + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. They +// support CRUD operations for Azure Machine Learning Workspaces. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Azure Machine Learning Studio REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "workspaces.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.MachineLearning/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearning/mgmt/2019-10-01/workspaces/version.go b/services/machinelearning/mgmt/2019-10-01/workspaces/version.go new file mode 100644 index 000000000000..5d00e50e3249 --- /dev/null +++ b/services/machinelearning/mgmt/2019-10-01/workspaces/version.go @@ -0,0 +1,30 @@ +package workspaces + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " workspaces/2019-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/machinelearning/mgmt/2019-10-01/workspaces/workspaces.go b/services/machinelearning/mgmt/2019-10-01/workspaces/workspaces.go new file mode 100644 index 000000000000..dedb2b397540 --- /dev/null +++ b/services/machinelearning/mgmt/2019-10-01/workspaces/workspaces.go @@ -0,0 +1,741 @@ +package workspaces + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// Client is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. They support CRUD +// operations for Azure Machine Learning Workspaces. +type Client struct { + BaseClient +} + +// NewClient creates an instance of the Client client. +func NewClient(subscriptionID string) Client { + return NewClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClientWithBaseURI creates an instance of the Client client. +func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { + return Client{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a workspace with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the machine learning workspace belongs. +// workspaceName - the name of the machine learning workspace. +// parameters - the parameters for creating or updating a machine learning workspace. +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.UserStorageAccountID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.OwnerEmail", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("workspaces.Client", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "workspaces.Client", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client Client) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a machine learning workspace. +// Parameters: +// resourceGroupName - the name of the resource group to which the machine learning workspace belongs. +// workspaceName - the name of the machine learning workspace. +func (client Client) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "workspaces.Client", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client Client) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified machine learning workspace. +// Parameters: +// resourceGroupName - the name of the resource group to which the machine learning workspace belongs. +// workspaceName - the name of the machine learning workspace. +func (client Client) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "workspaces.Client", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client Client) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client Client) GetResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the available machine learning workspaces under the specified subscription. +func (client Client) List(ctx context.Context) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "workspaces.Client", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client Client) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/workspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client Client) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client Client) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "workspaces.Client", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "workspaces.Client", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client Client) ListComplete(ctx context.Context) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the available machine learning workspaces under the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group to which the machine learning workspace belongs. +func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "workspaces.Client", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client Client) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client Client) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client Client) listByResourceGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "workspaces.Client", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "workspaces.Client", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListWorkspaceKeys list the authorization keys associated with this workspace. +// Parameters: +// workspaceName - the name of the machine learning workspace. +// resourceGroupName - the name of the resource group to which the machine learning workspace belongs. +func (client Client) ListWorkspaceKeys(ctx context.Context, workspaceName string, resourceGroupName string) (result KeysResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListWorkspaceKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListWorkspaceKeysPreparer(ctx, workspaceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "ListWorkspaceKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListWorkspaceKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "workspaces.Client", "ListWorkspaceKeys", resp, "Failure sending request") + return + } + + result, err = client.ListWorkspaceKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "ListWorkspaceKeys", resp, "Failure responding to request") + } + + return +} + +// ListWorkspaceKeysPreparer prepares the ListWorkspaceKeys request. +func (client Client) ListWorkspaceKeysPreparer(ctx context.Context, workspaceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}/listWorkspaceKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWorkspaceKeysSender sends the ListWorkspaceKeys request. The method will close the +// http.Response Body if it receives an error. +func (client Client) ListWorkspaceKeysSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListWorkspaceKeysResponder handles the response to the ListWorkspaceKeys request. The method always +// closes the http.Response Body. +func (client Client) ListWorkspaceKeysResponder(resp *http.Response) (result KeysResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResyncStorageKeys resync storage keys associated with this workspace. +// Parameters: +// workspaceName - the name of the machine learning workspace. +// resourceGroupName - the name of the resource group to which the machine learning workspace belongs. +func (client Client) ResyncStorageKeys(ctx context.Context, workspaceName string, resourceGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ResyncStorageKeys") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResyncStorageKeysPreparer(ctx, workspaceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "ResyncStorageKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ResyncStorageKeysSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "workspaces.Client", "ResyncStorageKeys", resp, "Failure sending request") + return + } + + result, err = client.ResyncStorageKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "ResyncStorageKeys", resp, "Failure responding to request") + } + + return +} + +// ResyncStorageKeysPreparer prepares the ResyncStorageKeys request. +func (client Client) ResyncStorageKeysPreparer(ctx context.Context, workspaceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}/resyncStorageKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncStorageKeysSender sends the ResyncStorageKeys request. The method will close the +// http.Response Body if it receives an error. +func (client Client) ResyncStorageKeysSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ResyncStorageKeysResponder handles the response to the ResyncStorageKeys request. The method always +// closes the http.Response Body. +func (client Client) ResyncStorageKeysResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates a machine learning workspace with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the machine learning workspace belongs. +// workspaceName - the name of the machine learning workspace. +// parameters - the parameters for updating a machine learning workspace. +func (client Client) Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters UpdateParameters) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "workspaces.Client", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.Client", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters UpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client Client) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client Client) UpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearning/mgmt/2019-10-01/workspaces/workspacesapi/interfaces.go b/services/machinelearning/mgmt/2019-10-01/workspaces/workspacesapi/interfaces.go new file mode 100644 index 000000000000..3c0e58630f26 --- /dev/null +++ b/services/machinelearning/mgmt/2019-10-01/workspaces/workspacesapi/interfaces.go @@ -0,0 +1,45 @@ +package workspacesapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/machinelearning/mgmt/2019-10-01/workspaces" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result workspaces.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*workspaces.OperationsClient)(nil) + +// ClientAPI contains the set of methods on the Client type. +type ClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters workspaces.Workspace) (result workspaces.Workspace, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result workspaces.Workspace, err error) + List(ctx context.Context) (result workspaces.ListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result workspaces.ListResultPage, err error) + ListWorkspaceKeys(ctx context.Context, workspaceName string, resourceGroupName string) (result workspaces.KeysResponse, err error) + ResyncStorageKeys(ctx context.Context, workspaceName string, resourceGroupName string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters workspaces.UpdateParameters) (result workspaces.Workspace, err error) +} + +var _ ClientAPI = (*workspaces.Client)(nil) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/client.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/client.go new file mode 100644 index 000000000000..c45bf7ac1a4d --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/client.go @@ -0,0 +1,165 @@ +// Package machinelearningservices implements the Azure ARM Machinelearningservices service API version 2019-11-01. +// +// These APIs allow end users to operate on Azure Machine Learning Workspace resources. +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Machinelearningservices + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Machinelearningservices. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} + +// ListSkus lists all skus with associated features +func (client BaseClient) ListSkus(ctx context.Context) (result SkuListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSkus") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSkusNextResults + req, err := client.ListSkusPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "ListSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "ListSkus", resp, "Failure sending request") + return + } + + result.slr, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "ListSkus", resp, "Failure responding to request") + } + + return +} + +// ListSkusPreparer prepares the ListSkus request. +func (client BaseClient) ListSkusPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSkusSender sends the ListSkus request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListSkusSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListSkusResponder handles the response to the ListSkus request. The method always +// closes the http.Response Body. +func (client BaseClient) ListSkusResponder(resp *http.Response) (result SkuListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSkusNextResults retrieves the next set of results, if any. +func (client BaseClient) listSkusNextResults(ctx context.Context, lastResults SkuListResult) (result SkuListResult, err error) { + req, err := lastResults.skuListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "listSkusNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "listSkusNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "listSkusNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSkusComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListSkusComplete(ctx context.Context) (result SkuListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSkus") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSkus(ctx) + return +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningcompute.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningcompute.go new file mode 100644 index 000000000000..a1f4adeb26e2 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningcompute.go @@ -0,0 +1,646 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MachineLearningComputeClient is the these APIs allow end users to operate on Azure Machine Learning Workspace +// resources. +type MachineLearningComputeClient struct { + BaseClient +} + +// NewMachineLearningComputeClient creates an instance of the MachineLearningComputeClient client. +func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient { + return NewMachineLearningComputeClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMachineLearningComputeClientWithBaseURI creates an instance of the MachineLearningComputeClient client. +func NewMachineLearningComputeClientWithBaseURI(baseURI string, subscriptionID string) MachineLearningComputeClient { + return MachineLearningComputeClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable +// operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +// parameters - payload with Machine Learning compute definition. +func (client MachineLearningComputeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource) (result MachineLearningComputeCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, computeName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client MachineLearningComputeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) CreateOrUpdateSender(req *http.Request) (future MachineLearningComputeCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) CreateOrUpdateResponder(resp *http.Response) (result ComputeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specified Machine Learning compute. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +// underlyingResourceAction - delete the underlying compute if 'Delete', or detach the underlying compute from +// workspace if 'Detach'. +func (client MachineLearningComputeClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction) (result MachineLearningComputeDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, computeName, underlyingResourceAction) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MachineLearningComputeClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "underlyingResourceAction": autorest.Encode("query", underlyingResourceAction), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) DeleteSender(req *http.Request) (future MachineLearningComputeDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use +// 'keys' nested resource to get them. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +func (client MachineLearningComputeClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, computeName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MachineLearningComputeClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) GetResponder(resp *http.Response) (result ComputeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets computes in specified workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// skiptoken - continuation token for pagination. +func (client MachineLearningComputeClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (result PaginatedComputeResourcesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.ListByWorkspace") + defer func() { + sc := -1 + if result.pcrl.Response.Response != nil { + sc = result.pcrl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName, skiptoken) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.pcrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.pcrl, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client MachineLearningComputeClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) ListByWorkspaceResponder(resp *http.Response) (result PaginatedComputeResourcesList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client MachineLearningComputeClient) listByWorkspaceNextResults(ctx context.Context, lastResults PaginatedComputeResourcesList) (result PaginatedComputeResourcesList, err error) { + req, err := lastResults.paginatedComputeResourcesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client MachineLearningComputeClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (result PaginatedComputeResourcesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.ListByWorkspace") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByWorkspace(ctx, resourceGroupName, workspaceName, skiptoken) + return +} + +// ListKeys gets secrets related to Machine Learning compute (storage keys, service credentials, etc). +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +func (client MachineLearningComputeClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeSecretsModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListKeysPreparer(ctx, resourceGroupName, workspaceName, computeName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client MachineLearningComputeClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeysSender sends the ListKeys request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) ListKeysSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeysResponder handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) ListKeysResponder(resp *http.Response) (result ComputeSecretsModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNodes get the details (e.g IP address, port etc) of all the compute nodes in the compute. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +func (client MachineLearningComputeClient) ListNodes(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result AmlComputeNodesInformation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.ListNodes") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListNodesPreparer(ctx, resourceGroupName, workspaceName, computeName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListNodes", nil, "Failure preparing request") + return + } + + resp, err := client.ListNodesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListNodes", resp, "Failure sending request") + return + } + + result, err = client.ListNodesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListNodes", resp, "Failure responding to request") + } + + return +} + +// ListNodesPreparer prepares the ListNodes request. +func (client MachineLearningComputeClient) ListNodesPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNodesSender sends the ListNodes request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) ListNodesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListNodesResponder handles the response to the ListNodes request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) ListNodesResponder(resp *http.Response) (result AmlComputeNodesInformation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable +// operation. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +// parameters - additional parameters for cluster update. +func (client MachineLearningComputeClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters) (result MachineLearningComputeUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, computeName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client MachineLearningComputeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) UpdateSender(req *http.Request) (future MachineLearningComputeUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) UpdateResponder(resp *http.Response) (result ComputeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi/interfaces.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi/interfaces.go new file mode 100644 index 000000000000..7b616501cac5 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/machinelearningservicesapi/interfaces.go @@ -0,0 +1,94 @@ +package machinelearningservicesapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + ListSkus(ctx context.Context) (result machinelearningservices.SkuListResultPage, err error) +} + +var _ BaseClientAPI = (*machinelearningservices.BaseClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result machinelearningservices.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*machinelearningservices.OperationsClient)(nil) + +// WorkspacesClientAPI contains the set of methods on the WorkspacesClient type. +type WorkspacesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters machinelearningservices.Workspace) (result machinelearningservices.Workspace, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.Workspace, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result machinelearningservices.WorkspaceListResultPage, err error) + ListBySubscription(ctx context.Context, skiptoken string) (result machinelearningservices.WorkspaceListResultPage, err error) + ListKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.ListWorkspaceKeysResult, err error) + ResyncKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters machinelearningservices.WorkspaceUpdateParameters) (result machinelearningservices.Workspace, err error) +} + +var _ WorkspacesClientAPI = (*machinelearningservices.WorkspacesClient)(nil) + +// WorkspaceFeaturesClientAPI contains the set of methods on the WorkspaceFeaturesClient type. +type WorkspaceFeaturesClientAPI interface { + List(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.ListAmlUserFeatureResultPage, err error) +} + +var _ WorkspaceFeaturesClientAPI = (*machinelearningservices.WorkspaceFeaturesClient)(nil) + +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + List(ctx context.Context, location string) (result machinelearningservices.ListUsagesResultPage, err error) +} + +var _ UsagesClientAPI = (*machinelearningservices.UsagesClient)(nil) + +// VirtualMachineSizesClientAPI contains the set of methods on the VirtualMachineSizesClient type. +type VirtualMachineSizesClientAPI interface { + List(ctx context.Context, location string) (result machinelearningservices.VirtualMachineSizeListResult, err error) +} + +var _ VirtualMachineSizesClientAPI = (*machinelearningservices.VirtualMachineSizesClient)(nil) + +// QuotasClientAPI contains the set of methods on the QuotasClient type. +type QuotasClientAPI interface { + List(ctx context.Context, location string) (result machinelearningservices.ListWorkspaceQuotasPage, err error) + Update(ctx context.Context, location string, parameters machinelearningservices.QuotaUpdateParameters) (result machinelearningservices.UpdateWorkspaceQuotasResult, err error) +} + +var _ QuotasClientAPI = (*machinelearningservices.QuotasClient)(nil) + +// MachineLearningComputeClientAPI contains the set of methods on the MachineLearningComputeClient type. +type MachineLearningComputeClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters machinelearningservices.ComputeResource) (result machinelearningservices.MachineLearningComputeCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction machinelearningservices.UnderlyingResourceAction) (result machinelearningservices.MachineLearningComputeDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result machinelearningservices.ComputeResource, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (result machinelearningservices.PaginatedComputeResourcesListPage, err error) + ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result machinelearningservices.ComputeSecretsModel, err error) + ListNodes(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result machinelearningservices.AmlComputeNodesInformation, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters machinelearningservices.ClusterUpdateParameters) (result machinelearningservices.MachineLearningComputeUpdateFuture, err error) +} + +var _ MachineLearningComputeClientAPI = (*machinelearningservices.MachineLearningComputeClient)(nil) diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/models.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/models.go new file mode 100644 index 000000000000..3b75b2b1d4b6 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/models.go @@ -0,0 +1,3341 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices" + +// AllocationState enumerates the values for allocation state. +type AllocationState string + +const ( + // Resizing ... + Resizing AllocationState = "Resizing" + // Steady ... + Steady AllocationState = "Steady" +) + +// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. +func PossibleAllocationStateValues() []AllocationState { + return []AllocationState{Resizing, Steady} +} + +// ComputeType enumerates the values for compute type. +type ComputeType string + +const ( + // ComputeTypeAKS ... + ComputeTypeAKS ComputeType = "AKS" + // ComputeTypeAmlCompute ... + ComputeTypeAmlCompute ComputeType = "AmlCompute" + // ComputeTypeDatabricks ... + ComputeTypeDatabricks ComputeType = "Databricks" + // ComputeTypeDataFactory ... + ComputeTypeDataFactory ComputeType = "DataFactory" + // ComputeTypeDataLakeAnalytics ... + ComputeTypeDataLakeAnalytics ComputeType = "DataLakeAnalytics" + // ComputeTypeHDInsight ... + ComputeTypeHDInsight ComputeType = "HDInsight" + // ComputeTypeVirtualMachine ... + ComputeTypeVirtualMachine ComputeType = "VirtualMachine" +) + +// PossibleComputeTypeValues returns an array of possible values for the ComputeType const type. +func PossibleComputeTypeValues() []ComputeType { + return []ComputeType{ComputeTypeAKS, ComputeTypeAmlCompute, ComputeTypeDatabricks, ComputeTypeDataFactory, ComputeTypeDataLakeAnalytics, ComputeTypeHDInsight, ComputeTypeVirtualMachine} +} + +// ComputeTypeBasicCompute enumerates the values for compute type basic compute. +type ComputeTypeBasicCompute string + +const ( + // ComputeTypeAKS1 ... + ComputeTypeAKS1 ComputeTypeBasicCompute = "AKS" + // ComputeTypeAmlCompute1 ... + ComputeTypeAmlCompute1 ComputeTypeBasicCompute = "AmlCompute" + // ComputeTypeCompute ... + ComputeTypeCompute ComputeTypeBasicCompute = "Compute" + // ComputeTypeDatabricks1 ... + ComputeTypeDatabricks1 ComputeTypeBasicCompute = "Databricks" + // ComputeTypeDataFactory1 ... + ComputeTypeDataFactory1 ComputeTypeBasicCompute = "DataFactory" + // ComputeTypeDataLakeAnalytics1 ... + ComputeTypeDataLakeAnalytics1 ComputeTypeBasicCompute = "DataLakeAnalytics" + // ComputeTypeHDInsight1 ... + ComputeTypeHDInsight1 ComputeTypeBasicCompute = "HDInsight" + // ComputeTypeVirtualMachine1 ... + ComputeTypeVirtualMachine1 ComputeTypeBasicCompute = "VirtualMachine" +) + +// PossibleComputeTypeBasicComputeValues returns an array of possible values for the ComputeTypeBasicCompute const type. +func PossibleComputeTypeBasicComputeValues() []ComputeTypeBasicCompute { + return []ComputeTypeBasicCompute{ComputeTypeAKS1, ComputeTypeAmlCompute1, ComputeTypeCompute, ComputeTypeDatabricks1, ComputeTypeDataFactory1, ComputeTypeDataLakeAnalytics1, ComputeTypeHDInsight1, ComputeTypeVirtualMachine1} +} + +// ComputeTypeBasicComputeNodesInformation enumerates the values for compute type basic compute nodes +// information. +type ComputeTypeBasicComputeNodesInformation string + +const ( + // ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute ... + ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute ComputeTypeBasicComputeNodesInformation = "AmlCompute" + // ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation ... + ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation ComputeTypeBasicComputeNodesInformation = "ComputeNodesInformation" +) + +// PossibleComputeTypeBasicComputeNodesInformationValues returns an array of possible values for the ComputeTypeBasicComputeNodesInformation const type. +func PossibleComputeTypeBasicComputeNodesInformationValues() []ComputeTypeBasicComputeNodesInformation { + return []ComputeTypeBasicComputeNodesInformation{ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute, ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation} +} + +// ComputeTypeBasicComputeSecrets enumerates the values for compute type basic compute secrets. +type ComputeTypeBasicComputeSecrets string + +const ( + // ComputeTypeBasicComputeSecretsComputeTypeAKS ... + ComputeTypeBasicComputeSecretsComputeTypeAKS ComputeTypeBasicComputeSecrets = "AKS" + // ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ... + ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ComputeTypeBasicComputeSecrets = "ComputeSecrets" + // ComputeTypeBasicComputeSecretsComputeTypeDatabricks ... + ComputeTypeBasicComputeSecretsComputeTypeDatabricks ComputeTypeBasicComputeSecrets = "Databricks" + // ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ... + ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ComputeTypeBasicComputeSecrets = "VirtualMachine" +) + +// PossibleComputeTypeBasicComputeSecretsValues returns an array of possible values for the ComputeTypeBasicComputeSecrets const type. +func PossibleComputeTypeBasicComputeSecretsValues() []ComputeTypeBasicComputeSecrets { + return []ComputeTypeBasicComputeSecrets{ComputeTypeBasicComputeSecretsComputeTypeAKS, ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets, ComputeTypeBasicComputeSecretsComputeTypeDatabricks, ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine} +} + +// NodeState enumerates the values for node state. +type NodeState string + +const ( + // Idle ... + Idle NodeState = "idle" + // Leaving ... + Leaving NodeState = "leaving" + // Preempted ... + Preempted NodeState = "preempted" + // Preparing ... + Preparing NodeState = "preparing" + // Running ... + Running NodeState = "running" + // Unusable ... + Unusable NodeState = "unusable" +) + +// PossibleNodeStateValues returns an array of possible values for the NodeState const type. +func PossibleNodeStateValues() []NodeState { + return []NodeState{Idle, Leaving, Preempted, Preparing, Running, Unusable} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Canceled ... + Canceled ProvisioningState = "Canceled" + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Unknown ... + Unknown ProvisioningState = "Unknown" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Unknown, Updating} +} + +// QuotaUnit enumerates the values for quota unit. +type QuotaUnit string + +const ( + // Count ... + Count QuotaUnit = "Count" +) + +// PossibleQuotaUnitValues returns an array of possible values for the QuotaUnit const type. +func PossibleQuotaUnitValues() []QuotaUnit { + return []QuotaUnit{Count} +} + +// ReasonCode enumerates the values for reason code. +type ReasonCode string + +const ( + // NotAvailableForRegion ... + NotAvailableForRegion ReasonCode = "NotAvailableForRegion" + // NotAvailableForSubscription ... + NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" + // NotSpecified ... + NotSpecified ReasonCode = "NotSpecified" +) + +// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type. +func PossibleReasonCodeValues() []ReasonCode { + return []ReasonCode{NotAvailableForRegion, NotAvailableForSubscription, NotSpecified} +} + +// RemoteLoginPortPublicAccess enumerates the values for remote login port public access. +type RemoteLoginPortPublicAccess string + +const ( + // RemoteLoginPortPublicAccessDisabled ... + RemoteLoginPortPublicAccessDisabled RemoteLoginPortPublicAccess = "Disabled" + // RemoteLoginPortPublicAccessEnabled ... + RemoteLoginPortPublicAccessEnabled RemoteLoginPortPublicAccess = "Enabled" + // RemoteLoginPortPublicAccessNotSpecified ... + RemoteLoginPortPublicAccessNotSpecified RemoteLoginPortPublicAccess = "NotSpecified" +) + +// PossibleRemoteLoginPortPublicAccessValues returns an array of possible values for the RemoteLoginPortPublicAccess const type. +func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { + return []RemoteLoginPortPublicAccess{RemoteLoginPortPublicAccessDisabled, RemoteLoginPortPublicAccessEnabled, RemoteLoginPortPublicAccessNotSpecified} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{SystemAssigned} +} + +// Status enumerates the values for status. +type Status string + +const ( + // Failure ... + Failure Status = "Failure" + // InvalidQuotaBelowClusterMinimum ... + InvalidQuotaBelowClusterMinimum Status = "InvalidQuotaBelowClusterMinimum" + // InvalidQuotaExceedsSubscriptionLimit ... + InvalidQuotaExceedsSubscriptionLimit Status = "InvalidQuotaExceedsSubscriptionLimit" + // InvalidVMFamilyName ... + InvalidVMFamilyName Status = "InvalidVMFamilyName" + // OperationNotEnabledForRegion ... + OperationNotEnabledForRegion Status = "OperationNotEnabledForRegion" + // OperationNotSupportedForSku ... + OperationNotSupportedForSku Status = "OperationNotSupportedForSku" + // Success ... + Success Status = "Success" + // Undefined ... + Undefined Status = "Undefined" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{Failure, InvalidQuotaBelowClusterMinimum, InvalidQuotaExceedsSubscriptionLimit, InvalidVMFamilyName, OperationNotEnabledForRegion, OperationNotSupportedForSku, Success, Undefined} +} + +// Status1 enumerates the values for status 1. +type Status1 string + +const ( + // Disabled ... + Disabled Status1 = "Disabled" + // Enabled ... + Enabled Status1 = "Enabled" +) + +// PossibleStatus1Values returns an array of possible values for the Status1 const type. +func PossibleStatus1Values() []Status1 { + return []Status1{Disabled, Enabled} +} + +// UnderlyingResourceAction enumerates the values for underlying resource action. +type UnderlyingResourceAction string + +const ( + // Delete ... + Delete UnderlyingResourceAction = "Delete" + // Detach ... + Detach UnderlyingResourceAction = "Detach" +) + +// PossibleUnderlyingResourceActionValues returns an array of possible values for the UnderlyingResourceAction const type. +func PossibleUnderlyingResourceActionValues() []UnderlyingResourceAction { + return []UnderlyingResourceAction{Delete, Detach} +} + +// UsageUnit enumerates the values for usage unit. +type UsageUnit string + +const ( + // UsageUnitCount ... + UsageUnitCount UsageUnit = "Count" +) + +// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. +func PossibleUsageUnitValues() []UsageUnit { + return []UsageUnit{UsageUnitCount} +} + +// VMPriority enumerates the values for vm priority. +type VMPriority string + +const ( + // Dedicated ... + Dedicated VMPriority = "Dedicated" + // LowPriority ... + LowPriority VMPriority = "LowPriority" +) + +// PossibleVMPriorityValues returns an array of possible values for the VMPriority const type. +func PossibleVMPriorityValues() []VMPriority { + return []VMPriority{Dedicated, LowPriority} +} + +// AKS a Machine Learning compute based on AKS. +type AKS struct { + // Properties - AKS properties + Properties *AKSProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AKS. +func (a AKS) MarshalJSON() ([]byte, error) { + a.ComputeType = ComputeTypeAKS1 + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.ComputeLocation != nil { + objectMap["computeLocation"] = a.ComputeLocation + } + if a.Description != nil { + objectMap["description"] = a.Description + } + if a.ResourceID != nil { + objectMap["resourceId"] = a.ResourceID + } + if a.ComputeType != "" { + objectMap["computeType"] = a.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for AKS. +func (a AKS) AsAKS() (*AKS, bool) { + return &a, true +} + +// AsAmlCompute is the BasicCompute implementation for AKS. +func (a AKS) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for AKS. +func (a AKS) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for AKS. +func (a AKS) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for AKS. +func (a AKS) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for AKS. +func (a AKS) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for AKS. +func (a AKS) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for AKS. +func (a AKS) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for AKS. +func (a AKS) AsBasicCompute() (BasicCompute, bool) { + return &a, true +} + +// AksComputeSecrets secrets related to a Machine Learning compute based on AKS. +type AksComputeSecrets struct { + // UserKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + UserKubeConfig *string `json:"userKubeConfig,omitempty"` + // AdminKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` + // ImagePullSecretName - Image registry pull secret. + ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' + ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AksComputeSecrets. +func (acs AksComputeSecrets) MarshalJSON() ([]byte, error) { + acs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeAKS + objectMap := make(map[string]interface{}) + if acs.UserKubeConfig != nil { + objectMap["userKubeConfig"] = acs.UserKubeConfig + } + if acs.AdminKubeConfig != nil { + objectMap["adminKubeConfig"] = acs.AdminKubeConfig + } + if acs.ImagePullSecretName != nil { + objectMap["imagePullSecretName"] = acs.ImagePullSecretName + } + if acs.ComputeType != "" { + objectMap["computeType"] = acs.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { + return &acs, true +} + +// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { + return nil, false +} + +// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { + return nil, false +} + +// AsComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { + return nil, false +} + +// AsBasicComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { + return &acs, true +} + +// AksNetworkingConfiguration advance configuration for AKS networking +type AksNetworkingConfiguration struct { + // SubnetID - Virtual network subnet resource ID the compute nodes belong to + SubnetID *string `json:"subnetId,omitempty"` + // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` +} + +// AKSProperties AKS properties +type AKSProperties struct { + // ClusterFqdn - Cluster full qualified domain name + ClusterFqdn *string `json:"clusterFqdn,omitempty"` + // SystemServices - READ-ONLY; System services + SystemServices *[]SystemService `json:"systemServices,omitempty"` + // AgentCount - Number of agents + AgentCount *int32 `json:"agentCount,omitempty"` + // AgentVMSize - Agent virtual machine size + AgentVMSize *string `json:"agentVMSize,omitempty"` + // SslConfiguration - SSL configuration + SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"` + // AksNetworkingConfiguration - AKS networking configuration for vnet + AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"` +} + +// AmlCompute an Azure Machine Learning compute. +type AmlCompute struct { + // Properties - AML Compute properties + Properties *AmlComputeProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmlCompute. +func (ac AmlCompute) MarshalJSON() ([]byte, error) { + ac.ComputeType = ComputeTypeAmlCompute1 + objectMap := make(map[string]interface{}) + if ac.Properties != nil { + objectMap["properties"] = ac.Properties + } + if ac.ComputeLocation != nil { + objectMap["computeLocation"] = ac.ComputeLocation + } + if ac.Description != nil { + objectMap["description"] = ac.Description + } + if ac.ResourceID != nil { + objectMap["resourceId"] = ac.ResourceID + } + if ac.ComputeType != "" { + objectMap["computeType"] = ac.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsAmlCompute() (*AmlCompute, bool) { + return &ac, true +} + +// AsVirtualMachine is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsBasicCompute() (BasicCompute, bool) { + return &ac, true +} + +// AmlComputeNodeInformation compute node information related to a AmlCompute. +type AmlComputeNodeInformation struct { + // NodeID - READ-ONLY; ID of the compute node. + NodeID *string `json:"nodeId,omitempty"` + // PrivateIPAddress - READ-ONLY; Private IP address of the compute node. + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + // PublicIPAddress - READ-ONLY; Public IP address of the compute node. + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + // Port - READ-ONLY; SSH port number of the node. + Port *float64 `json:"port,omitempty"` + // NodeState - READ-ONLY; State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. Possible values include: 'Idle', 'Running', 'Preparing', 'Unusable', 'Leaving', 'Preempted' + NodeState NodeState `json:"nodeState,omitempty"` + // RunID - READ-ONLY; ID of the Experiment running on the node, if any else null. + RunID *string `json:"runId,omitempty"` +} + +// AmlComputeNodesInformation compute node information related to a AmlCompute. +type AmlComputeNodesInformation struct { + autorest.Response `json:"-"` + // Nodes - READ-ONLY; The collection of returned AmlCompute nodes details. + Nodes *[]AmlComputeNodeInformation `json:"nodes,omitempty"` + // NextLink - READ-ONLY; The continuation token. + NextLink *string `json:"nextLink,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute' + ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmlComputeNodesInformation. +func (acni AmlComputeNodesInformation) MarshalJSON() ([]byte, error) { + acni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute + objectMap := make(map[string]interface{}) + if acni.ComputeType != "" { + objectMap["computeType"] = acni.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. +func (acni AmlComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) { + return &acni, true +} + +// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. +func (acni AmlComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) { + return nil, false +} + +// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. +func (acni AmlComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) { + return &acni, true +} + +// AmlComputeProperties AML Compute properties +type AmlComputeProperties struct { + // VMSize - Virtual Machine Size + VMSize *string `json:"vmSize,omitempty"` + // VMPriority - Virtual Machine priority. Possible values include: 'Dedicated', 'LowPriority' + VMPriority VMPriority `json:"vmPriority,omitempty"` + // ScaleSettings - Scale settings for AML Compute + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + // UserAccountCredentials - Credentials for an administrator user account that will be created on each compute node. + UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"` + // Subnet - Virtual network subnet resource ID the compute nodes belong to. + Subnet *ResourceID `json:"subnet,omitempty"` + // RemoteLoginPortPublicAccess - State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled. Possible values include: 'RemoteLoginPortPublicAccessEnabled', 'RemoteLoginPortPublicAccessDisabled', 'RemoteLoginPortPublicAccessNotSpecified' + RemoteLoginPortPublicAccess RemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"` + // AllocationState - READ-ONLY; Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. Possible values include: 'Steady', 'Resizing' + AllocationState AllocationState `json:"allocationState,omitempty"` + // AllocationStateTransitionTime - READ-ONLY; The time at which the compute entered its current allocation state. + AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` + // Errors - READ-ONLY; Collection of errors encountered by various compute nodes during node setup. + Errors *[]Error `json:"errors,omitempty"` + // CurrentNodeCount - READ-ONLY; The number of compute nodes currently assigned to the compute. + CurrentNodeCount *int32 `json:"currentNodeCount,omitempty"` + // TargetNodeCount - READ-ONLY; The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation. + TargetNodeCount *int32 `json:"targetNodeCount,omitempty"` + // NodeStateCounts - READ-ONLY; Counts of various node states on the compute. + NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"` +} + +// AmlUserFeature features enabled for a workspace +type AmlUserFeature struct { + // ID - Specifies the feature ID + ID *string `json:"id,omitempty"` + // DisplayName - Specifies the feature name + DisplayName *string `json:"displayName,omitempty"` + // Description - Describes the feature for user experience + Description *string `json:"description,omitempty"` +} + +// ClusterUpdateParameters amlCompute update parameters. +type ClusterUpdateParameters struct { + // ClusterUpdateProperties - The properties of the amlCompute. + *ClusterUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterUpdateParameters. +func (cup ClusterUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.ClusterUpdateProperties != nil { + objectMap["properties"] = cup.ClusterUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterUpdateParameters struct. +func (cup *ClusterUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var clusterUpdateProperties ClusterUpdateProperties + err = json.Unmarshal(*v, &clusterUpdateProperties) + if err != nil { + return err + } + cup.ClusterUpdateProperties = &clusterUpdateProperties + } + } + } + + return nil +} + +// ClusterUpdateProperties the properties of a amlCompute that need to be updated. +type ClusterUpdateProperties struct { + // ScaleSettings - Desired scale settings for the amlCompute. + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` +} + +// BasicCompute machine Learning compute object. +type BasicCompute interface { + AsAKS() (*AKS, bool) + AsAmlCompute() (*AmlCompute, bool) + AsVirtualMachine() (*VirtualMachine, bool) + AsHDInsight() (*HDInsight, bool) + AsDataFactory() (*DataFactory, bool) + AsDatabricks() (*Databricks, bool) + AsDataLakeAnalytics() (*DataLakeAnalytics, bool) + AsCompute() (*Compute, bool) +} + +// Compute machine Learning compute object. +type Compute struct { + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +func unmarshalBasicCompute(body []byte) (BasicCompute, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["computeType"] { + case string(ComputeTypeAKS1): + var a AKS + err := json.Unmarshal(body, &a) + return a, err + case string(ComputeTypeAmlCompute1): + var ac AmlCompute + err := json.Unmarshal(body, &ac) + return ac, err + case string(ComputeTypeVirtualMachine1): + var VM VirtualMachine + err := json.Unmarshal(body, &VM) + return VM, err + case string(ComputeTypeHDInsight1): + var hi HDInsight + err := json.Unmarshal(body, &hi) + return hi, err + case string(ComputeTypeDataFactory1): + var df DataFactory + err := json.Unmarshal(body, &df) + return df, err + case string(ComputeTypeDatabricks1): + var d Databricks + err := json.Unmarshal(body, &d) + return d, err + case string(ComputeTypeDataLakeAnalytics1): + var dla DataLakeAnalytics + err := json.Unmarshal(body, &dla) + return dla, err + default: + var c Compute + err := json.Unmarshal(body, &c) + return c, err + } +} +func unmarshalBasicComputeArray(body []byte) ([]BasicCompute, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cArray := make([]BasicCompute, len(rawMessages)) + + for index, rawMessage := range rawMessages { + c, err := unmarshalBasicCompute(*rawMessage) + if err != nil { + return nil, err + } + cArray[index] = c + } + return cArray, nil +} + +// MarshalJSON is the custom marshaler for Compute. +func (c Compute) MarshalJSON() ([]byte, error) { + c.ComputeType = ComputeTypeCompute + objectMap := make(map[string]interface{}) + if c.ComputeLocation != nil { + objectMap["computeLocation"] = c.ComputeLocation + } + if c.Description != nil { + objectMap["description"] = c.Description + } + if c.ResourceID != nil { + objectMap["resourceId"] = c.ResourceID + } + if c.ComputeType != "" { + objectMap["computeType"] = c.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for Compute. +func (c Compute) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for Compute. +func (c Compute) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for Compute. +func (c Compute) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for Compute. +func (c Compute) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for Compute. +func (c Compute) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for Compute. +func (c Compute) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for Compute. +func (c Compute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for Compute. +func (c Compute) AsCompute() (*Compute, bool) { + return &c, true +} + +// AsBasicCompute is the BasicCompute implementation for Compute. +func (c Compute) AsBasicCompute() (BasicCompute, bool) { + return &c, true +} + +// BasicComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for every +// type of compute. +type BasicComputeNodesInformation interface { + AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) + AsComputeNodesInformation() (*ComputeNodesInformation, bool) +} + +// ComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for +// every type of compute. +type ComputeNodesInformation struct { + // NextLink - READ-ONLY; The continuation token. + NextLink *string `json:"nextLink,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute' + ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"` +} + +func unmarshalBasicComputeNodesInformation(body []byte) (BasicComputeNodesInformation, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["computeType"] { + case string(ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute): + var acni AmlComputeNodesInformation + err := json.Unmarshal(body, &acni) + return acni, err + default: + var cni ComputeNodesInformation + err := json.Unmarshal(body, &cni) + return cni, err + } +} +func unmarshalBasicComputeNodesInformationArray(body []byte) ([]BasicComputeNodesInformation, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cniArray := make([]BasicComputeNodesInformation, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cni, err := unmarshalBasicComputeNodesInformation(*rawMessage) + if err != nil { + return nil, err + } + cniArray[index] = cni + } + return cniArray, nil +} + +// MarshalJSON is the custom marshaler for ComputeNodesInformation. +func (cni ComputeNodesInformation) MarshalJSON() ([]byte, error) { + cni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation + objectMap := make(map[string]interface{}) + if cni.ComputeType != "" { + objectMap["computeType"] = cni.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. +func (cni ComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) { + return nil, false +} + +// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. +func (cni ComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) { + return &cni, true +} + +// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. +func (cni ComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) { + return &cni, true +} + +// ComputeResource machine Learning compute object wrapped into ARM resource envelope. +type ComputeResource struct { + autorest.Response `json:"-"` + // Properties - Compute properties + Properties BasicCompute `json:"properties,omitempty"` + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Specifies the name of the resource. + Name *string `json:"name,omitempty"` + // Identity - READ-ONLY; The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Specifies the type of the resource. + Type *string `json:"type,omitempty"` + // Tags - Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags"` + // Sku - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for ComputeResource. +func (cr ComputeResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = cr.Properties + if cr.Location != nil { + objectMap["location"] = cr.Location + } + if cr.Tags != nil { + objectMap["tags"] = cr.Tags + } + if cr.Sku != nil { + objectMap["sku"] = cr.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ComputeResource struct. +func (cr *ComputeResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + properties, err := unmarshalBasicCompute(*v) + if err != nil { + return err + } + cr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cr.Name = &name + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + cr.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cr.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cr.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + cr.Sku = &sku + } + } + } + + return nil +} + +// BasicComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. +type BasicComputeSecrets interface { + AsAksComputeSecrets() (*AksComputeSecrets, bool) + AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) + AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) + AsComputeSecrets() (*ComputeSecrets, bool) +} + +// ComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. +type ComputeSecrets struct { + autorest.Response `json:"-"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' + ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` +} + +func unmarshalBasicComputeSecrets(body []byte) (BasicComputeSecrets, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["computeType"] { + case string(ComputeTypeBasicComputeSecretsComputeTypeAKS): + var acs AksComputeSecrets + err := json.Unmarshal(body, &acs) + return acs, err + case string(ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine): + var vms VirtualMachineSecrets + err := json.Unmarshal(body, &vms) + return vms, err + case string(ComputeTypeBasicComputeSecretsComputeTypeDatabricks): + var dcs DatabricksComputeSecrets + err := json.Unmarshal(body, &dcs) + return dcs, err + default: + var cs ComputeSecrets + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicComputeSecretsArray(body []byte) ([]BasicComputeSecrets, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicComputeSecrets, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicComputeSecrets(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ComputeSecrets. +func (cs ComputeSecrets) MarshalJSON() ([]byte, error) { + cs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets + objectMap := make(map[string]interface{}) + if cs.ComputeType != "" { + objectMap["computeType"] = cs.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { + return nil, false +} + +// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { + return nil, false +} + +// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { + return nil, false +} + +// AsComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { + return &cs, true +} + +// AsBasicComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { + return &cs, true +} + +// ComputeSecretsModel ... +type ComputeSecretsModel struct { + autorest.Response `json:"-"` + Value BasicComputeSecrets `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ComputeSecretsModel struct. +func (csm *ComputeSecretsModel) UnmarshalJSON(body []byte) error { + cs, err := unmarshalBasicComputeSecrets(body) + if err != nil { + return err + } + csm.Value = cs + + return nil +} + +// Databricks a DataFactory compute. +type Databricks struct { + Properties *DatabricksProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Databricks. +func (d Databricks) MarshalJSON() ([]byte, error) { + d.ComputeType = ComputeTypeDatabricks1 + objectMap := make(map[string]interface{}) + if d.Properties != nil { + objectMap["properties"] = d.Properties + } + if d.ComputeLocation != nil { + objectMap["computeLocation"] = d.ComputeLocation + } + if d.Description != nil { + objectMap["description"] = d.Description + } + if d.ResourceID != nil { + objectMap["resourceId"] = d.ResourceID + } + if d.ComputeType != "" { + objectMap["computeType"] = d.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for Databricks. +func (d Databricks) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for Databricks. +func (d Databricks) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for Databricks. +func (d Databricks) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for Databricks. +func (d Databricks) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for Databricks. +func (d Databricks) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for Databricks. +func (d Databricks) AsDatabricks() (*Databricks, bool) { + return &d, true +} + +// AsDataLakeAnalytics is the BasicCompute implementation for Databricks. +func (d Databricks) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for Databricks. +func (d Databricks) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for Databricks. +func (d Databricks) AsBasicCompute() (BasicCompute, bool) { + return &d, true +} + +// DatabricksComputeSecrets secrets related to a Machine Learning compute based on Databricks. +type DatabricksComputeSecrets struct { + // DatabricksAccessToken - access token for databricks account. + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' + ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) MarshalJSON() ([]byte, error) { + dcs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeDatabricks + objectMap := make(map[string]interface{}) + if dcs.DatabricksAccessToken != nil { + objectMap["databricksAccessToken"] = dcs.DatabricksAccessToken + } + if dcs.ComputeType != "" { + objectMap["computeType"] = dcs.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { + return nil, false +} + +// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { + return nil, false +} + +// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { + return &dcs, true +} + +// AsComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { + return nil, false +} + +// AsBasicComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { + return &dcs, true +} + +// DatabricksProperties ... +type DatabricksProperties struct { + // DatabricksAccessToken - Databricks access token + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` +} + +// DataFactory a DataFactory compute. +type DataFactory struct { + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataFactory. +func (df DataFactory) MarshalJSON() ([]byte, error) { + df.ComputeType = ComputeTypeDataFactory1 + objectMap := make(map[string]interface{}) + if df.ComputeLocation != nil { + objectMap["computeLocation"] = df.ComputeLocation + } + if df.Description != nil { + objectMap["description"] = df.Description + } + if df.ResourceID != nil { + objectMap["resourceId"] = df.ResourceID + } + if df.ComputeType != "" { + objectMap["computeType"] = df.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsDataFactory() (*DataFactory, bool) { + return &df, true +} + +// AsDatabricks is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsBasicCompute() (BasicCompute, bool) { + return &df, true +} + +// DataLakeAnalytics a DataLakeAnalytics compute. +type DataLakeAnalytics struct { + Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataLakeAnalytics. +func (dla DataLakeAnalytics) MarshalJSON() ([]byte, error) { + dla.ComputeType = ComputeTypeDataLakeAnalytics1 + objectMap := make(map[string]interface{}) + if dla.Properties != nil { + objectMap["properties"] = dla.Properties + } + if dla.ComputeLocation != nil { + objectMap["computeLocation"] = dla.ComputeLocation + } + if dla.Description != nil { + objectMap["description"] = dla.Description + } + if dla.ResourceID != nil { + objectMap["resourceId"] = dla.ResourceID + } + if dla.ComputeType != "" { + objectMap["computeType"] = dla.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return &dla, true +} + +// AsCompute is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsBasicCompute() (BasicCompute, bool) { + return &dla, true +} + +// DataLakeAnalyticsProperties ... +type DataLakeAnalyticsProperties struct { + // DataLakeStoreAccountName - DataLake Store Account Name + DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` +} + +// Error wrapper for error response to follow ARM guidelines. +type Error struct { + // Error - READ-ONLY; The error response. + Error *ErrorResponse `json:"error,omitempty"` +} + +// ErrorDetail error detail information. +type ErrorDetail struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` +} + +// ErrorResponse error response information. +type ErrorResponse struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message. + Message *string `json:"message,omitempty"` + // Details - READ-ONLY; An array of error detail objects. + Details *[]ErrorDetail `json:"details,omitempty"` +} + +// HDInsight a HDInsight compute. +type HDInsight struct { + Properties *HDInsightProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsight. +func (hi HDInsight) MarshalJSON() ([]byte, error) { + hi.ComputeType = ComputeTypeHDInsight1 + objectMap := make(map[string]interface{}) + if hi.Properties != nil { + objectMap["properties"] = hi.Properties + } + if hi.ComputeLocation != nil { + objectMap["computeLocation"] = hi.ComputeLocation + } + if hi.Description != nil { + objectMap["description"] = hi.Description + } + if hi.ResourceID != nil { + objectMap["resourceId"] = hi.ResourceID + } + if hi.ComputeType != "" { + objectMap["computeType"] = hi.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsHDInsight() (*HDInsight, bool) { + return &hi, true +} + +// AsDataFactory is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsBasicCompute() (BasicCompute, bool) { + return &hi, true +} + +// HDInsightProperties ... +type HDInsightProperties struct { + // SSHPort - Port open for ssh connections on the master node of the cluster. + SSHPort *int32 `json:"sshPort,omitempty"` + // Address - Public IP address of the master node of the cluster. + Address *string `json:"address,omitempty"` + // AdministratorAccount - Admin credentials for master node of the cluster + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` +} + +// Identity identity for the resource. +type Identity struct { + // PrincipalID - READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'SystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// ListAmlUserFeatureResult the List Aml user feature operation response. +type ListAmlUserFeatureResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of AML user facing features. + Value *[]AmlUserFeature `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListAmlUserFeatureResultIterator provides access to a complete listing of AmlUserFeature values. +type ListAmlUserFeatureResultIterator struct { + i int + page ListAmlUserFeatureResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListAmlUserFeatureResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListAmlUserFeatureResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListAmlUserFeatureResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListAmlUserFeatureResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListAmlUserFeatureResultIterator) Response() ListAmlUserFeatureResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListAmlUserFeatureResultIterator) Value() AmlUserFeature { + if !iter.page.NotDone() { + return AmlUserFeature{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListAmlUserFeatureResultIterator type. +func NewListAmlUserFeatureResultIterator(page ListAmlUserFeatureResultPage) ListAmlUserFeatureResultIterator { + return ListAmlUserFeatureResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (laufr ListAmlUserFeatureResult) IsEmpty() bool { + return laufr.Value == nil || len(*laufr.Value) == 0 +} + +// listAmlUserFeatureResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (laufr ListAmlUserFeatureResult) listAmlUserFeatureResultPreparer(ctx context.Context) (*http.Request, error) { + if laufr.NextLink == nil || len(to.String(laufr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(laufr.NextLink))) +} + +// ListAmlUserFeatureResultPage contains a page of AmlUserFeature values. +type ListAmlUserFeatureResultPage struct { + fn func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error) + laufr ListAmlUserFeatureResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListAmlUserFeatureResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListAmlUserFeatureResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.laufr) + if err != nil { + return err + } + page.laufr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListAmlUserFeatureResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListAmlUserFeatureResultPage) NotDone() bool { + return !page.laufr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListAmlUserFeatureResultPage) Response() ListAmlUserFeatureResult { + return page.laufr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListAmlUserFeatureResultPage) Values() []AmlUserFeature { + if page.laufr.IsEmpty() { + return nil + } + return *page.laufr.Value +} + +// Creates a new instance of the ListAmlUserFeatureResultPage type. +func NewListAmlUserFeatureResultPage(getNextPage func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error)) ListAmlUserFeatureResultPage { + return ListAmlUserFeatureResultPage{fn: getNextPage} +} + +// ListUsagesResult the List Usages operation response. +type ListUsagesResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of AML resource usages. + Value *[]Usage `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListUsagesResultIterator provides access to a complete listing of Usage values. +type ListUsagesResultIterator struct { + i int + page ListUsagesResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListUsagesResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListUsagesResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListUsagesResultIterator) Response() ListUsagesResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListUsagesResultIterator) Value() Usage { + if !iter.page.NotDone() { + return Usage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListUsagesResultIterator type. +func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { + return ListUsagesResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lur ListUsagesResult) IsEmpty() bool { + return lur.Value == nil || len(*lur.Value) == 0 +} + +// listUsagesResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { + if lur.NextLink == nil || len(to.String(lur.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lur.NextLink))) +} + +// ListUsagesResultPage contains a page of Usage values. +type ListUsagesResultPage struct { + fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) + lur ListUsagesResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lur) + if err != nil { + return err + } + page.lur = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListUsagesResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListUsagesResultPage) NotDone() bool { + return !page.lur.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListUsagesResultPage) Response() ListUsagesResult { + return page.lur +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListUsagesResultPage) Values() []Usage { + if page.lur.IsEmpty() { + return nil + } + return *page.lur.Value +} + +// Creates a new instance of the ListUsagesResultPage type. +func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { + return ListUsagesResultPage{fn: getNextPage} +} + +// ListWorkspaceKeysResult ... +type ListWorkspaceKeysResult struct { + autorest.Response `json:"-"` + // UserStorageKey - READ-ONLY + UserStorageKey *string `json:"userStorageKey,omitempty"` + // UserStorageResourceID - READ-ONLY + UserStorageResourceID *string `json:"userStorageResourceId,omitempty"` + // AppInsightsInstrumentationKey - READ-ONLY + AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` + // ContainerRegistryCredentials - READ-ONLY + ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"` +} + +// ListWorkspaceQuotas the List WorkspaceQuotasByVMFamily operation response. +type ListWorkspaceQuotas struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of Workspace Quotas by VM Family + Value *[]ResourceQuota `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListWorkspaceQuotasIterator provides access to a complete listing of ResourceQuota values. +type ListWorkspaceQuotasIterator struct { + i int + page ListWorkspaceQuotasPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListWorkspaceQuotasIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListWorkspaceQuotasIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListWorkspaceQuotasIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListWorkspaceQuotasIterator) Response() ListWorkspaceQuotas { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListWorkspaceQuotasIterator) Value() ResourceQuota { + if !iter.page.NotDone() { + return ResourceQuota{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListWorkspaceQuotasIterator type. +func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator { + return ListWorkspaceQuotasIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lwq ListWorkspaceQuotas) IsEmpty() bool { + return lwq.Value == nil || len(*lwq.Value) == 0 +} + +// listWorkspaceQuotasPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lwq ListWorkspaceQuotas) listWorkspaceQuotasPreparer(ctx context.Context) (*http.Request, error) { + if lwq.NextLink == nil || len(to.String(lwq.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lwq.NextLink))) +} + +// ListWorkspaceQuotasPage contains a page of ResourceQuota values. +type ListWorkspaceQuotasPage struct { + fn func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error) + lwq ListWorkspaceQuotas +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListWorkspaceQuotasPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lwq) + if err != nil { + return err + } + page.lwq = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListWorkspaceQuotasPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListWorkspaceQuotasPage) NotDone() bool { + return !page.lwq.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListWorkspaceQuotasPage) Response() ListWorkspaceQuotas { + return page.lwq +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListWorkspaceQuotasPage) Values() []ResourceQuota { + if page.lwq.IsEmpty() { + return nil + } + return *page.lwq.Value +} + +// Creates a new instance of the ListWorkspaceQuotasPage type. +func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage { + return ListWorkspaceQuotasPage{fn: getNextPage} +} + +// MachineLearningComputeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type MachineLearningComputeCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MachineLearningComputeCreateOrUpdateFuture) Result(client MachineLearningComputeClient) (cr ComputeResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { + cr, err = client.CreateOrUpdateResponder(cr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") + } + } + return +} + +// MachineLearningComputeDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type MachineLearningComputeDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MachineLearningComputeDeleteFuture) Result(client MachineLearningComputeClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// MachineLearningComputeUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type MachineLearningComputeUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MachineLearningComputeUpdateFuture) Result(client MachineLearningComputeClient) (cr ComputeResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { + cr, err = client.UpdateResponder(cr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") + } + } + return +} + +// NodeStateCounts counts of various compute node states on the amlCompute. +type NodeStateCounts struct { + // IdleNodeCount - READ-ONLY; Number of compute nodes in idle state. + IdleNodeCount *int32 `json:"idleNodeCount,omitempty"` + // RunningNodeCount - READ-ONLY; Number of compute nodes which are running jobs. + RunningNodeCount *int32 `json:"runningNodeCount,omitempty"` + // PreparingNodeCount - READ-ONLY; Number of compute nodes which are being prepared. + PreparingNodeCount *int32 `json:"preparingNodeCount,omitempty"` + // UnusableNodeCount - READ-ONLY; Number of compute nodes which are in unusable state. + UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty"` + // LeavingNodeCount - READ-ONLY; Number of compute nodes which are leaving the amlCompute. + LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty"` + // PreemptedNodeCount - READ-ONLY; Number of compute nodes which are in preempted state. + PreemptedNodeCount *int32 `json:"preemptedNodeCount,omitempty"` +} + +// Operation azure Machine Learning workspace REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display name of operation + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay display name of operation +type OperationDisplay struct { + // Provider - The resource provider name: Microsoft.MachineLearningExperimentation + Provider *string `json:"provider,omitempty"` + // Resource - The resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - The operation that users can perform. + Operation *string `json:"operation,omitempty"` + // Description - The description for the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult an array of operations supported by the resource provider. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of AML workspace operations supported by the AML workspace resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// PaginatedComputeResourcesList paginated list of Machine Learning compute objects wrapped in ARM resource +// envelope. +type PaginatedComputeResourcesList struct { + autorest.Response `json:"-"` + // Value - An array of Machine Learning compute objects wrapped in ARM resource envelope. + Value *[]ComputeResource `json:"value,omitempty"` + // NextLink - A continuation link (absolute URI) to the next page of results in the list. + NextLink *string `json:"nextLink,omitempty"` +} + +// PaginatedComputeResourcesListIterator provides access to a complete listing of ComputeResource values. +type PaginatedComputeResourcesListIterator struct { + i int + page PaginatedComputeResourcesListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PaginatedComputeResourcesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PaginatedComputeResourcesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PaginatedComputeResourcesListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PaginatedComputeResourcesListIterator) Response() PaginatedComputeResourcesList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PaginatedComputeResourcesListIterator) Value() ComputeResource { + if !iter.page.NotDone() { + return ComputeResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PaginatedComputeResourcesListIterator type. +func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator { + return PaginatedComputeResourcesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcrl PaginatedComputeResourcesList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 +} + +// paginatedComputeResourcesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl PaginatedComputeResourcesList) paginatedComputeResourcesListPreparer(ctx context.Context) (*http.Request, error) { + if pcrl.NextLink == nil || len(to.String(pcrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// PaginatedComputeResourcesListPage contains a page of ComputeResource values. +type PaginatedComputeResourcesListPage struct { + fn func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error) + pcrl PaginatedComputeResourcesList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PaginatedComputeResourcesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.pcrl) + if err != nil { + return err + } + page.pcrl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PaginatedComputeResourcesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PaginatedComputeResourcesListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PaginatedComputeResourcesListPage) Response() PaginatedComputeResourcesList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PaginatedComputeResourcesListPage) Values() []ComputeResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// Creates a new instance of the PaginatedComputeResourcesListPage type. +func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { + return PaginatedComputeResourcesListPage{fn: getNextPage} +} + +// Password ... +type Password struct { + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Value - READ-ONLY + Value *string `json:"value,omitempty"` +} + +// QuotaBaseProperties the properties for Quota update or retrieval. +type QuotaBaseProperties struct { + // ID - Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - Specifies the resource type. + Type *string `json:"type,omitempty"` + // Limit - The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` +} + +// QuotaUpdateParameters quota update parameters. +type QuotaUpdateParameters struct { + // Value - The list for update quota. + Value *[]QuotaBaseProperties `json:"value,omitempty"` +} + +// RegistryListCredentialsResult ... +type RegistryListCredentialsResult struct { + // Location - READ-ONLY + Location *string `json:"location,omitempty"` + // Username - READ-ONLY + Username *string `json:"username,omitempty"` + Passwords *[]Password `json:"passwords,omitempty"` +} + +// Resource azure Resource Manager resource envelope. +type Resource struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Specifies the name of the resource. + Name *string `json:"name,omitempty"` + // Identity - READ-ONLY; The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Specifies the type of the resource. + Type *string `json:"type,omitempty"` + // Tags - Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags"` + // Sku - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Sku != nil { + objectMap["sku"] = r.Sku + } + return json.Marshal(objectMap) +} + +// ResourceID represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. +type ResourceID struct { + // ID - The ID of the resource + ID *string `json:"id,omitempty"` +} + +// ResourceName the Resource Name. +type ResourceName struct { + // Value - READ-ONLY; The name of the resource. + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// ResourceQuota the quota assigned to a resource. +type ResourceQuota struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; Name of the resource. + Name *ResourceName `json:"name,omitempty"` + // Limit - READ-ONLY; The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` +} + +// ResourceSkuLocationInfo ... +type ResourceSkuLocationInfo struct { + // Location - READ-ONLY; Location of the SKU + Location *string `json:"location,omitempty"` + // Zones - READ-ONLY; List of availability zones where the SKU is supported. + Zones *[]string `json:"zones,omitempty"` + // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. + ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` +} + +// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. +type ResourceSkuZoneDetails struct { + // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. + Name *[]string `json:"name,omitempty"` + // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. + Capabilities *[]SKUCapability `json:"capabilities,omitempty"` +} + +// Restriction the restriction because of which SKU cannot be used. +type Restriction struct { + // Type - READ-ONLY; The type of restrictions. As of now only possible value for this is location. + Type *string `json:"type,omitempty"` + // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + Values *[]string `json:"values,omitempty"` + // ReasonCode - The reason for the restriction. Possible values include: 'NotSpecified', 'NotAvailableForRegion', 'NotAvailableForSubscription' + ReasonCode ReasonCode `json:"reasonCode,omitempty"` +} + +// ScaleSettings scale settings for AML Compute +type ScaleSettings struct { + // MaxNodeCount - Max number of nodes to use + MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` + // MinNodeCount - Min number of nodes to use + MinNodeCount *int32 `json:"minNodeCount,omitempty"` + // NodeIdleTimeBeforeScaleDown - Node Idle Time before scaling down amlCompute + NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` +} + +// ServicePrincipalCredentials service principal credentials. +type ServicePrincipalCredentials struct { + // ClientID - Client Id + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client secret + ClientSecret *string `json:"clientSecret,omitempty"` +} + +// Sku sku of the resource +type Sku struct { + // Name - Name of the sku + Name *string `json:"name,omitempty"` + // Tier - Tier of the sku like Basic or Enterprise + Tier *string `json:"tier,omitempty"` +} + +// SKUCapability features/user capabilities associated with the sku +type SKUCapability struct { + // Name - Capability/Feature ID + Name *string `json:"name,omitempty"` + // Value - Details about the feature/capability + Value *string `json:"value,omitempty"` +} + +// SkuListResult list of skus with features +type SkuListResult struct { + autorest.Response `json:"-"` + Value *[]WorkspaceSku `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of Workspace Skus. Call ListNext() with this URI to fetch the next page of Workspace Skus + NextLink *string `json:"nextLink,omitempty"` +} + +// SkuListResultIterator provides access to a complete listing of WorkspaceSku values. +type SkuListResultIterator struct { + i int + page SkuListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SkuListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SkuListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SkuListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SkuListResultIterator) Response() SkuListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SkuListResultIterator) Value() WorkspaceSku { + if !iter.page.NotDone() { + return WorkspaceSku{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SkuListResultIterator type. +func NewSkuListResultIterator(page SkuListResultPage) SkuListResultIterator { + return SkuListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr SkuListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// skuListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr SkuListResult) skuListResultPreparer(ctx context.Context) (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// SkuListResultPage contains a page of WorkspaceSku values. +type SkuListResultPage struct { + fn func(context.Context, SkuListResult) (SkuListResult, error) + slr SkuListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SkuListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SkuListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SkuListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SkuListResultPage) Response() SkuListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SkuListResultPage) Values() []WorkspaceSku { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// Creates a new instance of the SkuListResultPage type. +func NewSkuListResultPage(getNextPage func(context.Context, SkuListResult) (SkuListResult, error)) SkuListResultPage { + return SkuListResultPage{fn: getNextPage} +} + +// SslConfiguration the ssl configuration for scoring +type SslConfiguration struct { + // Status - Enable or disable ssl for scoring. Possible values include: 'Disabled', 'Enabled' + Status Status1 `json:"status,omitempty"` + // Cert - Cert data + Cert *string `json:"cert,omitempty"` + // Key - Key data + Key *string `json:"key,omitempty"` + // Cname - CNAME of the cert + Cname *string `json:"cname,omitempty"` +} + +// SystemService a system service running on a compute. +type SystemService struct { + // SystemServiceType - READ-ONLY; The type of this system service. + SystemServiceType *string `json:"systemServiceType,omitempty"` + // PublicIPAddress - READ-ONLY; Public IP address + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + // Version - READ-ONLY; The version for this type. + Version *string `json:"version,omitempty"` +} + +// UpdateWorkspaceQuotas the properties for update Quota response. +type UpdateWorkspaceQuotas struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty"` + // Limit - The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` + // Status - Status of update workspace quota. Possible values include: 'Undefined', 'Success', 'Failure', 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', 'InvalidVMFamilyName', 'OperationNotSupportedForSku', 'OperationNotEnabledForRegion' + Status Status `json:"status,omitempty"` +} + +// UpdateWorkspaceQuotasResult the result of update workspace quota. +type UpdateWorkspaceQuotasResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of workspace quota update result. + Value *[]UpdateWorkspaceQuotas `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result. + NextLink *string `json:"nextLink,omitempty"` +} + +// Usage describes AML Resource Usage. +type Usage struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty"` + // Unit - READ-ONLY; An enum describing the unit of usage measurement. Possible values include: 'UsageUnitCount' + Unit UsageUnit `json:"unit,omitempty"` + // CurrentValue - READ-ONLY; The current usage of the resource. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Limit - READ-ONLY; The maximum permitted usage of the resource. + Limit *int64 `json:"limit,omitempty"` + // Name - READ-ONLY; The name of the type of usage. + Name *UsageName `json:"name,omitempty"` +} + +// UsageName the Usage Names. +type UsageName struct { + // Value - READ-ONLY; The name of the resource. + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// UserAccountCredentials settings for user account that gets created on each on the nodes of a compute. +type UserAccountCredentials struct { + // AdminUserName - Name of the administrator user account which can be used to SSH to nodes. + AdminUserName *string `json:"adminUserName,omitempty"` + // AdminUserSSHPublicKey - SSH public key of the administrator user account. + AdminUserSSHPublicKey *string `json:"adminUserSshPublicKey,omitempty"` + // AdminUserPassword - Password of the administrator user account. + AdminUserPassword *string `json:"adminUserPassword,omitempty"` +} + +// VirtualMachine a Machine Learning compute based on Azure Virtual Machines. +type VirtualMachine struct { + Properties *VirtualMachineProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachine. +func (VM VirtualMachine) MarshalJSON() ([]byte, error) { + VM.ComputeType = ComputeTypeVirtualMachine1 + objectMap := make(map[string]interface{}) + if VM.Properties != nil { + objectMap["properties"] = VM.Properties + } + if VM.ComputeLocation != nil { + objectMap["computeLocation"] = VM.ComputeLocation + } + if VM.Description != nil { + objectMap["description"] = VM.Description + } + if VM.ResourceID != nil { + objectMap["resourceId"] = VM.ResourceID + } + if VM.ComputeType != "" { + objectMap["computeType"] = VM.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsVirtualMachine() (*VirtualMachine, bool) { + return &VM, true +} + +// AsHDInsight is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsBasicCompute() (BasicCompute, bool) { + return &VM, true +} + +// VirtualMachineProperties ... +type VirtualMachineProperties struct { + // VirtualMachineSize - Virtual Machine size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` + // SSHPort - Port open for ssh connections. + SSHPort *int32 `json:"sshPort,omitempty"` + // Address - Public IP address of the virtual machine. + Address *string `json:"address,omitempty"` + // AdministratorAccount - Admin credentials for virtual machine + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` +} + +// VirtualMachineSecrets secrets related to a Machine Learning compute based on AKS. +type VirtualMachineSecrets struct { + // AdministratorAccount - Admin credentials for virtual machine. + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' + ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) MarshalJSON() ([]byte, error) { + vms.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine + objectMap := make(map[string]interface{}) + if vms.AdministratorAccount != nil { + objectMap["administratorAccount"] = vms.AdministratorAccount + } + if vms.ComputeType != "" { + objectMap["computeType"] = vms.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { + return nil, false +} + +// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { + return &vms, true +} + +// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { + return nil, false +} + +// AsComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { + return nil, false +} + +// AsBasicComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { + return &vms, true +} + +// VirtualMachineSize describes the properties of a VM size. +type VirtualMachineSize struct { + // Name - READ-ONLY; The name of the virtual machine size. + Name *string `json:"name,omitempty"` + // Family - READ-ONLY; The family name of the virtual machine size. + Family *string `json:"family,omitempty"` + // VCPUs - READ-ONLY; The number of vCPUs supported by the virtual machine size. + VCPUs *int32 `json:"vCPUs,omitempty"` + // Gpus - READ-ONLY; The number of gPUs supported by the virtual machine size. + Gpus *int32 `json:"gpus,omitempty"` + // OsVhdSizeMB - READ-ONLY; The OS VHD disk size, in MB, allowed by the virtual machine size. + OsVhdSizeMB *int32 `json:"osVhdSizeMB,omitempty"` + // MaxResourceVolumeMB - READ-ONLY; The resource volume size, in MB, allowed by the virtual machine size. + MaxResourceVolumeMB *int32 `json:"maxResourceVolumeMB,omitempty"` + // MemoryGB - READ-ONLY; The amount of memory, in GB, supported by the virtual machine size. + MemoryGB *float64 `json:"memoryGB,omitempty"` + // LowPriorityCapable - READ-ONLY; Specifies if the virtual machine size supports low priority VMs. + LowPriorityCapable *bool `json:"lowPriorityCapable,omitempty"` + // PremiumIO - READ-ONLY; Specifies if the virtual machine size supports premium IO. + PremiumIO *bool `json:"premiumIO,omitempty"` +} + +// VirtualMachineSizeListResult the List Virtual Machine size operation response. +type VirtualMachineSizeListResult struct { + autorest.Response `json:"-"` + // AmlCompute - The list of virtual machine sizes supported by AmlCompute. + AmlCompute *[]VirtualMachineSize `json:"amlCompute,omitempty"` +} + +// VirtualMachineSSHCredentials admin credentials for virtual machine +type VirtualMachineSSHCredentials struct { + // Username - Username of admin account + Username *string `json:"username,omitempty"` + // Password - Password of admin account + Password *string `json:"password,omitempty"` + // PublicKeyData - Public key data + PublicKeyData *string `json:"publicKeyData,omitempty"` + // PrivateKeyData - Private key data + PrivateKeyData *string `json:"privateKeyData,omitempty"` +} + +// Workspace an object that represents a machine learning workspace. +type Workspace struct { + autorest.Response `json:"-"` + // WorkspaceProperties - The properties of the machine learning workspace. + *WorkspaceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Specifies the name of the resource. + Name *string `json:"name,omitempty"` + // Identity - READ-ONLY; The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Specifies the type of the resource. + Type *string `json:"type,omitempty"` + // Tags - Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags"` + // Sku - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WorkspaceProperties != nil { + objectMap["properties"] = w.WorkspaceProperties + } + if w.Location != nil { + objectMap["location"] = w.Location + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Sku != nil { + objectMap["sku"] = w.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Workspace struct. +func (w *Workspace) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workspaceProperties WorkspaceProperties + err = json.Unmarshal(*v, &workspaceProperties) + if err != nil { + return err + } + w.WorkspaceProperties = &workspaceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + w.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + w.Sku = &sku + } + } + } + + return nil +} + +// WorkspaceListResult the result of a request to list machine learning workspaces. +type WorkspaceListResult struct { + autorest.Response `json:"-"` + // Value - The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. + Value *[]Workspace `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of machine learning workspaces. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkspaceListResultIterator provides access to a complete listing of Workspace values. +type WorkspaceListResultIterator struct { + i int + page WorkspaceListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WorkspaceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WorkspaceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkspaceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WorkspaceListResultIterator) Response() WorkspaceListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WorkspaceListResultIterator) Value() Workspace { + if !iter.page.NotDone() { + return Workspace{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkspaceListResultIterator type. +func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator { + return WorkspaceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WorkspaceListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// workspaceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WorkspaceListResult) workspaceListResultPreparer(ctx context.Context) (*http.Request, error) { + if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wlr.NextLink))) +} + +// WorkspaceListResultPage contains a page of Workspace values. +type WorkspaceListResultPage struct { + fn func(context.Context, WorkspaceListResult) (WorkspaceListResult, error) + wlr WorkspaceListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WorkspaceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.wlr) + if err != nil { + return err + } + page.wlr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *WorkspaceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkspaceListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkspaceListResultPage) Response() WorkspaceListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkspaceListResultPage) Values() []Workspace { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// Creates a new instance of the WorkspaceListResultPage type. +func NewWorkspaceListResultPage(getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage { + return WorkspaceListResultPage{fn: getNextPage} +} + +// WorkspaceProperties the properties of a machine learning workspace. +type WorkspaceProperties struct { + // WorkspaceID - READ-ONLY; The immutable id associated with this workspace. + WorkspaceID *string `json:"workspaceId,omitempty"` + // Description - The description of this workspace. + Description *string `json:"description,omitempty"` + // FriendlyName - The friendly name for this workspace. This name in mutable + FriendlyName *string `json:"friendlyName,omitempty"` + // CreationTime - READ-ONLY; The creation time of the machine learning workspace in ISO8601 format. + CreationTime *date.Time `json:"creationTime,omitempty"` + // KeyVault - ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created + KeyVault *string `json:"keyVault,omitempty"` + // ApplicationInsights - ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created + ApplicationInsights *string `json:"applicationInsights,omitempty"` + // ContainerRegistry - ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created + ContainerRegistry *string `json:"containerRegistry,omitempty"` + // StorageAccount - ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created + StorageAccount *string `json:"storageAccount,omitempty"` + // DiscoveryURL - Url for the discovery service to identify regional endpoints for machine learning experimentation services + DiscoveryURL *string `json:"discoveryUrl,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning +// workspace. +type WorkspacePropertiesUpdateParameters struct { + // Description - The description of this workspace. + Description *string `json:"description,omitempty"` + // FriendlyName - The friendly name for this workspace. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// WorkspaceSku describes Workspace Sku details and features +type WorkspaceSku struct { + // Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + Locations *[]string `json:"locations,omitempty"` + // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. + LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` + // Tier - READ-ONLY; Sku Tier like Basic or Enterprise + Tier *string `json:"tier,omitempty"` + // ResourceType - READ-ONLY + ResourceType *string `json:"resourceType,omitempty"` + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Capabilities - READ-ONLY; List of features/user capabilities associated with the sku + Capabilities *[]SKUCapability `json:"capabilities,omitempty"` + // Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + Restrictions *[]Restriction `json:"restrictions,omitempty"` +} + +// WorkspaceUpdateParameters the parameters for updating a machine learning workspace. +type WorkspaceUpdateParameters struct { + // Tags - The resource tags for the machine learning workspace. + Tags map[string]*string `json:"tags"` + // Sku - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` + // WorkspacePropertiesUpdateParameters - The properties that the machine learning workspace will be updated with. + *WorkspacePropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkspaceUpdateParameters. +func (wup WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Tags != nil { + objectMap["tags"] = wup.Tags + } + if wup.Sku != nil { + objectMap["sku"] = wup.Sku + } + if wup.WorkspacePropertiesUpdateParameters != nil { + objectMap["properties"] = wup.WorkspacePropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkspaceUpdateParameters struct. +func (wup *WorkspaceUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wup.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + wup.Sku = &sku + } + case "properties": + if v != nil { + var workspacePropertiesUpdateParameters WorkspacePropertiesUpdateParameters + err = json.Unmarshal(*v, &workspacePropertiesUpdateParameters) + if err != nil { + return err + } + wup.WorkspacePropertiesUpdateParameters = &workspacePropertiesUpdateParameters + } + } + } + + return nil +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/operations.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/operations.go new file mode 100644 index 000000000000..ac0b4618539a --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/operations.go @@ -0,0 +1,109 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Azure Machine Learning Workspaces REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.MachineLearningServices/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/quotas.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/quotas.go new file mode 100644 index 000000000000..37294ebc7a90 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/quotas.go @@ -0,0 +1,245 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// QuotasClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type QuotasClient struct { + BaseClient +} + +// NewQuotasClient creates an instance of the QuotasClient client. +func NewQuotasClient(subscriptionID string) QuotasClient { + return NewQuotasClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQuotasClientWithBaseURI creates an instance of the QuotasClient client. +func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { + return QuotasClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets the currently assigned Workspace Quotas based on VMFamily. +// Parameters: +// location - the location for which resource usage is queried. +func (client QuotasClient) List(ctx context.Context, location string) (result ListWorkspaceQuotasPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.List") + defer func() { + sc := -1 + if result.lwq.Response.Response != nil { + sc = result.lwq.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.QuotasClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lwq.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", resp, "Failure sending request") + return + } + + result.lwq, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client QuotasClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client QuotasClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client QuotasClient) ListResponder(resp *http.Response) (result ListWorkspaceQuotas, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client QuotasClient) listNextResults(ctx context.Context, lastResults ListWorkspaceQuotas) (result ListWorkspaceQuotas, err error) { + req, err := lastResults.listWorkspaceQuotasPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client QuotasClient) ListComplete(ctx context.Context, location string) (result ListWorkspaceQuotasIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, location) + return +} + +// Update update quota for each VM family in workspace. +// Parameters: +// location - the location for update quota is queried. +// parameters - quota update parameters. +func (client QuotasClient) Update(ctx context.Context, location string, parameters QuotaUpdateParameters) (result UpdateWorkspaceQuotasResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.QuotasClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, location, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client QuotasClient) UpdatePreparer(ctx context.Context, location string, parameters QuotaUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client QuotasClient) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client QuotasClient) UpdateResponder(resp *http.Response) (result UpdateWorkspaceQuotasResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/usages.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/usages.go new file mode 100644 index 000000000000..24e129428c59 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/usages.go @@ -0,0 +1,161 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UsagesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type UsagesClient struct { + BaseClient +} + +// NewUsagesClient creates an instance of the UsagesClient client. +func NewUsagesClient(subscriptionID string) UsagesClient { + return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client. +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { + return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets the current usage information as well as limits for AML resources for given subscription and location. +// Parameters: +// location - the location for which resource usage is queried. +func (client UsagesClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") + defer func() { + sc := -1 + if result.lur.Response.Response != nil { + sc = result.lur.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.UsagesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lur.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", resp, "Failure sending request") + return + } + + result.lur, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UsagesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client UsagesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client UsagesClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client UsagesClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { + req, err := lastResults.listUsagesResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsagesClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, location) + return +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/version.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/version.go new file mode 100644 index 000000000000..ac06eadc9b76 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/version.go @@ -0,0 +1,30 @@ +package machinelearningservices + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " machinelearningservices/2019-11-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/virtualmachinesizes.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/virtualmachinesizes.go new file mode 100644 index 000000000000..676292e87790 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/virtualmachinesizes.go @@ -0,0 +1,124 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineSizesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace +// resources. +type VirtualMachineSizesClient struct { + BaseClient +} + +// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. +func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { + return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client. +func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { + return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List returns supported VM Sizes in a location +// Parameters: +// location - the location upon which virtual-machine-sizes is queried. +func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.VirtualMachineSizesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspacefeatures.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspacefeatures.go new file mode 100644 index 000000000000..63fd28903762 --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspacefeatures.go @@ -0,0 +1,156 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// WorkspaceFeaturesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type WorkspaceFeaturesClient struct { + BaseClient +} + +// NewWorkspaceFeaturesClient creates an instance of the WorkspaceFeaturesClient client. +func NewWorkspaceFeaturesClient(subscriptionID string) WorkspaceFeaturesClient { + return NewWorkspaceFeaturesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceFeaturesClientWithBaseURI creates an instance of the WorkspaceFeaturesClient client. +func NewWorkspaceFeaturesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceFeaturesClient { + return WorkspaceFeaturesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all enabled features for a workspace +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspaceFeaturesClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result ListAmlUserFeatureResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceFeaturesClient.List") + defer func() { + sc := -1 + if result.laufr.Response.Response != nil { + sc = result.laufr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.laufr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", resp, "Failure sending request") + return + } + + result.laufr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkspaceFeaturesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspaceFeaturesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkspaceFeaturesClient) ListResponder(resp *http.Response) (result ListAmlUserFeatureResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client WorkspaceFeaturesClient) listNextResults(ctx context.Context, lastResults ListAmlUserFeatureResult) (result ListAmlUserFeatureResult, err error) { + req, err := lastResults.listAmlUserFeatureResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceFeaturesClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result ListAmlUserFeatureResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceFeaturesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, workspaceName) + return +} diff --git a/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspaces.go b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspaces.go new file mode 100644 index 000000000000..c46070841a5a --- /dev/null +++ b/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices/workspaces.go @@ -0,0 +1,741 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// WorkspacesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type WorkspacesClient struct { + BaseClient +} + +// NewWorkspacesClient creates an instance of the WorkspacesClient client. +func NewWorkspacesClient(subscriptionID string) WorkspacesClient { + return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient client. +func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { + return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a workspace with the specified parameters. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// parameters - the parameters for creating or updating a machine learning workspace. +func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a machine learning workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified machine learning workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all the available machine learning workspaces under the specified resource group. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// skiptoken - continuation token for pagination. +func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result WorkspaceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.wlr.Response.Response != nil { + sc = result.wlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, skiptoken) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client WorkspacesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, skiptoken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client WorkspacesClient) listByResourceGroupNextResults(ctx context.Context, lastResults WorkspaceListResult) (result WorkspaceListResult, err error) { + req, err := lastResults.workspaceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skiptoken string) (result WorkspaceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, skiptoken) + return +} + +// ListBySubscription lists all the available machine learning workspaces under the specified subscription. +// Parameters: +// skiptoken - continuation token for pagination. +func (client WorkspacesClient) ListBySubscription(ctx context.Context, skiptoken string) (result WorkspaceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") + defer func() { + sc := -1 + if result.wlr.Response.Response != nil { + sc = result.wlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, skiptoken) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client WorkspacesClient) ListBySubscriptionPreparer(ctx context.Context, skiptoken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client WorkspacesClient) listBySubscriptionNextResults(ctx context.Context, lastResults WorkspaceListResult) (result WorkspaceListResult, err error) { + req, err := lastResults.workspaceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListBySubscriptionComplete(ctx context.Context, skiptoken string) (result WorkspaceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx, skiptoken) + return +} + +// ListKeys lists all the keys associated with this workspace. This includes keys for the storage account, app insights +// and password for container registry +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspacesClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result ListWorkspaceKeysResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListKeysPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client WorkspacesClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeysSender sends the ListKeys request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) ListKeysSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeysResponder handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) ListKeysResponder(resp *http.Response) (result ListWorkspaceKeysResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResyncKeys resync all the keys associated with this workspace. This includes keys for the storage account, app +// insights and password for container registry +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspacesClient) ResyncKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ResyncKeys") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResyncKeysPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ResyncKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ResyncKeysSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ResyncKeys", resp, "Failure sending request") + return + } + + result, err = client.ResyncKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ResyncKeys", resp, "Failure responding to request") + } + + return +} + +// ResyncKeysPreparer prepares the ResyncKeys request. +func (client WorkspacesClient) ResyncKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncKeysSender sends the ResyncKeys request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) ResyncKeysSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ResyncKeysResponder handles the response to the ResyncKeys request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) ResyncKeysResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates a machine learning workspace with the specified parameters. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// parameters - the parameters for updating a machine learning workspace. +func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/network/mgmt/2019-04-01/network/models.go b/services/network/mgmt/2019-04-01/network/models.go index 8aa70030b245..87d608f3e464 100644 --- a/services/network/mgmt/2019-04-01/network/models.go +++ b/services/network/mgmt/2019-04-01/network/models.go @@ -21409,8 +21409,8 @@ type PrivateLinkServiceConnectionState struct { Status *string `json:"status,omitempty"` // Description - The reason for approval/rejection of the connection. Description *string `json:"description,omitempty"` - // ActionRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionRequired *string `json:"actionRequired,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` } // PrivateLinkServiceIPConfiguration the private link service ip configuration. diff --git a/services/network/mgmt/2019-06-01/network/models.go b/services/network/mgmt/2019-06-01/network/models.go index 49f667bf9a30..c5d93eac2258 100644 --- a/services/network/mgmt/2019-06-01/network/models.go +++ b/services/network/mgmt/2019-06-01/network/models.go @@ -23123,8 +23123,8 @@ type PrivateLinkServiceConnectionState struct { Status *string `json:"status,omitempty"` // Description - The reason for approval/rejection of the connection. Description *string `json:"description,omitempty"` - // ActionRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionRequired *string `json:"actionRequired,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` } // PrivateLinkServiceIPConfiguration the private link service ip configuration. diff --git a/services/network/mgmt/2019-07-01/network/models.go b/services/network/mgmt/2019-07-01/network/models.go index c0bc4ef5968b..17577eee7046 100644 --- a/services/network/mgmt/2019-07-01/network/models.go +++ b/services/network/mgmt/2019-07-01/network/models.go @@ -23185,8 +23185,8 @@ type PrivateLinkServiceConnectionState struct { Status *string `json:"status,omitempty"` // Description - The reason for approval/rejection of the connection. Description *string `json:"description,omitempty"` - // ActionRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionRequired *string `json:"actionRequired,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` } // PrivateLinkServiceIPConfiguration the private link service ip configuration. diff --git a/services/network/mgmt/2019-08-01/network/models.go b/services/network/mgmt/2019-08-01/network/models.go index 305a1b9f754c..8fb81ab6a486 100644 --- a/services/network/mgmt/2019-08-01/network/models.go +++ b/services/network/mgmt/2019-08-01/network/models.go @@ -23143,8 +23143,8 @@ type PrivateLinkServiceConnectionState struct { Status *string `json:"status,omitempty"` // Description - The reason for approval/rejection of the connection. Description *string `json:"description,omitempty"` - // ActionRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionRequired *string `json:"actionRequired,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` } // PrivateLinkServiceIPConfiguration the private link service ip configuration. diff --git a/services/network/mgmt/2019-09-01/network/ipgroups.go b/services/network/mgmt/2019-09-01/network/ipgroups.go index 5d6da6c48b57..fc9c39e4b049 100644 --- a/services/network/mgmt/2019-09-01/network/ipgroups.go +++ b/services/network/mgmt/2019-09-01/network/ipgroups.go @@ -502,7 +502,7 @@ func (client IPGroupsClient) ListByResourceGroupComplete(ctx context.Context, re return } -// UpdateGroups updates an IpGroups +// UpdateGroups updates tags of an IpGroups resource. // Parameters: // resourceGroupName - the name of the resource group. // IPGroupsName - the name of the ipGroups. diff --git a/services/network/mgmt/2019-09-01/network/models.go b/services/network/mgmt/2019-09-01/network/models.go index 3bf82a37e5e3..087ff4995acf 100644 --- a/services/network/mgmt/2019-09-01/network/models.go +++ b/services/network/mgmt/2019-09-01/network/models.go @@ -7295,7 +7295,7 @@ type AzureFirewallPropertiesFormat struct { HubIPAddresses *HubIPAddresses `json:"hubIpAddresses,omitempty"` // Sku - The Azure Firewall Resource SKU. Sku *AzureFirewallSku `json:"sku,omitempty"` - // AdditionalProperties - The additional properties used to further config this azure firewall + // AdditionalProperties - The additional properties used to further config this azure firewall. AdditionalProperties map[string]*string `json:"additionalProperties"` } @@ -17260,7 +17260,7 @@ type IPGroupPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // IPAddresses - IpAddresses/IpAddressPrefixes in the IpGroups resource. IPAddresses *[]string `json:"ipAddresses,omitempty"` - // Firewalls - READ-ONLY; List of references to Azure resources that this IpGroups is associated with + // Firewalls - READ-ONLY; List of references to Azure resources that this IpGroups is associated with. Firewalls *[]SubResource `json:"firewalls,omitempty"` } @@ -23348,8 +23348,8 @@ type PrivateLinkServiceConnectionState struct { Status *string `json:"status,omitempty"` // Description - The reason for approval/rejection of the connection. Description *string `json:"description,omitempty"` - // ActionRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionRequired *string `json:"actionRequired,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` } // PrivateLinkServiceIPConfiguration the private link service ip configuration. @@ -28315,9 +28315,9 @@ type TrafficAnalyticsProperties struct { // TrafficSelectorPolicy an traffic selector policy for a virtual network gateway connection. type TrafficSelectorPolicy struct { - // LocalAddressRanges - A collection of local address spaces in CIDR format + // LocalAddressRanges - A collection of local address spaces in CIDR format. LocalAddressRanges *[]string `json:"localAddressRanges,omitempty"` - // RemoteAddressRanges - A collection of remote address spaces in CIDR format + // RemoteAddressRanges - A collection of remote address spaces in CIDR format. RemoteAddressRanges *[]string `json:"remoteAddressRanges,omitempty"` } @@ -28944,11 +28944,11 @@ func (future *VirtualHubRouteTableV2sDeleteFuture) Result(client VirtualHubRoute // VirtualHubRouteV2 virtualHubRouteTableV2 route. type VirtualHubRouteV2 struct { - // DestinationType - The type of destinations + // DestinationType - The type of destinations. DestinationType *string `json:"destinationType,omitempty"` // Destinations - List of all destinations. Destinations *[]string `json:"destinations,omitempty"` - // NextHopType - The type of next hops + // NextHopType - The type of next hops. NextHopType *string `json:"nextHopType,omitempty"` // NextHops - NextHops ip address. NextHops *[]string `json:"nextHops,omitempty"` @@ -29124,9 +29124,9 @@ func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { // VirtualNetworkBgpCommunities bgp Communities sent over ExpressRoute with each route corresponding to a // prefix in this VNET. type VirtualNetworkBgpCommunities struct { - // VirtualNetworkCommunity - The BGP community associated with the virtual network + // VirtualNetworkCommunity - The BGP community associated with the virtual network. VirtualNetworkCommunity *string `json:"virtualNetworkCommunity,omitempty"` - // RegionalCommunity - READ-ONLY; The BGP community associated with the region of the virtual network + // RegionalCommunity - READ-ONLY; The BGP community associated with the region of the virtual network. RegionalCommunity *string `json:"regionalCommunity,omitempty"` } @@ -31820,7 +31820,7 @@ type VirtualRouter struct { autorest.Response `json:"-"` // VirtualRouterPropertiesFormat - Properties of the Virtual Router. *VirtualRouterPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` @@ -32076,14 +32076,14 @@ func NewVirtualRouterListResultPage(getNextPage func(context.Context, VirtualRou return VirtualRouterListResultPage{fn: getNextPage} } -// VirtualRouterPeering virtual Router Peering resource +// VirtualRouterPeering virtual Router Peering resource. type VirtualRouterPeering struct { autorest.Response `json:"-"` // VirtualRouterPeeringProperties - The properties of the Virtual Router Peering. *VirtualRouterPeeringProperties `json:"properties,omitempty"` - // Name - Gets name of the peering unique to VirtualRouter. This name can be used to access the resource. + // Name - Name of the virtual router peering that is unique within a virtual router. Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` // Type - READ-ONLY; Peering type. Type *string `json:"type,omitempty"` @@ -32375,17 +32375,17 @@ func (future *VirtualRouterPeeringsDeleteFuture) Result(client VirtualRouterPeer return } -// VirtualRouterPropertiesFormat virtual Router definition +// VirtualRouterPropertiesFormat virtual Router definition. type VirtualRouterPropertiesFormat struct { // VirtualRouterAsn - VirtualRouter ASN. VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - // VirtualRouterIps - VirtualRouter IPs + // VirtualRouterIps - VirtualRouter IPs. VirtualRouterIps *[]string `json:"virtualRouterIps,omitempty"` // HostedSubnet - The Subnet on which VirtualRouter is hosted. HostedSubnet *SubResource `json:"hostedSubnet,omitempty"` // HostedGateway - The Gateway on which VirtualRouter is hosted. HostedGateway *SubResource `json:"hostedGateway,omitempty"` - // Peerings - READ-ONLY; List of references to VirtualRouterPeerings + // Peerings - READ-ONLY; List of references to VirtualRouterPeerings. Peerings *[]SubResource `json:"peerings,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` @@ -33377,7 +33377,7 @@ type VpnServerConfiguration struct { autorest.Response `json:"-"` // VpnServerConfigurationProperties - Properties of the P2SVpnServer configuration. *VpnServerConfigurationProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` @@ -34851,7 +34851,7 @@ type WebApplicationFirewallPolicyPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceState - READ-ONLY; Resource status of the policy. Possible values include: 'WebApplicationFirewallPolicyResourceStateCreating', 'WebApplicationFirewallPolicyResourceStateEnabling', 'WebApplicationFirewallPolicyResourceStateEnabled', 'WebApplicationFirewallPolicyResourceStateDisabling', 'WebApplicationFirewallPolicyResourceStateDisabled', 'WebApplicationFirewallPolicyResourceStateDeleting' ResourceState WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"` - // ManagedRules - Describes the managedRules structure + // ManagedRules - Describes the managedRules structure. ManagedRules *ManagedRulesDefinition `json:"managedRules,omitempty"` // HTTPListeners - READ-ONLY; A collection of references to application gateway http listeners. HTTPListeners *[]SubResource `json:"httpListeners,omitempty"` diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/apps.go b/services/preview/cognitiveservices/v3.0/luis/authoring/apps.go index 13de58e56cf0..c6dcaebc2fe3 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/apps.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/apps.go @@ -90,7 +90,7 @@ func (client AppsClient) AddPreparer(ctx context.Context, applicationCreateObjec preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/"), autorest.WithJSON(applicationCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -160,7 +160,7 @@ func (client AppsClient) AddCustomPrebuiltDomainPreparer(ctx context.Context, pr preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/customprebuiltdomains"), autorest.WithJSON(prebuiltDomainCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -241,7 +241,7 @@ func (client AppsClient) DeletePreparer(ctx context.Context, appID uuid.UUID, fo preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -314,7 +314,7 @@ func (client AppsClient) DownloadQueryLogsPreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/querylogs", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -385,7 +385,7 @@ func (client AppsClient) GetPreparer(ctx context.Context, appID uuid.UUID) (*htt preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -457,7 +457,7 @@ func (client AppsClient) GetPublishSettingsPreparer(ctx context.Context, appID u preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/publishsettings", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -529,7 +529,7 @@ func (client AppsClient) GetSettingsPreparer(ctx context.Context, appID uuid.UUI preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/settings", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -605,7 +605,7 @@ func (client AppsClient) ImportPreparer(ctx context.Context, luisApp LuisApp, ap preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/import"), autorest.WithJSON(luisApp), autorest.WithQueryParameters(queryParameters)) @@ -700,7 +700,7 @@ func (client AppsClient) ListPreparer(ctx context.Context, skip *int32, take *in preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -767,7 +767,7 @@ func (client AppsClient) ListAvailableCustomPrebuiltDomainsPreparer(ctx context. preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/customprebuiltdomains")) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -839,7 +839,7 @@ func (client AppsClient) ListAvailableCustomPrebuiltDomainsForCulturePreparer(ct preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/customprebuiltdomains/{culture}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -905,7 +905,7 @@ func (client AppsClient) ListCortanaEndpointsPreparer(ctx context.Context) (*htt preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/assistants")) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -971,7 +971,7 @@ func (client AppsClient) ListDomainsPreparer(ctx context.Context) (*http.Request preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/domains")) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1043,7 +1043,7 @@ func (client AppsClient) ListEndpointsPreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/endpoints", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1110,7 +1110,7 @@ func (client AppsClient) ListSupportedCulturesPreparer(ctx context.Context) (*ht preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/cultures")) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1176,7 +1176,7 @@ func (client AppsClient) ListUsageScenariosPreparer(ctx context.Context) (*http. preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/apps/usagescenarios")) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1251,7 +1251,7 @@ func (client AppsClient) PackagePublishedApplicationAsGzipPreparer(ctx context.C preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/package/{appId}/slot/{slotName}/gzip", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1324,7 +1324,7 @@ func (client AppsClient) PackageTrainedApplicationAsGzipPreparer(ctx context.Con preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/package/{appId}/versions/{versionId}/gzip", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1398,7 +1398,7 @@ func (client AppsClient) PublishPreparer(ctx context.Context, appID uuid.UUID, a preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/publish", pathParameters), autorest.WithJSON(applicationPublishObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1473,7 +1473,7 @@ func (client AppsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, ap preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}", pathParameters), autorest.WithJSON(applicationUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1548,7 +1548,7 @@ func (client AppsClient) UpdatePublishSettingsPreparer(ctx context.Context, appI preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/publishsettings", pathParameters), autorest.WithJSON(publishSettingUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1623,7 +1623,7 @@ func (client AppsClient) UpdateSettingsPreparer(ctx context.Context, appID uuid. preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/settings", pathParameters), autorest.WithJSON(applicationSettingUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/azureaccounts.go b/services/preview/cognitiveservices/v3.0/luis/authoring/azureaccounts.go index 0839f2f501f3..563d37f5448c 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/azureaccounts.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/azureaccounts.go @@ -96,7 +96,7 @@ func (client AzureAccountsClient) AssignToAppPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/azureaccounts", pathParameters)) if azureAccountInfoObject != nil { preparer = autorest.DecoratePreparer(preparer, @@ -172,7 +172,7 @@ func (client AzureAccountsClient) GetAssignedPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/azureaccounts", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -238,7 +238,7 @@ func (client AzureAccountsClient) ListUserLUISAccountsPreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPath("/azureaccounts")) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -322,7 +322,7 @@ func (client AzureAccountsClient) RemoveFromAppPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/azureaccounts", pathParameters)) if azureAccountInfoObject != nil { preparer = autorest.DecoratePreparer(preparer, diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go b/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go index 8fe2b086e25c..df1b8d3b6dd4 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go @@ -88,7 +88,7 @@ func (client ExamplesClient) AddPreparer(ctx context.Context, appID uuid.UUID, v preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/example", pathParameters), autorest.WithJSON(exampleLabelObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -171,7 +171,7 @@ func (client ExamplesClient) BatchPreparer(ctx context.Context, appID uuid.UUID, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples", pathParameters), autorest.WithJSON(exampleLabelObjectArray)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -248,7 +248,7 @@ func (client ExamplesClient) DeletePreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples/{exampleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -348,7 +348,7 @@ func (client ExamplesClient) ListPreparer(ctx context.Context, appID uuid.UUID, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/features.go b/services/preview/cognitiveservices/v3.0/luis/authoring/features.go index 58c6067d6245..2c33b1fc74e5 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/features.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/features.go @@ -90,7 +90,7 @@ func (client FeaturesClient) AddEntityFeaturePreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/features", pathParameters), autorest.WithJSON(featureRelationCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -169,7 +169,7 @@ func (client FeaturesClient) AddIntentFeaturePreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/features", pathParameters), autorest.WithJSON(featureRelationCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -247,7 +247,7 @@ func (client FeaturesClient) AddPhraseListPreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists", pathParameters), autorest.WithJSON(phraselistCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -324,7 +324,7 @@ func (client FeaturesClient) DeletePhraseListPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -400,7 +400,7 @@ func (client FeaturesClient) GetPhraseListPreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -500,7 +500,7 @@ func (client FeaturesClient) ListPreparer(ctx context.Context, appID uuid.UUID, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/features", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -601,7 +601,7 @@ func (client FeaturesClient) ListPhraseListsPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -682,7 +682,7 @@ func (client FeaturesClient) UpdatePhraseListPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/phraselists/{phraselistId}", pathParameters)) if phraselistUpdateObject != nil { preparer = autorest.DecoratePreparer(preparer, diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/model.go b/services/preview/cognitiveservices/v3.0/luis/authoring/model.go index eebc34e1e621..d9ac8358196b 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/model.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/model.go @@ -88,7 +88,7 @@ func (client ModelClient) AddClosedListPreparer(ctx context.Context, appID uuid. preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists", pathParameters), autorest.WithJSON(closedListModelCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -168,7 +168,7 @@ func (client ModelClient) AddCompositeEntityChildPreparer(ctx context.Context, a preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children", pathParameters), autorest.WithJSON(compositeChildModelCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -246,7 +246,7 @@ func (client ModelClient) AddCustomPrebuiltDomainPreparer(ctx context.Context, a preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltdomains", pathParameters), autorest.WithJSON(prebuiltDomainObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -324,7 +324,7 @@ func (client ModelClient) AddCustomPrebuiltEntityPreparer(ctx context.Context, a preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities", pathParameters), autorest.WithJSON(prebuiltDomainModelCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -402,7 +402,7 @@ func (client ModelClient) AddCustomPrebuiltIntentPreparer(ctx context.Context, a preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltintents", pathParameters), autorest.WithJSON(prebuiltDomainModelCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -479,7 +479,7 @@ func (client ModelClient) AddEntityPreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities", pathParameters), autorest.WithJSON(entityModelCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -558,7 +558,7 @@ func (client ModelClient) AddEntityChildPreparer(ctx context.Context, appID uuid preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/children", pathParameters), autorest.WithJSON(childEntityModelCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -637,7 +637,7 @@ func (client ModelClient) AddExplicitListItemPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist", pathParameters), autorest.WithJSON(item)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -714,7 +714,7 @@ func (client ModelClient) AddIntentPreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents", pathParameters), autorest.WithJSON(intentCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -797,7 +797,7 @@ func (client ModelClient) AddPrebuiltPreparer(ctx context.Context, appID uuid.UU preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts", pathParameters), autorest.WithJSON(prebuiltExtractorNames)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -876,7 +876,7 @@ func (client ModelClient) AddSubListPreparer(ctx context.Context, appID uuid.UUI preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists", pathParameters), autorest.WithJSON(wordListCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -955,7 +955,7 @@ func (client ModelClient) CreateClosedListEntityRolePreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles", pathParameters), autorest.WithJSON(entityRoleCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1034,7 +1034,7 @@ func (client ModelClient) CreateCompositeEntityRolePreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles", pathParameters), autorest.WithJSON(entityRoleCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1113,7 +1113,7 @@ func (client ModelClient) CreateCustomPrebuiltEntityRolePreparer(ctx context.Con preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles", pathParameters), autorest.WithJSON(entityRoleCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1192,7 +1192,7 @@ func (client ModelClient) CreateEntityRolePreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles", pathParameters), autorest.WithJSON(entityRoleCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1271,7 +1271,7 @@ func (client ModelClient) CreateHierarchicalEntityRolePreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles", pathParameters), autorest.WithJSON(entityRoleCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1349,7 +1349,7 @@ func (client ModelClient) CreatePatternAnyEntityModelPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities", pathParameters), autorest.WithJSON(extractorCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1428,7 +1428,7 @@ func (client ModelClient) CreatePatternAnyEntityRolePreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles", pathParameters), autorest.WithJSON(entityRoleCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1507,7 +1507,7 @@ func (client ModelClient) CreatePrebuiltEntityRolePreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles", pathParameters), autorest.WithJSON(entityRoleCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1585,7 +1585,7 @@ func (client ModelClient) CreateRegexEntityModelPreparer(ctx context.Context, ap preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities", pathParameters), autorest.WithJSON(regexEntityExtractorCreateObj)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1664,7 +1664,7 @@ func (client ModelClient) CreateRegexEntityRolePreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles", pathParameters), autorest.WithJSON(entityRoleCreateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -1741,7 +1741,7 @@ func (client ModelClient) DeleteClosedListPreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1819,7 +1819,7 @@ func (client ModelClient) DeleteClosedListEntityRolePreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1895,7 +1895,7 @@ func (client ModelClient) DeleteCompositeEntityPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1973,7 +1973,7 @@ func (client ModelClient) DeleteCompositeEntityChildPreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children/{cChildId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2051,7 +2051,7 @@ func (client ModelClient) DeleteCompositeEntityRolePreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2129,7 +2129,7 @@ func (client ModelClient) DeleteCustomEntityRolePreparer(ctx context.Context, ap preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2205,7 +2205,7 @@ func (client ModelClient) DeleteCustomPrebuiltDomainPreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2281,7 +2281,7 @@ func (client ModelClient) DeleteEntityPreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2360,7 +2360,7 @@ func (client ModelClient) DeleteEntityFeaturePreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/features", pathParameters), autorest.WithJSON(featureRelationDeleteObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -2439,7 +2439,7 @@ func (client ModelClient) DeleteEntityRolePreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2517,7 +2517,7 @@ func (client ModelClient) DeleteExplicitListItemPreparer(ctx context.Context, ap preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2593,7 +2593,7 @@ func (client ModelClient) DeleteHierarchicalEntityPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2671,7 +2671,7 @@ func (client ModelClient) DeleteHierarchicalEntityChildPreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2749,7 +2749,7 @@ func (client ModelClient) DeleteHierarchicalEntityRolePreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -2834,7 +2834,7 @@ func (client ModelClient) DeleteIntentPreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -2914,7 +2914,7 @@ func (client ModelClient) DeleteIntentFeaturePreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/features", pathParameters), autorest.WithJSON(featureRelationDeleteObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -2991,7 +2991,7 @@ func (client ModelClient) DeletePatternAnyEntityModelPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3069,7 +3069,7 @@ func (client ModelClient) DeletePatternAnyEntityRolePreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3145,7 +3145,7 @@ func (client ModelClient) DeletePrebuiltPreparer(ctx context.Context, appID uuid preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3223,7 +3223,7 @@ func (client ModelClient) DeletePrebuiltEntityRolePreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3299,7 +3299,7 @@ func (client ModelClient) DeleteRegexEntityModelPreparer(ctx context.Context, ap preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3377,7 +3377,7 @@ func (client ModelClient) DeleteRegexEntityRolePreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3455,7 +3455,7 @@ func (client ModelClient) DeleteSubListPreparer(ctx context.Context, appID uuid. preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3557,7 +3557,7 @@ func (client ModelClient) ExamplesMethodPreparer(ctx context.Context, appID uuid preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/models/{modelId}/examples", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -3634,7 +3634,7 @@ func (client ModelClient) GetClosedListPreparer(ctx context.Context, appID uuid. preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3712,7 +3712,7 @@ func (client ModelClient) GetClosedListEntityRolePreparer(ctx context.Context, a preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3788,7 +3788,7 @@ func (client ModelClient) GetCompositeEntityPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3866,7 +3866,7 @@ func (client ModelClient) GetCompositeEntityRolePreparer(ctx context.Context, ap preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -3944,7 +3944,7 @@ func (client ModelClient) GetCustomEntityRolePreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4020,7 +4020,7 @@ func (client ModelClient) GetEntityPreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4096,7 +4096,7 @@ func (client ModelClient) GetEntityFeaturesPreparer(ctx context.Context, appID u preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/features", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4174,7 +4174,7 @@ func (client ModelClient) GetEntityRolePreparer(ctx context.Context, appID uuid. preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4250,7 +4250,7 @@ func (client ModelClient) GetExplicitListPreparer(ctx context.Context, appID uui preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4328,7 +4328,7 @@ func (client ModelClient) GetExplicitListItemPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4404,7 +4404,7 @@ func (client ModelClient) GetHierarchicalEntityPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4483,7 +4483,7 @@ func (client ModelClient) GetHierarchicalEntityChildPreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4561,7 +4561,7 @@ func (client ModelClient) GetHierarchicalEntityRolePreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4637,7 +4637,7 @@ func (client ModelClient) GetIntentPreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4713,7 +4713,7 @@ func (client ModelClient) GetIntentFeaturesPreparer(ctx context.Context, appID u preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/features", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4789,7 +4789,7 @@ func (client ModelClient) GetPatternAnyEntityInfoPreparer(ctx context.Context, a preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4867,7 +4867,7 @@ func (client ModelClient) GetPatternAnyEntityRolePreparer(ctx context.Context, a preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -4943,7 +4943,7 @@ func (client ModelClient) GetPrebuiltPreparer(ctx context.Context, appID uuid.UU preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5021,7 +5021,7 @@ func (client ModelClient) GetPrebuiltEntityRolePreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5097,7 +5097,7 @@ func (client ModelClient) GetRegexEntityEntityInfoPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5175,7 +5175,7 @@ func (client ModelClient) GetRegexEntityRolePreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5251,7 +5251,7 @@ func (client ModelClient) ListClosedListEntityRolesPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5351,7 +5351,7 @@ func (client ModelClient) ListClosedListsPreparer(ctx context.Context, appID uui preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -5452,7 +5452,7 @@ func (client ModelClient) ListCompositeEntitiesPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -5529,7 +5529,7 @@ func (client ModelClient) ListCompositeEntityRolesPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5603,7 +5603,7 @@ func (client ModelClient) ListCustomPrebuiltEntitiesPreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5679,7 +5679,7 @@ func (client ModelClient) ListCustomPrebuiltEntityRolesPreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5754,7 +5754,7 @@ func (client ModelClient) ListCustomPrebuiltIntentsPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltintents", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5829,7 +5829,7 @@ func (client ModelClient) ListCustomPrebuiltModelsPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltmodels", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -5929,7 +5929,7 @@ func (client ModelClient) ListEntitiesPreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -6006,7 +6006,7 @@ func (client ModelClient) ListEntityRolesPreparer(ctx context.Context, appID uui preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -6100,7 +6100,7 @@ func (client ModelClient) ListEntitySuggestionsPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/suggest", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -6201,7 +6201,7 @@ func (client ModelClient) ListHierarchicalEntitiesPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -6278,7 +6278,7 @@ func (client ModelClient) ListHierarchicalEntityRolesPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -6378,7 +6378,7 @@ func (client ModelClient) ListIntentsPreparer(ctx context.Context, appID uuid.UU preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -6473,7 +6473,7 @@ func (client ModelClient) ListIntentSuggestionsPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/suggest", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -6574,7 +6574,7 @@ func (client ModelClient) ListModelsPreparer(ctx context.Context, appID uuid.UUI preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/models", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -6675,7 +6675,7 @@ func (client ModelClient) ListPatternAnyEntityInfosPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -6752,7 +6752,7 @@ func (client ModelClient) ListPatternAnyEntityRolesPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -6826,7 +6826,7 @@ func (client ModelClient) ListPrebuiltEntitiesPreparer(ctx context.Context, appI preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/listprebuilts", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -6902,7 +6902,7 @@ func (client ModelClient) ListPrebuiltEntityRolesPreparer(ctx context.Context, a preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -7002,7 +7002,7 @@ func (client ModelClient) ListPrebuiltsPreparer(ctx context.Context, appID uuid. preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7103,7 +7103,7 @@ func (client ModelClient) ListRegexEntityInfosPreparer(ctx context.Context, appI preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7180,7 +7180,7 @@ func (client ModelClient) ListRegexEntityRolesPreparer(ctx context.Context, appI preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -7258,7 +7258,7 @@ func (client ModelClient) PatchClosedListPreparer(ctx context.Context, appID uui preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters), autorest.WithJSON(closedListModelPatchObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7343,7 +7343,7 @@ func (client ModelClient) ReplaceEntityFeaturesPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/features", pathParameters), autorest.WithJSON(featureRelationsUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7428,7 +7428,7 @@ func (client ModelClient) ReplaceIntentFeaturesPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/features", pathParameters), autorest.WithJSON(featureRelationsUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7507,7 +7507,7 @@ func (client ModelClient) UpdateClosedListPreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}", pathParameters), autorest.WithJSON(closedListModelUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7588,7 +7588,7 @@ func (client ModelClient) UpdateClosedListEntityRolePreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}", pathParameters), autorest.WithJSON(entityRoleUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7667,7 +7667,7 @@ func (client ModelClient) UpdateCompositeEntityPreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}", pathParameters), autorest.WithJSON(compositeModelUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7748,7 +7748,7 @@ func (client ModelClient) UpdateCompositeEntityRolePreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}", pathParameters), autorest.WithJSON(entityRoleUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7829,7 +7829,7 @@ func (client ModelClient) UpdateCustomPrebuiltEntityRolePreparer(ctx context.Con preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}", pathParameters), autorest.WithJSON(entityRoleUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7910,7 +7910,7 @@ func (client ModelClient) UpdateEntityChildPreparer(ctx context.Context, appID u preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}", pathParameters), autorest.WithJSON(entityModelUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -7991,7 +7991,7 @@ func (client ModelClient) UpdateEntityRolePreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}", pathParameters), autorest.WithJSON(entityRoleUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8072,7 +8072,7 @@ func (client ModelClient) UpdateExplicitListItemPreparer(ctx context.Context, ap preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}", pathParameters), autorest.WithJSON(item)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8151,7 +8151,7 @@ func (client ModelClient) UpdateHierarchicalEntityPreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}", pathParameters), autorest.WithJSON(modelUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8233,7 +8233,7 @@ func (client ModelClient) UpdateHierarchicalEntityChildPreparer(ctx context.Cont preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}", pathParameters), autorest.WithJSON(hierarchicalChildModelUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8314,7 +8314,7 @@ func (client ModelClient) UpdateHierarchicalEntityRolePreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}", pathParameters), autorest.WithJSON(entityRoleUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8393,7 +8393,7 @@ func (client ModelClient) UpdateIntentPreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}", pathParameters), autorest.WithJSON(modelUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8472,7 +8472,7 @@ func (client ModelClient) UpdatePatternAnyEntityModelPreparer(ctx context.Contex preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}", pathParameters), autorest.WithJSON(patternAnyUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8553,7 +8553,7 @@ func (client ModelClient) UpdatePatternAnyEntityRolePreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}", pathParameters), autorest.WithJSON(entityRoleUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8634,7 +8634,7 @@ func (client ModelClient) UpdatePrebuiltEntityRolePreparer(ctx context.Context, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}", pathParameters), autorest.WithJSON(entityRoleUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8713,7 +8713,7 @@ func (client ModelClient) UpdateRegexEntityModelPreparer(ctx context.Context, ap preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}", pathParameters), autorest.WithJSON(regexEntityUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8794,7 +8794,7 @@ func (client ModelClient) UpdateRegexEntityRolePreparer(ctx context.Context, app preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}", pathParameters), autorest.WithJSON(entityRoleUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -8875,7 +8875,7 @@ func (client ModelClient) UpdateSubListPreparer(ctx context.Context, appID uuid. preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}", pathParameters), autorest.WithJSON(wordListBaseUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/models.go b/services/preview/cognitiveservices/v3.0/luis/authoring/models.go index 64d7ab0da5b2..2c184abc02cc 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/models.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/models.go @@ -1033,10 +1033,11 @@ type HierarchicalEntityExtractor struct { // HierarchicalModel ... type HierarchicalModel struct { - Name *string `json:"name,omitempty"` - Children *[]string `json:"children,omitempty"` - Inherits *PrebuiltDomainObject `json:"inherits,omitempty"` - Roles *[]string `json:"roles,omitempty"` + Name *string `json:"name,omitempty"` + Children *[]JSONChild `json:"children,omitempty"` + Features *[]JSONModelFeatureInformation `json:"features,omitempty"` + Roles *[]string `json:"roles,omitempty"` + Inherits *PrebuiltDomainObject `json:"inherits,omitempty"` } // Int32 ... @@ -1088,6 +1089,14 @@ type IntentsSuggestionExample struct { EntityPredictions *[]EntityPrediction `json:"entityPredictions,omitempty"` } +// JSONChild ... +type JSONChild struct { + Name *string `json:"name,omitempty"` + InstanceOf *string `json:"instanceOf,omitempty"` + Children *[]JSONChild `json:"children,omitempty"` + Features *[]JSONModelFeatureInformation `json:"features,omitempty"` +} + // JSONEntity exported Model - Extracted Entity from utterance. type JSONEntity struct { // StartPos - The index within the utterance where the extracted entity starts. @@ -1110,6 +1119,17 @@ type JSONModelFeature struct { Words *string `json:"words,omitempty"` // Mode - An interchangeable phrase list feature serves as a list of synonyms for training. A non-exchangeable phrase list serves as separate features for training. So, if your non-interchangeable phrase list contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-interchangeable phrase list as an additional bag of words to add to LUIS existing vocabulary features. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Default value is true. Mode *bool `json:"mode,omitempty"` + // EnabledForAllModels - Indicates if the Phraselist is enabled for all models in the application. + EnabledForAllModels *bool `json:"enabledForAllModels,omitempty"` +} + +// JSONModelFeatureInformation an object containing the model feature information either the model name or +// feature name. +type JSONModelFeatureInformation struct { + // ModelName - The name of the model used. + ModelName *string `json:"modelName,omitempty"` + // FeatureName - The name of the feature used. + FeatureName *string `json:"featureName,omitempty"` } // JSONRegexFeature exported Model - A Pattern feature. @@ -1374,6 +1394,8 @@ type LuisApp struct { ClosedLists *[]ClosedList `json:"closedLists,omitempty"` // Composites - List of composite entities. Composites *[]HierarchicalModel `json:"composites,omitempty"` + // Hierarchicals - List of hierarchical entities. + Hierarchicals *[]HierarchicalModel `json:"hierarchicals,omitempty"` // PatternAnyEntities - List of Pattern.Any entities. PatternAnyEntities *[]PatternAny `json:"patternAnyEntities,omitempty"` // RegexEntities - List of regular expression entities. @@ -1382,8 +1404,8 @@ type LuisApp struct { PrebuiltEntities *[]PrebuiltEntity `json:"prebuiltEntities,omitempty"` // RegexFeatures - List of pattern features. RegexFeatures *[]JSONRegexFeature `json:"regex_features,omitempty"` - // ModelFeatures - List of model features. - ModelFeatures *[]JSONModelFeature `json:"model_features,omitempty"` + // Phraselists - List of model features. + Phraselists *[]JSONModelFeature `json:"phraselists,omitempty"` // Patterns - List of patterns. Patterns *[]PatternRule `json:"patterns,omitempty"` // Utterances - List of example utterances. @@ -1417,6 +1439,9 @@ func (la LuisApp) MarshalJSON() ([]byte, error) { if la.Composites != nil { objectMap["composites"] = la.Composites } + if la.Hierarchicals != nil { + objectMap["hierarchicals"] = la.Hierarchicals + } if la.PatternAnyEntities != nil { objectMap["patternAnyEntities"] = la.PatternAnyEntities } @@ -1429,8 +1454,8 @@ func (la LuisApp) MarshalJSON() ([]byte, error) { if la.RegexFeatures != nil { objectMap["regex_features"] = la.RegexFeatures } - if la.ModelFeatures != nil { - objectMap["model_features"] = la.ModelFeatures + if la.Phraselists != nil { + objectMap["phraselists"] = la.Phraselists } if la.Patterns != nil { objectMap["patterns"] = la.Patterns @@ -1537,6 +1562,15 @@ func (la *LuisApp) UnmarshalJSON(body []byte) error { } la.Composites = &composites } + case "hierarchicals": + if v != nil { + var hierarchicals []HierarchicalModel + err = json.Unmarshal(*v, &hierarchicals) + if err != nil { + return err + } + la.Hierarchicals = &hierarchicals + } case "patternAnyEntities": if v != nil { var patternAnyEntities []PatternAny @@ -1573,14 +1607,14 @@ func (la *LuisApp) UnmarshalJSON(body []byte) error { } la.RegexFeatures = ®exFeatures } - case "model_features": + case "phraselists": if v != nil { - var modelFeatures []JSONModelFeature - err = json.Unmarshal(*v, &modelFeatures) + var phraselists []JSONModelFeature + err = json.Unmarshal(*v, &phraselists) if err != nil { return err } - la.ModelFeatures = &modelFeatures + la.Phraselists = &phraselists } case "patterns": if v != nil { @@ -1835,6 +1869,8 @@ type PhraselistCreateObject struct { Name *string `json:"name,omitempty"` // IsExchangeable - An interchangeable phrase list feature serves as a list of synonyms for training. A non-exchangeable phrase list serves as separate features for training. So, if your non-interchangeable phrase list contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-interchangeable phrase list as an additional bag of words to add to LUIS existing vocabulary features. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Default value is true. IsExchangeable *bool `json:"isExchangeable,omitempty"` + // EnabledForAllModels - Indicates if the Phraselist is enabled for all models in the application. + EnabledForAllModels *bool `json:"enabledForAllModels,omitempty"` } // PhraseListFeatureInfo phraselist Feature. diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/pattern.go b/services/preview/cognitiveservices/v3.0/luis/authoring/pattern.go index d827805145dc..bf4dd03ad6db 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/pattern.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/pattern.go @@ -88,7 +88,7 @@ func (client PatternClient) AddPatternPreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrule", pathParameters), autorest.WithJSON(pattern)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -171,7 +171,7 @@ func (client PatternClient) BatchAddPatternsPreparer(ctx context.Context, appID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), autorest.WithJSON(patterns)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -248,7 +248,7 @@ func (client PatternClient) DeletePatternPreparer(ctx context.Context, appID uui preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules/{patternId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -330,7 +330,7 @@ func (client PatternClient) DeletePatternsPreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), autorest.WithJSON(patternIds)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -433,7 +433,7 @@ func (client PatternClient) ListIntentPatternsPreparer(ctx context.Context, appI preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/intents/{intentId}/patternrules", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -534,7 +534,7 @@ func (client PatternClient) ListPatternsPreparer(ctx context.Context, appID uuid preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -613,7 +613,7 @@ func (client PatternClient) UpdatePatternPreparer(ctx context.Context, appID uui preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules/{patternId}", pathParameters), autorest.WithJSON(pattern)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -696,7 +696,7 @@ func (client PatternClient) UpdatePatternsPreparer(ctx context.Context, appID uu preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/patternrules", pathParameters), autorest.WithJSON(patterns)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go b/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go index f502cfb640e0..a55c0c538b0e 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go @@ -86,7 +86,7 @@ func (client PermissionsClient) AddPreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), autorest.WithJSON(userToAdd)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -162,7 +162,7 @@ func (client PermissionsClient) DeletePreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), autorest.WithJSON(userToDelete)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -235,7 +235,7 @@ func (client PermissionsClient) ListPreparer(ctx context.Context, appID uuid.UUI preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -310,7 +310,7 @@ func (client PermissionsClient) UpdatePreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), autorest.WithJSON(collaborators)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/settings.go b/services/preview/cognitiveservices/v3.0/luis/authoring/settings.go index f5a254b06f0b..e0f0139c72ae 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/settings.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/settings.go @@ -86,7 +86,7 @@ func (client SettingsClient) ListPreparer(ctx context.Context, appID uuid.UUID, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/settings", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -168,7 +168,7 @@ func (client SettingsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/settings", pathParameters), autorest.WithJSON(listOfAppVersionSettingObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/train.go b/services/preview/cognitiveservices/v3.0/luis/authoring/train.go index aaba41df3efc..b2058fae50c9 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/train.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/train.go @@ -87,7 +87,7 @@ func (client TrainClient) GetStatusPreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/train", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -165,7 +165,7 @@ func (client TrainClient) TrainVersionPreparer(ctx context.Context, appID uuid.U preparer := autorest.CreatePreparer( autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/train", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/versions.go b/services/preview/cognitiveservices/v3.0/luis/authoring/versions.go index bfb400e04767..51df6b99edf3 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/versions.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/versions.go @@ -88,7 +88,7 @@ func (client VersionsClient) ClonePreparer(ctx context.Context, appID uuid.UUID, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/clone", pathParameters), autorest.WithJSON(versionCloneObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -163,7 +163,7 @@ func (client VersionsClient) DeletePreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -239,7 +239,7 @@ func (client VersionsClient) DeleteUnlabelledUtterancePreparer(ctx context.Conte preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/suggest", pathParameters), autorest.WithJSON(utterance)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -314,7 +314,7 @@ func (client VersionsClient) ExportPreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/export", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -389,7 +389,7 @@ func (client VersionsClient) GetPreparer(ctx context.Context, appID uuid.UUID, v preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -470,7 +470,7 @@ func (client VersionsClient) ImportPreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/import", pathParameters), autorest.WithJSON(luisApp), autorest.WithQueryParameters(queryParameters)) @@ -570,7 +570,7 @@ func (client VersionsClient) ListPreparer(ctx context.Context, appID uuid.UUID, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -647,7 +647,7 @@ func (client VersionsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/api/v3.0-preview", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/", pathParameters), autorest.WithJSON(versionUpdateObject)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/cassandraresources.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/cassandraresources.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/cassandraresources.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/cassandraresources.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/client.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/client.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/client.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/client.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/collection.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/collection.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/collection.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/collection.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartition.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartition.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartition.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartition.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartitionregion.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartitionregion.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartitionregion.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionpartitionregion.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionregion.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionregion.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionregion.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/collectionregion.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/database.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/database.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/database.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/database.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccountregion.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccountregion.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccountregion.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccountregion.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccounts.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccounts.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccounts.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/databaseaccounts.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/documentdbapi/interfaces.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/documentdbapi/interfaces.go similarity index 99% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/documentdbapi/interfaces.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/documentdbapi/interfaces.go index 8fa50a0a843b..b51f2fa91d3c 100644 --- a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/documentdbapi/interfaces.go +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/documentdbapi/interfaces.go @@ -19,7 +19,7 @@ package documentdbapi import ( "context" - "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2019-08-01-preview/documentdb" + "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb" "github.com/Azure/go-autorest/autorest" ) diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/gremlinresources.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/gremlinresources.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/gremlinresources.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/gremlinresources.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/models.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/models.go similarity index 99% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/models.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/models.go index 39ca07464269..8616d54012c8 100644 --- a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/models.go +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/models.go @@ -29,7 +29,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2019-08-01-preview/documentdb" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb" // ConflictResolutionMode enumerates the values for conflict resolution mode. type ConflictResolutionMode string diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/mongodbresources.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/mongodbresources.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/mongodbresources.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/mongodbresources.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/operations.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/operations.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/operations.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/operations.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeid.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeid.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeid.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeid.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeidregion.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeidregion.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeidregion.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/partitionkeyrangeidregion.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentile.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentile.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentile.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentile.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentilesourcetarget.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentilesourcetarget.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentilesourcetarget.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentilesourcetarget.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentiletarget.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentiletarget.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentiletarget.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/percentiletarget.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privateendpointconnections.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/sqlresources.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/sqlresources.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/sqlresources.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/sqlresources.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/tableresources.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/tableresources.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/tableresources.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/tableresources.go diff --git a/services/cosmos-db/mgmt/2019-08-01-preview/documentdb/version.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/version.go similarity index 100% rename from services/cosmos-db/mgmt/2019-08-01-preview/documentdb/version.go rename to services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/version.go diff --git a/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/models.go b/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/models.go index de3e9d7519b2..edb7e01634df 100644 --- a/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/models.go +++ b/services/preview/hanaonazure/mgmt/2017-11-03-preview/hanaonazure/models.go @@ -72,6 +72,8 @@ func PossibleHanaInstancePowerStateEnumValues() []HanaInstancePowerStateEnum { type HanaInstanceSizeNamesEnum string const ( + // S112 ... + S112 HanaInstanceSizeNamesEnum = "S112" // S144 ... S144 HanaInstanceSizeNamesEnum = "S144" // S144m ... @@ -88,6 +90,12 @@ const ( S224o HanaInstanceSizeNamesEnum = "S224o" // S224om ... S224om HanaInstanceSizeNamesEnum = "S224om" + // S224oo ... + S224oo HanaInstanceSizeNamesEnum = "S224oo" + // S224oom ... + S224oom HanaInstanceSizeNamesEnum = "S224oom" + // S224ooo ... + S224ooo HanaInstanceSizeNamesEnum = "S224ooo" // S224oxm ... S224oxm HanaInstanceSizeNamesEnum = "S224oxm" // S224oxxm ... @@ -122,7 +130,7 @@ const ( // PossibleHanaInstanceSizeNamesEnumValues returns an array of possible values for the HanaInstanceSizeNamesEnum const type. func PossibleHanaInstanceSizeNamesEnumValues() []HanaInstanceSizeNamesEnum { - return []HanaInstanceSizeNamesEnum{S144, S144m, S192, S192m, S192xm, S224m, S224o, S224om, S224oxm, S224oxxm, S384, S384m, S384xm, S384xxm, S576m, S576xm, S72, S72m, S768, S768m, S768xm, S96, S960m} + return []HanaInstanceSizeNamesEnum{S112, S144, S144m, S192, S192m, S192xm, S224m, S224o, S224om, S224oo, S224oom, S224ooo, S224oxm, S224oxxm, S384, S384m, S384xm, S384xxm, S576m, S576xm, S72, S72m, S768, S768m, S768xm, S96, S960m} } // HanaProvisioningStatesEnum enumerates the values for hana provisioning states enum. @@ -575,7 +583,7 @@ func (future *HanaInstancesStartFuture) Result(client HanaInstancesClient) (ar a type HardwareProfile struct { // HardwareType - READ-ONLY; Name of the hardware type (vendor and/or their product name). Possible values include: 'CiscoUCS', 'HPE' HardwareType HanaHardwareTypeNamesEnum `json:"hardwareType,omitempty"` - // HanaInstanceSize - READ-ONLY; Specifies the HANA instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S192xm', 'S96', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m', 'S224o', 'S224m', 'S224om', 'S224oxm', 'S224oxxm' + // HanaInstanceSize - READ-ONLY; Specifies the HANA instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S192xm', 'S96', 'S112', 'S224m', 'S224o', 'S224om', 'S224oo', 'S224oom', 'S224ooo', 'S224oxm', 'S224oxxm', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m' HanaInstanceSize HanaInstanceSizeNamesEnum `json:"hanaInstanceSize,omitempty"` } diff --git a/services/preview/resources/mgmt/2019-11-01/managementgroups/client.go b/services/preview/resources/mgmt/2019-11-01/managementgroups/client.go new file mode 100644 index 000000000000..5be449ad0697 --- /dev/null +++ b/services/preview/resources/mgmt/2019-11-01/managementgroups/client.go @@ -0,0 +1,262 @@ +// Package managementgroups implements the Azure ARM Managementgroups service API version 2019-11-01. +// +// The Azure Management Groups API enables consolidation of multiple subscriptions/resources into an organizational +// hierarchy and centrally manage access control, policies, alerting and reporting for those resources. +package managementgroups + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Managementgroups + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Managementgroups. +type BaseClient struct { + autorest.Client + BaseURI string +} + +// New creates an instance of the BaseClient client. +func New() BaseClient { + return NewWithBaseURI(DefaultBaseURI) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + } +} + +// CheckNameAvailability checks if the specified management group name is valid and unique +// Parameters: +// checkNameAvailabilityRequest - management group name availability check parameters. +func (client BaseClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityRequest CheckNameAvailabilityRequest) (result CheckNameAvailabilityResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckNameAvailabilityPreparer(ctx, checkNameAvailabilityRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client BaseClient) CheckNameAvailabilityPreparer(ctx context.Context, checkNameAvailabilityRequest CheckNameAvailabilityRequest) (*http.Request, error) { + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Management/checkNameAvailability"), + autorest.WithJSON(checkNameAvailabilityRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// StartTenantBackfill starts backfilling subscriptions for the Tenant. +func (client BaseClient) StartTenantBackfill(ctx context.Context) (result TenantBackfillStatusResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartTenantBackfill") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartTenantBackfillPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "StartTenantBackfill", nil, "Failure preparing request") + return + } + + resp, err := client.StartTenantBackfillSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "StartTenantBackfill", resp, "Failure sending request") + return + } + + result, err = client.StartTenantBackfillResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "StartTenantBackfill", resp, "Failure responding to request") + } + + return +} + +// StartTenantBackfillPreparer prepares the StartTenantBackfill request. +func (client BaseClient) StartTenantBackfillPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Management/startTenantBackfill"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartTenantBackfillSender sends the StartTenantBackfill request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) StartTenantBackfillSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// StartTenantBackfillResponder handles the response to the StartTenantBackfill request. The method always +// closes the http.Response Body. +func (client BaseClient) StartTenantBackfillResponder(resp *http.Response) (result TenantBackfillStatusResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TenantBackfillStatus gets tenant backfill status +func (client BaseClient) TenantBackfillStatus(ctx context.Context) (result TenantBackfillStatusResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.TenantBackfillStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TenantBackfillStatusPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "TenantBackfillStatus", nil, "Failure preparing request") + return + } + + resp, err := client.TenantBackfillStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "TenantBackfillStatus", resp, "Failure sending request") + return + } + + result, err = client.TenantBackfillStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.BaseClient", "TenantBackfillStatus", resp, "Failure responding to request") + } + + return +} + +// TenantBackfillStatusPreparer prepares the TenantBackfillStatus request. +func (client BaseClient) TenantBackfillStatusPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Management/tenantBackfillStatus"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TenantBackfillStatusSender sends the TenantBackfillStatus request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) TenantBackfillStatusSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// TenantBackfillStatusResponder handles the response to the TenantBackfillStatus request. The method always +// closes the http.Response Body. +func (client BaseClient) TenantBackfillStatusResponder(resp *http.Response) (result TenantBackfillStatusResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/resources/mgmt/2019-11-01/managementgroups/entities.go b/services/preview/resources/mgmt/2019-11-01/managementgroups/entities.go new file mode 100644 index 000000000000..3e896423ea6d --- /dev/null +++ b/services/preview/resources/mgmt/2019-11-01/managementgroups/entities.go @@ -0,0 +1,210 @@ +package managementgroups + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// EntitiesClient is the the Azure Management Groups API enables consolidation of multiple subscriptions/resources into +// an organizational hierarchy and centrally manage access control, policies, alerting and reporting for those +// resources. +type EntitiesClient struct { + BaseClient +} + +// NewEntitiesClient creates an instance of the EntitiesClient client. +func NewEntitiesClient() EntitiesClient { + return NewEntitiesClientWithBaseURI(DefaultBaseURI) +} + +// NewEntitiesClientWithBaseURI creates an instance of the EntitiesClient client. +func NewEntitiesClientWithBaseURI(baseURI string) EntitiesClient { + return EntitiesClient{NewWithBaseURI(baseURI)} +} + +// List list all entities (Management Groups, Subscriptions, etc.) for the authenticated user. +// Parameters: +// skiptoken - page continuation token is only used if a previous operation returned a partial result. If a +// previous response contains a nextLink element, the value of the nextLink element will include a token +// parameter that specifies a starting point to use for subsequent calls. +// skip - number of entities to skip over when retrieving results. Passing this in will override $skipToken. +// top - number of elements to return when retrieving results. Passing this in will override $skipToken. +// selectParameter - this parameter specifies the fields to include in the response. Can include any +// combination of Name,DisplayName,Type,ParentDisplayNameChain,ParentChain, e.g. +// '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. When specified the $select parameter +// can override select in $skipToken. +// search - the $search parameter is used in conjunction with the $filter parameter to return three different +// outputs depending on the parameter passed in. With $search=AllowedParents the API will return the entity +// info of all groups that the requested entity will be able to reparent to as determined by the user's +// permissions.With $search=AllowedChildren the API will return the entity info of all entities that can be +// added as children of the requested entity.With $search=ParentAndFirstLevelChildren the API will return the +// parent and first level of children that the user has either direct access to or indirect access via one of +// their descendants.With $search=ParentOnly the API will return only the group if the user has access to at +// least one of the descendants of the group.With $search=ChildrenOnly the API will return only the first level +// of children of the group entity info specified in $filter. The user must have direct access to the children +// entities or one of it's descendants for it to show up in the results. +// filter - the filter parameter allows you to filter on the the name or display name fields. You can check for +// equality on the name field (e.g. name eq '{entityName}') and you can check for substrings on either the +// name or display name fields(e.g. contains(name, '{substringToSearch}'), contains(displayName, +// '{substringToSearch')). Note that the '{entityName}' and '{substringToSearch}' fields are checked case +// insensitively. +// view - the view parameter allows clients to filter the type of data that is returned by the getEntities +// call. +// groupName - a filter which allows the get entities call to focus on a particular group (i.e. "$filter=name +// eq 'groupName'") +// cacheControl - indicates that the request shouldn't utilize any caches. +func (client EntitiesClient) List(ctx context.Context, skiptoken string, skip *int32, top *int32, selectParameter string, search string, filter string, view string, groupName string, cacheControl string) (result EntityListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EntitiesClient.List") + defer func() { + sc := -1 + if result.elr.Response.Response != nil { + sc = result.elr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, skiptoken, skip, top, selectParameter, search, filter, view, groupName, cacheControl) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.EntitiesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.elr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.EntitiesClient", "List", resp, "Failure sending request") + return + } + + result.elr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.EntitiesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client EntitiesClient) ListPreparer(ctx context.Context, skiptoken string, skip *int32, top *int32, selectParameter string, search string, filter string, view string, groupName string, cacheControl string) (*http.Request, error) { + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if len(string(search)) > 0 { + queryParameters["$search"] = autorest.Encode("query", search) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(string(view)) > 0 { + queryParameters["$view"] = autorest.Encode("query", view) + } + if len(groupName) > 0 { + queryParameters["groupName"] = autorest.Encode("query", groupName) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Management/getEntities"), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } else { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String("no-cache"))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client EntitiesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client EntitiesClient) ListResponder(resp *http.Response) (result EntityListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client EntitiesClient) listNextResults(ctx context.Context, lastResults EntityListResult) (result EntityListResult, err error) { + req, err := lastResults.entityListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "managementgroups.EntitiesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "managementgroups.EntitiesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.EntitiesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client EntitiesClient) ListComplete(ctx context.Context, skiptoken string, skip *int32, top *int32, selectParameter string, search string, filter string, view string, groupName string, cacheControl string) (result EntityListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EntitiesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, skiptoken, skip, top, selectParameter, search, filter, view, groupName, cacheControl) + return +} diff --git a/services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroups.go b/services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroups.go new file mode 100644 index 000000000000..627a1a0ff13a --- /dev/null +++ b/services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroups.go @@ -0,0 +1,637 @@ +package managementgroups + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// Client is the the Azure Management Groups API enables consolidation of multiple subscriptions/resources into an +// organizational hierarchy and centrally manage access control, policies, alerting and reporting for those resources. +type Client struct { + BaseClient +} + +// NewClient creates an instance of the Client client. +func NewClient() Client { + return NewClientWithBaseURI(DefaultBaseURI) +} + +// NewClientWithBaseURI creates an instance of the Client client. +func NewClientWithBaseURI(baseURI string) Client { + return Client{NewWithBaseURI(baseURI)} +} + +// CreateOrUpdate create or update a management group. If a management group is already created and a subsequent create +// request is issued with different properties, the management group properties will be updated. +// Parameters: +// groupID - management Group ID. +// createManagementGroupRequest - management group creation parameters. +// cacheControl - indicates that the request shouldn't utilize any caches. +func (client Client) CreateOrUpdate(ctx context.Context, groupID string, createManagementGroupRequest CreateManagementGroupRequest, cacheControl string) (result CreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, groupID, createManagementGroupRequest, cacheControl) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client Client) CreateOrUpdatePreparer(ctx context.Context, groupID string, createManagementGroupRequest CreateManagementGroupRequest, cacheControl string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + createManagementGroupRequest.ID = nil + createManagementGroupRequest.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{groupId}", pathParameters), + autorest.WithJSON(createManagementGroupRequest), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } else { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String("no-cache"))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client Client) CreateOrUpdateResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete management group. If a management group contains child resources, the request will fail. +// Parameters: +// groupID - management Group ID. +// cacheControl - indicates that the request shouldn't utilize any caches. +func (client Client) Delete(ctx context.Context, groupID string, cacheControl string) (result DeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, groupID, cacheControl) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client Client) DeletePreparer(ctx context.Context, groupID string, cacheControl string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } else { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String("no-cache"))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client Client) DeleteResponder(resp *http.Response) (result OperationResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the details of the management group. +// Parameters: +// groupID - management Group ID. +// expand - the $expand=children query string parameter allows clients to request inclusion of children in the +// response payload. $expand=path includes the path from the root group to the current group. +// recurse - the $recurse=true query string parameter allows clients to request inclusion of entire hierarchy +// in the response payload. Note that $expand=children must be passed up if $recurse is set to true. +// filter - a filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType +// ne Subscription') +// cacheControl - indicates that the request shouldn't utilize any caches. +func (client Client) Get(ctx context.Context, groupID string, expand string, recurse *bool, filter string, cacheControl string) (result ManagementGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, groupID, expand, recurse, filter, cacheControl) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.Client", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client Client) GetPreparer(ctx context.Context, groupID string, expand string, recurse *bool, filter string, cacheControl string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if recurse != nil { + queryParameters["$recurse"] = autorest.Encode("query", *recurse) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } else { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String("no-cache"))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client Client) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client Client) GetResponder(resp *http.Response) (result ManagementGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDescendants list all entities that descend from a management group. +// Parameters: +// groupID - management Group ID. +// skiptoken - page continuation token is only used if a previous operation returned a partial result. If a +// previous response contains a nextLink element, the value of the nextLink element will include a token +// parameter that specifies a starting point to use for subsequent calls. +// top - number of elements to return when retrieving results. Passing this in will override $skipToken. +func (client Client) GetDescendants(ctx context.Context, groupID string, skiptoken string, top *int32) (result DescendantListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetDescendants") + defer func() { + sc := -1 + if result.dlr.Response.Response != nil { + sc = result.dlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getDescendantsNextResults + req, err := client.GetDescendantsPreparer(ctx, groupID, skiptoken, top) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "GetDescendants", nil, "Failure preparing request") + return + } + + resp, err := client.GetDescendantsSender(req) + if err != nil { + result.dlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.Client", "GetDescendants", resp, "Failure sending request") + return + } + + result.dlr, err = client.GetDescendantsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "GetDescendants", resp, "Failure responding to request") + } + + return +} + +// GetDescendantsPreparer prepares the GetDescendants request. +func (client Client) GetDescendantsPreparer(ctx context.Context, groupID string, skiptoken string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{groupId}/descendants", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDescendantsSender sends the GetDescendants request. The method will close the +// http.Response Body if it receives an error. +func (client Client) GetDescendantsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetDescendantsResponder handles the response to the GetDescendants request. The method always +// closes the http.Response Body. +func (client Client) GetDescendantsResponder(resp *http.Response) (result DescendantListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getDescendantsNextResults retrieves the next set of results, if any. +func (client Client) getDescendantsNextResults(ctx context.Context, lastResults DescendantListResult) (result DescendantListResult, err error) { + req, err := lastResults.descendantListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "managementgroups.Client", "getDescendantsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetDescendantsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "managementgroups.Client", "getDescendantsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetDescendantsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "getDescendantsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetDescendantsComplete enumerates all values, automatically crossing page boundaries as required. +func (client Client) GetDescendantsComplete(ctx context.Context, groupID string, skiptoken string, top *int32) (result DescendantListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetDescendants") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetDescendants(ctx, groupID, skiptoken, top) + return +} + +// List list management groups for the authenticated user. +// Parameters: +// cacheControl - indicates that the request shouldn't utilize any caches. +// skiptoken - page continuation token is only used if a previous operation returned a partial result. If a +// previous response contains a nextLink element, the value of the nextLink element will include a token +// parameter that specifies a starting point to use for subsequent calls. +func (client Client) List(ctx context.Context, cacheControl string, skiptoken string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, cacheControl, skiptoken) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.Client", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client Client) ListPreparer(ctx context.Context, cacheControl string, skiptoken string) (*http.Request, error) { + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Management/managementGroups"), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } else { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String("no-cache"))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client Client) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client Client) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "managementgroups.Client", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "managementgroups.Client", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client Client) ListComplete(ctx context.Context, cacheControl string, skiptoken string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, cacheControl, skiptoken) + return +} + +// Update update a management group. +// Parameters: +// groupID - management Group ID. +// patchGroupRequest - management group patch parameters. +// cacheControl - indicates that the request shouldn't utilize any caches. +func (client Client) Update(ctx context.Context, groupID string, patchGroupRequest PatchManagementGroupRequest, cacheControl string) (result ManagementGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, groupID, patchGroupRequest, cacheControl) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.Client", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.Client", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client Client) UpdatePreparer(ctx context.Context, groupID string, patchGroupRequest PatchManagementGroupRequest, cacheControl string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{groupId}", pathParameters), + autorest.WithJSON(patchGroupRequest), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } else { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String("no-cache"))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client Client) UpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client Client) UpdateResponder(resp *http.Response) (result ManagementGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroupsapi/interfaces.go b/services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroupsapi/interfaces.go new file mode 100644 index 000000000000..9a1be3540911 --- /dev/null +++ b/services/preview/resources/mgmt/2019-11-01/managementgroups/managementgroupsapi/interfaces.go @@ -0,0 +1,67 @@ +package managementgroupsapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-11-01/managementgroups" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CheckNameAvailability(ctx context.Context, checkNameAvailabilityRequest managementgroups.CheckNameAvailabilityRequest) (result managementgroups.CheckNameAvailabilityResult, err error) + StartTenantBackfill(ctx context.Context) (result managementgroups.TenantBackfillStatusResult, err error) + TenantBackfillStatus(ctx context.Context) (result managementgroups.TenantBackfillStatusResult, err error) +} + +var _ BaseClientAPI = (*managementgroups.BaseClient)(nil) + +// ClientAPI contains the set of methods on the Client type. +type ClientAPI interface { + CreateOrUpdate(ctx context.Context, groupID string, createManagementGroupRequest managementgroups.CreateManagementGroupRequest, cacheControl string) (result managementgroups.CreateOrUpdateFuture, err error) + Delete(ctx context.Context, groupID string, cacheControl string) (result managementgroups.DeleteFuture, err error) + Get(ctx context.Context, groupID string, expand string, recurse *bool, filter string, cacheControl string) (result managementgroups.ManagementGroup, err error) + GetDescendants(ctx context.Context, groupID string, skiptoken string, top *int32) (result managementgroups.DescendantListResultPage, err error) + List(ctx context.Context, cacheControl string, skiptoken string) (result managementgroups.ListResultPage, err error) + Update(ctx context.Context, groupID string, patchGroupRequest managementgroups.PatchManagementGroupRequest, cacheControl string) (result managementgroups.ManagementGroup, err error) +} + +var _ ClientAPI = (*managementgroups.Client)(nil) + +// SubscriptionsClientAPI contains the set of methods on the SubscriptionsClient type. +type SubscriptionsClientAPI interface { + Create(ctx context.Context, groupID string, subscriptionID string, cacheControl string) (result autorest.Response, err error) + Delete(ctx context.Context, groupID string, subscriptionID string, cacheControl string) (result autorest.Response, err error) +} + +var _ SubscriptionsClientAPI = (*managementgroups.SubscriptionsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result managementgroups.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*managementgroups.OperationsClient)(nil) + +// EntitiesClientAPI contains the set of methods on the EntitiesClient type. +type EntitiesClientAPI interface { + List(ctx context.Context, skiptoken string, skip *int32, top *int32, selectParameter string, search string, filter string, view string, groupName string, cacheControl string) (result managementgroups.EntityListResultPage, err error) +} + +var _ EntitiesClientAPI = (*managementgroups.EntitiesClient)(nil) diff --git a/services/preview/resources/mgmt/2019-11-01/managementgroups/models.go b/services/preview/resources/mgmt/2019-11-01/managementgroups/models.go new file mode 100644 index 000000000000..cfbe2cd72317 --- /dev/null +++ b/services/preview/resources/mgmt/2019-11-01/managementgroups/models.go @@ -0,0 +1,1502 @@ +package managementgroups + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2019-11-01/managementgroups" + +// InheritedPermissions enumerates the values for inherited permissions. +type InheritedPermissions string + +const ( + // Delete ... + Delete InheritedPermissions = "delete" + // Edit ... + Edit InheritedPermissions = "edit" + // Noaccess ... + Noaccess InheritedPermissions = "noaccess" + // View ... + View InheritedPermissions = "view" +) + +// PossibleInheritedPermissionsValues returns an array of possible values for the InheritedPermissions const type. +func PossibleInheritedPermissionsValues() []InheritedPermissions { + return []InheritedPermissions{Delete, Edit, Noaccess, View} +} + +// Permissions enumerates the values for permissions. +type Permissions string + +const ( + // PermissionsDelete ... + PermissionsDelete Permissions = "delete" + // PermissionsEdit ... + PermissionsEdit Permissions = "edit" + // PermissionsNoaccess ... + PermissionsNoaccess Permissions = "noaccess" + // PermissionsView ... + PermissionsView Permissions = "view" +) + +// PossiblePermissionsValues returns an array of possible values for the Permissions const type. +func PossiblePermissionsValues() []Permissions { + return []Permissions{PermissionsDelete, PermissionsEdit, PermissionsNoaccess, PermissionsView} +} + +// Permissions1 enumerates the values for permissions 1. +type Permissions1 string + +const ( + // Permissions1Delete ... + Permissions1Delete Permissions1 = "delete" + // Permissions1Edit ... + Permissions1Edit Permissions1 = "edit" + // Permissions1Noaccess ... + Permissions1Noaccess Permissions1 = "noaccess" + // Permissions1View ... + Permissions1View Permissions1 = "view" +) + +// PossiblePermissions1Values returns an array of possible values for the Permissions1 const type. +func PossiblePermissions1Values() []Permissions1 { + return []Permissions1{Permissions1Delete, Permissions1Edit, Permissions1Noaccess, Permissions1View} +} + +// Reason enumerates the values for reason. +type Reason string + +const ( + // AlreadyExists ... + AlreadyExists Reason = "AlreadyExists" + // Invalid ... + Invalid Reason = "Invalid" +) + +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{AlreadyExists, Invalid} +} + +// Status enumerates the values for status. +type Status string + +const ( + // Cancelled ... + Cancelled Status = "Cancelled" + // Completed ... + Completed Status = "Completed" + // Failed ... + Failed Status = "Failed" + // NotStarted ... + NotStarted Status = "NotStarted" + // NotStartedButGroupsExist ... + NotStartedButGroupsExist Status = "NotStartedButGroupsExist" + // Started ... + Started Status = "Started" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{Cancelled, Completed, Failed, NotStarted, NotStartedButGroupsExist, Started} +} + +// Type enumerates the values for type. +type Type string + +const ( + // MicrosoftManagementmanagementGroups ... + MicrosoftManagementmanagementGroups Type = "Microsoft.Management/managementGroups" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{MicrosoftManagementmanagementGroups} +} + +// Type1 enumerates the values for type 1. +type Type1 string + +const ( + // Type1MicrosoftManagementmanagementGroups ... + Type1MicrosoftManagementmanagementGroups Type1 = "Microsoft.Management/managementGroups" + // Type1Subscriptions ... + Type1Subscriptions Type1 = "/subscriptions" +) + +// PossibleType1Values returns an array of possible values for the Type1 const type. +func PossibleType1Values() []Type1 { + return []Type1{Type1MicrosoftManagementmanagementGroups, Type1Subscriptions} +} + +// Type2 enumerates the values for type 2. +type Type2 string + +const ( + // Type2MicrosoftManagementmanagementGroups ... + Type2MicrosoftManagementmanagementGroups Type2 = "Microsoft.Management/managementGroups" + // Type2Subscriptions ... + Type2Subscriptions Type2 = "/subscriptions" +) + +// PossibleType2Values returns an array of possible values for the Type2 const type. +func PossibleType2Values() []Type2 { + return []Type2{Type2MicrosoftManagementmanagementGroups, Type2Subscriptions} +} + +// CheckNameAvailabilityRequest management group name availability check parameters. +type CheckNameAvailabilityRequest struct { + // Name - the name to check for availability + Name *string `json:"name,omitempty"` + // Type - fully qualified resource type which includes provider namespace. Possible values include: 'MicrosoftManagementmanagementGroups' + Type Type `json:"type,omitempty"` +} + +// CheckNameAvailabilityResult describes the result of the request to check management group name +// availability. +type CheckNameAvailabilityResult struct { + autorest.Response `json:"-"` + // NameAvailable - READ-ONLY; Required. True indicates name is valid and available. False indicates the name is invalid, unavailable, or both. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - READ-ONLY; Required if nameAvailable == false. Invalid indicates the name provided does not match the resource provider's naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists' + Reason Reason `json:"reason,omitempty"` + // Message - READ-ONLY; Required if nameAvailable == false. Localized. If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that is already in use, and direct them to select a different name. + Message *string `json:"message,omitempty"` +} + +// ChildInfo the child information of a management group. +type ChildInfo struct { + // Type - The fully qualified resource type which includes provider namespace (e.g. Microsoft.Management/managementGroups). Possible values include: 'Type1MicrosoftManagementmanagementGroups', 'Type1Subscriptions' + Type Type1 `json:"type,omitempty"` + // ID - The fully qualified ID for the child resource (management group or subscription). For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Name - The name of the child entity. + Name *string `json:"name,omitempty"` + // DisplayName - The friendly name of the child resource. + DisplayName *string `json:"displayName,omitempty"` + // Roles - The roles definitions associated with the management group. + Roles *[]string `json:"roles,omitempty"` + // Children - The list of children. + Children *[]ChildInfo `json:"children,omitempty"` +} + +// CreateManagementGroupChildInfo the child information of a management group used during creation. +type CreateManagementGroupChildInfo struct { + // Type - READ-ONLY; The fully qualified resource type which includes provider namespace (e.g. Microsoft.Management/managementGroups). Possible values include: 'Type2MicrosoftManagementmanagementGroups', 'Type2Subscriptions' + Type Type2 `json:"type,omitempty"` + // ID - READ-ONLY; The fully qualified ID for the child resource (management group or subscription). For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the child entity. + Name *string `json:"name,omitempty"` + // DisplayName - READ-ONLY; The friendly name of the child resource. + DisplayName *string `json:"displayName,omitempty"` + // Roles - READ-ONLY; The roles definitions associated with the management group. + Roles *[]string `json:"roles,omitempty"` + // Children - READ-ONLY; The list of children. + Children *[]CreateManagementGroupChildInfo `json:"children,omitempty"` +} + +// CreateManagementGroupDetails the details of a management group used during creation. +type CreateManagementGroupDetails struct { + // Version - READ-ONLY; The version number of the object. + Version *float64 `json:"version,omitempty"` + // UpdatedTime - READ-ONLY; The date and time when this object was last updated. + UpdatedTime *date.Time `json:"updatedTime,omitempty"` + // UpdatedBy - READ-ONLY; The identity of the principal or process that updated the object. + UpdatedBy *string `json:"updatedBy,omitempty"` + Parent *CreateParentGroupInfo `json:"parent,omitempty"` +} + +// CreateManagementGroupProperties the generic properties of a management group used during creation. +type CreateManagementGroupProperties struct { + // TenantID - READ-ONLY; The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000 + TenantID *string `json:"tenantId,omitempty"` + // DisplayName - The friendly name of the management group. If no value is passed then this field will be set to the groupId. + DisplayName *string `json:"displayName,omitempty"` + // Roles - READ-ONLY; The roles definitions associated with the management group. + Roles *[]string `json:"roles,omitempty"` + Details *CreateManagementGroupDetails `json:"details,omitempty"` + // Children - READ-ONLY; The list of children. + Children *[]CreateManagementGroupChildInfo `json:"children,omitempty"` +} + +// CreateManagementGroupRequest management group creation parameters. +type CreateManagementGroupRequest struct { + // ID - READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups + Type *string `json:"type,omitempty"` + // Name - The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + Name *string `json:"name,omitempty"` + *CreateManagementGroupProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreateManagementGroupRequest. +func (cmgr CreateManagementGroupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cmgr.Name != nil { + objectMap["name"] = cmgr.Name + } + if cmgr.CreateManagementGroupProperties != nil { + objectMap["properties"] = cmgr.CreateManagementGroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CreateManagementGroupRequest struct. +func (cmgr *CreateManagementGroupRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cmgr.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cmgr.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cmgr.Name = &name + } + case "properties": + if v != nil { + var createManagementGroupProperties CreateManagementGroupProperties + err = json.Unmarshal(*v, &createManagementGroupProperties) + if err != nil { + return err + } + cmgr.CreateManagementGroupProperties = &createManagementGroupProperties + } + } + } + + return nil +} + +// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CreateOrUpdateFuture) Result(client Client) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("managementgroups.CreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.CreateOrUpdateResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.CreateOrUpdateFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// CreateParentGroupInfo (Optional) The ID of the parent management group used during creation. +type CreateParentGroupInfo struct { + // ID - The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the parent management group + Name *string `json:"name,omitempty"` + // DisplayName - READ-ONLY; The friendly name of the parent management group. + DisplayName *string `json:"displayName,omitempty"` +} + +// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type DeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DeleteFuture) Result(client Client) (or OperationResults, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.DeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("managementgroups.DeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.DeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// DescendantInfo the descendant. +type DescendantInfo struct { + // ID - READ-ONLY; The fully qualified ID for the descendant. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 or /subscriptions/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups or /subscriptions + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The name of the descendant. For example, 00000000-0000-0000-0000-000000000000 + Name *string `json:"name,omitempty"` + *DescendantInfoProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DescendantInfo. +func (di DescendantInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if di.DescendantInfoProperties != nil { + objectMap["properties"] = di.DescendantInfoProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DescendantInfo struct. +func (di *DescendantInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + di.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + di.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + di.Name = &name + } + case "properties": + if v != nil { + var descendantInfoProperties DescendantInfoProperties + err = json.Unmarshal(*v, &descendantInfoProperties) + if err != nil { + return err + } + di.DescendantInfoProperties = &descendantInfoProperties + } + } + } + + return nil +} + +// DescendantInfoProperties the generic properties of an descendant. +type DescendantInfoProperties struct { + // DisplayName - The friendly name of the management group. + DisplayName *string `json:"displayName,omitempty"` + Parent *DescendantParentGroupInfo `json:"parent,omitempty"` +} + +// DescendantListResult describes the result of the request to view descendants. +type DescendantListResult struct { + autorest.Response `json:"-"` + // Value - The list of descendants. + Value *[]DescendantInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to use for getting the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DescendantListResultIterator provides access to a complete listing of DescendantInfo values. +type DescendantListResultIterator struct { + i int + page DescendantListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DescendantListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DescendantListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DescendantListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DescendantListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DescendantListResultIterator) Response() DescendantListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DescendantListResultIterator) Value() DescendantInfo { + if !iter.page.NotDone() { + return DescendantInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DescendantListResultIterator type. +func NewDescendantListResultIterator(page DescendantListResultPage) DescendantListResultIterator { + return DescendantListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dlr DescendantListResult) IsEmpty() bool { + return dlr.Value == nil || len(*dlr.Value) == 0 +} + +// descendantListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dlr DescendantListResult) descendantListResultPreparer(ctx context.Context) (*http.Request, error) { + if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dlr.NextLink))) +} + +// DescendantListResultPage contains a page of DescendantInfo values. +type DescendantListResultPage struct { + fn func(context.Context, DescendantListResult) (DescendantListResult, error) + dlr DescendantListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DescendantListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DescendantListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.dlr) + if err != nil { + return err + } + page.dlr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DescendantListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DescendantListResultPage) NotDone() bool { + return !page.dlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DescendantListResultPage) Response() DescendantListResult { + return page.dlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DescendantListResultPage) Values() []DescendantInfo { + if page.dlr.IsEmpty() { + return nil + } + return *page.dlr.Value +} + +// Creates a new instance of the DescendantListResultPage type. +func NewDescendantListResultPage(getNextPage func(context.Context, DescendantListResult) (DescendantListResult, error)) DescendantListResultPage { + return DescendantListResultPage{fn: getNextPage} +} + +// DescendantParentGroupInfo the ID of the parent management group. +type DescendantParentGroupInfo struct { + // ID - The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` +} + +// Details the details of a management group. +type Details struct { + // Version - The version number of the object. + Version *float64 `json:"version,omitempty"` + // UpdatedTime - The date and time when this object was last updated. + UpdatedTime *date.Time `json:"updatedTime,omitempty"` + // UpdatedBy - The identity of the principal or process that updated the object. + UpdatedBy *string `json:"updatedBy,omitempty"` + Parent *ParentGroupInfo `json:"parent,omitempty"` +} + +// EntityHierarchyItem the management group details for the hierarchy view. +type EntityHierarchyItem struct { + // ID - READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + Name *string `json:"name,omitempty"` + *EntityHierarchyItemProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for EntityHierarchyItem. +func (ehi EntityHierarchyItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ehi.EntityHierarchyItemProperties != nil { + objectMap["properties"] = ehi.EntityHierarchyItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EntityHierarchyItem struct. +func (ehi *EntityHierarchyItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ehi.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ehi.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ehi.Name = &name + } + case "properties": + if v != nil { + var entityHierarchyItemProperties EntityHierarchyItemProperties + err = json.Unmarshal(*v, &entityHierarchyItemProperties) + if err != nil { + return err + } + ehi.EntityHierarchyItemProperties = &entityHierarchyItemProperties + } + } + } + + return nil +} + +// EntityHierarchyItemProperties the generic properties of a management group. +type EntityHierarchyItemProperties struct { + // DisplayName - The friendly name of the management group. + DisplayName *string `json:"displayName,omitempty"` + // Permissions - Possible values include: 'Permissions1Noaccess', 'Permissions1View', 'Permissions1Edit', 'Permissions1Delete' + Permissions Permissions1 `json:"permissions,omitempty"` + // Children - The list of children. + Children *[]EntityHierarchyItem `json:"children,omitempty"` +} + +// EntityInfo the entity. +type EntityInfo struct { + // ID - READ-ONLY; The fully qualified ID for the entity. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The name of the entity. For example, 00000000-0000-0000-0000-000000000000 + Name *string `json:"name,omitempty"` + *EntityInfoProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for EntityInfo. +func (ei EntityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ei.EntityInfoProperties != nil { + objectMap["properties"] = ei.EntityInfoProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EntityInfo struct. +func (ei *EntityInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ei.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ei.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ei.Name = &name + } + case "properties": + if v != nil { + var entityInfoProperties EntityInfoProperties + err = json.Unmarshal(*v, &entityInfoProperties) + if err != nil { + return err + } + ei.EntityInfoProperties = &entityInfoProperties + } + } + } + + return nil +} + +// EntityInfoProperties the generic properties of an entity. +type EntityInfoProperties struct { + // TenantID - The AAD Tenant ID associated with the entity. For example, 00000000-0000-0000-0000-000000000000 + TenantID *string `json:"tenantId,omitempty"` + // DisplayName - The friendly name of the management group. + DisplayName *string `json:"displayName,omitempty"` + Parent *EntityParentGroupInfo `json:"parent,omitempty"` + // Permissions - Possible values include: 'PermissionsNoaccess', 'PermissionsView', 'PermissionsEdit', 'PermissionsDelete' + Permissions Permissions `json:"permissions,omitempty"` + // InheritedPermissions - Possible values include: 'Noaccess', 'View', 'Edit', 'Delete' + InheritedPermissions InheritedPermissions `json:"inheritedPermissions,omitempty"` + NumberOfDescendants *int32 `json:"numberOfDescendants,omitempty"` + // NumberOfChildren - Number of children is the number of Groups and Subscriptions that are exactly one level underneath the current Group. + NumberOfChildren *int32 `json:"numberOfChildren,omitempty"` + // NumberOfChildGroups - Number of children is the number of Groups that are exactly one level underneath the current Group. + NumberOfChildGroups *int32 `json:"numberOfChildGroups,omitempty"` + // ParentDisplayNameChain - The parent display name chain from the root group to the immediate parent + ParentDisplayNameChain *[]string `json:"parentDisplayNameChain,omitempty"` + // ParentNameChain - The parent name chain from the root group to the immediate parent + ParentNameChain *[]string `json:"parentNameChain,omitempty"` +} + +// EntityListResult describes the result of the request to view entities. +type EntityListResult struct { + autorest.Response `json:"-"` + // Value - The list of entities. + Value *[]EntityInfo `json:"value,omitempty"` + // Count - READ-ONLY; Total count of records that match the filter + Count *int32 `json:"count,omitempty"` + // NextLink - READ-ONLY; The URL to use for getting the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// EntityListResultIterator provides access to a complete listing of EntityInfo values. +type EntityListResultIterator struct { + i int + page EntityListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EntityListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EntityListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EntityListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EntityListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EntityListResultIterator) Response() EntityListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EntityListResultIterator) Value() EntityInfo { + if !iter.page.NotDone() { + return EntityInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EntityListResultIterator type. +func NewEntityListResultIterator(page EntityListResultPage) EntityListResultIterator { + return EntityListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (elr EntityListResult) IsEmpty() bool { + return elr.Value == nil || len(*elr.Value) == 0 +} + +// entityListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (elr EntityListResult) entityListResultPreparer(ctx context.Context) (*http.Request, error) { + if elr.NextLink == nil || len(to.String(elr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(elr.NextLink))) +} + +// EntityListResultPage contains a page of EntityInfo values. +type EntityListResultPage struct { + fn func(context.Context, EntityListResult) (EntityListResult, error) + elr EntityListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EntityListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EntityListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.elr) + if err != nil { + return err + } + page.elr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EntityListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EntityListResultPage) NotDone() bool { + return !page.elr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EntityListResultPage) Response() EntityListResult { + return page.elr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EntityListResultPage) Values() []EntityInfo { + if page.elr.IsEmpty() { + return nil + } + return *page.elr.Value +} + +// Creates a new instance of the EntityListResultPage type. +func NewEntityListResultPage(getNextPage func(context.Context, EntityListResult) (EntityListResult, error)) EntityListResultPage { + return EntityListResultPage{fn: getNextPage} +} + +// EntityParentGroupInfo (Optional) The ID of the parent management group. +type EntityParentGroupInfo struct { + // ID - The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` +} + +// ErrorDetails the details of the error. +type ErrorDetails struct { + // Code - One of a server-defined set of error codes. + Code *string `json:"code,omitempty"` + // Message - A human-readable representation of the error. + Message *string `json:"message,omitempty"` + // Details - A human-readable representation of the error's details. + Details *string `json:"details,omitempty"` +} + +// ErrorResponse the error object. +type ErrorResponse struct { + Error *ErrorDetails `json:"error,omitempty"` +} + +// Info the management group resource. +type Info struct { + // ID - READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + Name *string `json:"name,omitempty"` + *InfoProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Info. +func (i Info) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.InfoProperties != nil { + objectMap["properties"] = i.InfoProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Info struct. +func (i *Info) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "properties": + if v != nil { + var infoProperties InfoProperties + err = json.Unmarshal(*v, &infoProperties) + if err != nil { + return err + } + i.InfoProperties = &infoProperties + } + } + } + + return nil +} + +// InfoProperties the generic properties of a management group. +type InfoProperties struct { + // TenantID - The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000 + TenantID *string `json:"tenantId,omitempty"` + // DisplayName - The friendly name of the management group. + DisplayName *string `json:"displayName,omitempty"` +} + +// ListResult describes the result of the request to list management groups. +type ListResult struct { + autorest.Response `json:"-"` + // Value - The list of management groups. + Value *[]Info `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to use for getting the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of Info values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListResultIterator) Response() ListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListResultIterator) Value() Info { + if !iter.page.NotDone() { + return Info{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of Info values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []Info { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// ManagementGroup the management group details. +type ManagementGroup struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + Name *string `json:"name,omitempty"` + *Properties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagementGroup. +func (mg ManagementGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mg.Properties != nil { + objectMap["properties"] = mg.Properties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagementGroup struct. +func (mg *ManagementGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mg.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mg.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mg.Name = &name + } + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + mg.Properties = &properties + } + } + } + + return nil +} + +// Operation operation supported by the Microsoft.Management resource provider. +type Operation struct { + // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + Display *OperationDisplayProperties `json:"display,omitempty"` +} + +// OperationDisplayProperties the object that represents the operation. +type OperationDisplayProperties struct { + // Provider - READ-ONLY; The name of the provider. + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The operation that can be performed. + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; Operation description. + Description *string `json:"description,omitempty"` +} + +// OperationListResult describes the result of the request to list Microsoft.Management operations. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of operations supported by the Microsoft.Management resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// OperationResults the results of an asynchronous operation. +type OperationResults struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000 + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; The current status of the operation + Status *string `json:"status,omitempty"` +} + +// ParentGroupInfo (Optional) The ID of the parent management group. +type ParentGroupInfo struct { + // ID - The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ID *string `json:"id,omitempty"` + // Name - The name of the parent management group + Name *string `json:"name,omitempty"` + // DisplayName - The friendly name of the parent management group. + DisplayName *string `json:"displayName,omitempty"` +} + +// PatchManagementGroupRequest management group patch parameters. +type PatchManagementGroupRequest struct { + // DisplayName - The friendly name of the management group. + DisplayName *string `json:"displayName,omitempty"` + // ParentID - (Optional) The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000 + ParentID *string `json:"parentId,omitempty"` +} + +// PathElement a path element of a management group ancestors. +type PathElement struct { + // Name - The name of the group. + Name *string `json:"name,omitempty"` + // DisplayName - The friendly name of the group. + DisplayName *string `json:"displayName,omitempty"` +} + +// Properties the generic properties of a management group. +type Properties struct { + // TenantID - The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000 + TenantID *string `json:"tenantId,omitempty"` + // DisplayName - The friendly name of the management group. + DisplayName *string `json:"displayName,omitempty"` + // Roles - The role definitions associated with the management group. + Roles *[]string `json:"roles,omitempty"` + Details *Details `json:"details,omitempty"` + // Children - The list of children. + Children *[]ChildInfo `json:"children,omitempty"` + // Path - The hierarchial path from the root group to the current group. + Path *[]PathElement `json:"path,omitempty"` +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + +// TenantBackfillStatusResult the tenant backfill status +type TenantBackfillStatusResult struct { + autorest.Response `json:"-"` + // TenantID - READ-ONLY; The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000 + TenantID *string `json:"tenantId,omitempty"` + // Status - READ-ONLY; The status of the Tenant Backfill. Possible values include: 'NotStarted', 'NotStartedButGroupsExist', 'Started', 'Failed', 'Cancelled', 'Completed' + Status Status `json:"status,omitempty"` +} diff --git a/services/preview/resources/mgmt/2019-11-01/managementgroups/operations.go b/services/preview/resources/mgmt/2019-11-01/managementgroups/operations.go new file mode 100644 index 000000000000..5bebd8a89e72 --- /dev/null +++ b/services/preview/resources/mgmt/2019-11-01/managementgroups/operations.go @@ -0,0 +1,149 @@ +package managementgroups + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the the Azure Management Groups API enables consolidation of multiple subscriptions/resources +// into an organizational hierarchy and centrally manage access control, policies, alerting and reporting for those +// resources. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient() OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI)} +} + +// List lists all of the available Management REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "managementgroups.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Management/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "managementgroups.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "managementgroups.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/preview/resources/mgmt/2019-11-01/managementgroups/subscriptions.go b/services/preview/resources/mgmt/2019-11-01/managementgroups/subscriptions.go new file mode 100644 index 000000000000..f3cb269d9bf6 --- /dev/null +++ b/services/preview/resources/mgmt/2019-11-01/managementgroups/subscriptions.go @@ -0,0 +1,209 @@ +package managementgroups + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SubscriptionsClient is the the Azure Management Groups API enables consolidation of multiple subscriptions/resources +// into an organizational hierarchy and centrally manage access control, policies, alerting and reporting for those +// resources. +type SubscriptionsClient struct { + BaseClient +} + +// NewSubscriptionsClient creates an instance of the SubscriptionsClient client. +func NewSubscriptionsClient() SubscriptionsClient { + return NewSubscriptionsClientWithBaseURI(DefaultBaseURI) +} + +// NewSubscriptionsClientWithBaseURI creates an instance of the SubscriptionsClient client. +func NewSubscriptionsClientWithBaseURI(baseURI string) SubscriptionsClient { + return SubscriptionsClient{NewWithBaseURI(baseURI)} +} + +// Create associates existing subscription with the management group. +// Parameters: +// groupID - management Group ID. +// subscriptionID - subscription ID. +// cacheControl - indicates that the request shouldn't utilize any caches. +func (client SubscriptionsClient) Create(ctx context.Context, groupID string, subscriptionID string, cacheControl string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.Create") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, groupID, subscriptionID, cacheControl) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.SubscriptionsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "managementgroups.SubscriptionsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.SubscriptionsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SubscriptionsClient) CreatePreparer(ctx context.Context, groupID string, subscriptionID string, cacheControl string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } else { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String("no-cache"))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) CreateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete de-associates subscription from the management group. +// Parameters: +// groupID - management Group ID. +// subscriptionID - subscription ID. +// cacheControl - indicates that the request shouldn't utilize any caches. +func (client SubscriptionsClient) Delete(ctx context.Context, groupID string, subscriptionID string, cacheControl string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, groupID, subscriptionID, cacheControl) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.SubscriptionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "managementgroups.SubscriptionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "managementgroups.SubscriptionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SubscriptionsClient) DeletePreparer(ctx context.Context, groupID string, subscriptionID string, cacheControl string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(cacheControl) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String(cacheControl))) + } else { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("Cache-Control", autorest.String("no-cache"))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/resources/mgmt/2019-11-01/managementgroups/version.go b/services/preview/resources/mgmt/2019-11-01/managementgroups/version.go new file mode 100644 index 000000000000..cf92d4e2e6b9 --- /dev/null +++ b/services/preview/resources/mgmt/2019-11-01/managementgroups/version.go @@ -0,0 +1,30 @@ +package managementgroups + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " managementgroups/2019-11-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go index b474b9a4c669..7c5aaa59b0f4 100644 --- a/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go +++ b/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go @@ -661,13 +661,15 @@ const ( AzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" // AzureSecurityCenter ... AzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" + // AzureSecurityCenterforIoT ... + AzureSecurityCenterforIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" // MicrosoftCloudAppSecurity ... MicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" ) // PossibleMicrosoftSecurityProductNameValues returns an array of possible values for the MicrosoftSecurityProductName const type. func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName { - return []MicrosoftSecurityProductName{AzureActiveDirectoryIdentityProtection, AzureAdvancedThreatProtection, AzureSecurityCenter, MicrosoftCloudAppSecurity} + return []MicrosoftSecurityProductName{AzureActiveDirectoryIdentityProtection, AzureAdvancedThreatProtection, AzureSecurityCenter, AzureSecurityCenterforIoT, MicrosoftCloudAppSecurity} } // OSFamily enumerates the values for os family. @@ -7661,7 +7663,7 @@ func (msicar *MicrosoftSecurityIncidentCreationAlertRule) UnmarshalJSON(body []b type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties struct { // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection' + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection', 'AzureSecurityCenterforIoT' ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` // SeveritiesFilter - the alerts' severities on which the cases will be generated SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` @@ -7684,7 +7686,7 @@ type MicrosoftSecurityIncidentCreationAlertRuleProperties struct { Tactics *[]AttackTactic `json:"tactics,omitempty"` // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection' + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection', 'AzureSecurityCenterforIoT' ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` // SeveritiesFilter - the alerts' severities on which the cases will be generated SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` @@ -7822,7 +7824,7 @@ type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { Tactics *[]AttackTactic `json:"tactics,omitempty"` // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection' + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection', 'AzureSecurityCenterforIoT' ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` // SeveritiesFilter - the alerts' severities on which the cases will be generated SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/databases.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/databases.go index fc4ef2661cfd..6e99278108ed 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/databases.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/databases.go @@ -48,7 +48,8 @@ func NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) Databa // from the Azure Resource Manager API or the portal. // serverName - the name of the server. // databaseName - the name of the database to failover. -func (client DatabasesClient) Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result DatabasesFailoverFuture, err error) { +// replicaType - the type of replica to be failed over. +func (client DatabasesClient) Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, replicaType ReplicaType) (result DatabasesFailoverFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Failover") defer func() { @@ -59,7 +60,7 @@ func (client DatabasesClient) Failover(ctx context.Context, resourceGroupName st tracing.EndSpan(ctx, sc, err) }() } - req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, databaseName) + req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, databaseName, replicaType) if err != nil { err = autorest.NewErrorWithError(err, "sql.DatabasesClient", "Failover", nil, "Failure preparing request") return @@ -75,7 +76,7 @@ func (client DatabasesClient) Failover(ctx context.Context, resourceGroupName st } // FailoverPreparer prepares the Failover request. -func (client DatabasesClient) FailoverPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { +func (client DatabasesClient) FailoverPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, replicaType ReplicaType) (*http.Request, error) { pathParameters := map[string]interface{}{ "databaseName": autorest.Encode("path", databaseName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -87,6 +88,9 @@ func (client DatabasesClient) FailoverPreparer(ctx context.Context, resourceGrou queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(replicaType)) > 0 { + queryParameters["replicaType"] = autorest.Encode("query", replicaType) + } preparer := autorest.CreatePreparer( autorest.AsPost(), diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go index 6826ef42f89c..6a41d0d53f0b 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go @@ -166,6 +166,21 @@ func PossibleManagedServerCreateModeValues() []ManagedServerCreateMode { return []ManagedServerCreateMode{ManagedServerCreateModeDefault, ManagedServerCreateModePointInTimeRestore} } +// ReplicaType enumerates the values for replica type. +type ReplicaType string + +const ( + // Primary ... + Primary ReplicaType = "Primary" + // ReadableSecondary ... + ReadableSecondary ReplicaType = "ReadableSecondary" +) + +// PossibleReplicaTypeValues returns an array of possible values for the ReplicaType const type. +func PossibleReplicaTypeValues() []ReplicaType { + return []ReplicaType{Primary, ReadableSecondary} +} + // SecurityAlertPolicyState enumerates the values for security alert policy state. type SecurityAlertPolicyState string diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi/interfaces.go index 141c762e5f0a..e448e7707d38 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/sqlapi/interfaces.go @@ -118,7 +118,7 @@ var _ ManagedDatabasesClientAPI = (*sql.ManagedDatabasesClient)(nil) // DatabasesClientAPI contains the set of methods on the DatabasesClient type. type DatabasesClientAPI interface { - Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.DatabasesFailoverFuture, err error) + Failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, replicaType sql.ReplicaType) (result sql.DatabasesFailoverFuture, err error) } var _ DatabasesClientAPI = (*sql.DatabasesClient)(nil) diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/environments.go b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/environments.go index cf1696357508..3c2ed91511f3 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/environments.go +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/environments.go @@ -449,8 +449,9 @@ func (client EnvironmentsClient) ListBySubscriptionResponder(resp *http.Response // resourceGroupName - name of an Azure Resource group. // environmentName - the name of the Time Series Insights environment associated with the specified resource // group. -// environmentUpdateParameters - request object that contains the updated information for the environment. -func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters EnvironmentUpdateParameters) (result EnvironmentsUpdateFuture, err error) { +// standardEnvironmentUpdateParameters - request object that contains the updated information for the +// environment. +func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, environmentName string, standardEnvironmentUpdateParameters StandardEnvironmentUpdateParameters) (result EnvironmentsUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentsClient.Update") defer func() { @@ -461,7 +462,7 @@ func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName s tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdatePreparer(ctx, resourceGroupName, environmentName, environmentUpdateParameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, environmentName, standardEnvironmentUpdateParameters) if err != nil { err = autorest.NewErrorWithError(err, "timeseriesinsights.EnvironmentsClient", "Update", nil, "Failure preparing request") return @@ -477,7 +478,7 @@ func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName s } // UpdatePreparer prepares the Update request. -func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters EnvironmentUpdateParameters) (*http.Request, error) { +func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, environmentName string, standardEnvironmentUpdateParameters StandardEnvironmentUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "environmentName": autorest.Encode("path", environmentName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -494,7 +495,7 @@ func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGro autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", pathParameters), - autorest.WithJSON(environmentUpdateParameters), + autorest.WithJSON(standardEnvironmentUpdateParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go index 979e8479be63..668b58548d1f 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go @@ -230,6 +230,8 @@ type SkuName string const ( // L1 ... L1 SkuName = "L1" + // P1 ... + P1 SkuName = "P1" // S1 ... S1 SkuName = "S1" // S2 ... @@ -238,7 +240,7 @@ const ( // PossibleSkuNameValues returns an array of possible values for the SkuName const type. func PossibleSkuNameValues() []SkuName { - return []SkuName{L1, S1, S2} + return []SkuName{L1, P1, S1, S2} } // StorageLimitExceededBehavior enumerates the values for storage limit exceeded behavior. @@ -256,6 +258,23 @@ func PossibleStorageLimitExceededBehaviorValues() []StorageLimitExceededBehavior return []StorageLimitExceededBehavior{PauseIngress, PurgeOldData} } +// WarmStoragePropertiesState enumerates the values for warm storage properties state. +type WarmStoragePropertiesState string + +const ( + // WarmStoragePropertiesStateError ... + WarmStoragePropertiesStateError WarmStoragePropertiesState = "Error" + // WarmStoragePropertiesStateOk ... + WarmStoragePropertiesStateOk WarmStoragePropertiesState = "Ok" + // WarmStoragePropertiesStateUnknown ... + WarmStoragePropertiesStateUnknown WarmStoragePropertiesState = "Unknown" +) + +// PossibleWarmStoragePropertiesStateValues returns an array of possible values for the WarmStoragePropertiesState const type. +func PossibleWarmStoragePropertiesStateValues() []WarmStoragePropertiesState { + return []WarmStoragePropertiesState{WarmStoragePropertiesStateError, WarmStoragePropertiesStateOk, WarmStoragePropertiesStateUnknown} +} + // AccessPolicyCreateOrUpdateParameters ... type AccessPolicyCreateOrUpdateParameters struct { *AccessPolicyResourceProperties `json:"properties,omitempty"` @@ -794,6 +813,8 @@ type EnvironmentStateDetails struct { type EnvironmentStatus struct { // Ingress - An object that represents the status of ingress on an environment. Ingress *IngressEnvironmentStatus `json:"ingress,omitempty"` + // WarmStorage - An object that represents the status of warm storage on an environment. + WarmStorage *WarmStorageEnvironmentStatus `json:"warmStorage,omitempty"` } // EnvironmentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -1990,6 +2011,65 @@ type LongTermEnvironmentCreationProperties struct { TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. StorageConfiguration *LongTermStorageConfigurationInput `json:"storageConfiguration,omitempty"` + // WarmStoreConfigurationProperties - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. + *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermEnvironmentCreationProperties. +func (ltecp LongTermEnvironmentCreationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ltecp.TimeSeriesIDProperties != nil { + objectMap["timeSeriesIdProperties"] = ltecp.TimeSeriesIDProperties + } + if ltecp.StorageConfiguration != nil { + objectMap["storageConfiguration"] = ltecp.StorageConfiguration + } + if ltecp.WarmStoreConfigurationProperties != nil { + objectMap["warmStoreConfiguration"] = ltecp.WarmStoreConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LongTermEnvironmentCreationProperties struct. +func (ltecp *LongTermEnvironmentCreationProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "timeSeriesIdProperties": + if v != nil { + var timeSeriesIDProperties []TimeSeriesIDProperty + err = json.Unmarshal(*v, &timeSeriesIDProperties) + if err != nil { + return err + } + ltecp.TimeSeriesIDProperties = &timeSeriesIDProperties + } + case "storageConfiguration": + if v != nil { + var storageConfiguration LongTermStorageConfigurationInput + err = json.Unmarshal(*v, &storageConfiguration) + if err != nil { + return err + } + ltecp.StorageConfiguration = &storageConfiguration + } + case "warmStoreConfiguration": + if v != nil { + var warmStoreConfigurationProperties WarmStoreConfigurationProperties + err = json.Unmarshal(*v, &warmStoreConfigurationProperties) + if err != nil { + return err + } + ltecp.WarmStoreConfigurationProperties = &warmStoreConfigurationProperties + } + } + } + + return nil } // LongTermEnvironmentMutableProperties an object that represents a set of mutable long-term environment @@ -1997,8 +2077,53 @@ type LongTermEnvironmentCreationProperties struct { type LongTermEnvironmentMutableProperties struct { // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. StorageConfiguration *LongTermStorageConfigurationMutableProperties `json:"storageConfiguration,omitempty"` - // TimeSeriesIDProperties - The list of event properties which will be used to partition data in the environment. - TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` + // WarmStoreConfigurationProperties - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. + *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermEnvironmentMutableProperties. +func (ltemp LongTermEnvironmentMutableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ltemp.StorageConfiguration != nil { + objectMap["storageConfiguration"] = ltemp.StorageConfiguration + } + if ltemp.WarmStoreConfigurationProperties != nil { + objectMap["warmStoreConfiguration"] = ltemp.WarmStoreConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LongTermEnvironmentMutableProperties struct. +func (ltemp *LongTermEnvironmentMutableProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "storageConfiguration": + if v != nil { + var storageConfiguration LongTermStorageConfigurationMutableProperties + err = json.Unmarshal(*v, &storageConfiguration) + if err != nil { + return err + } + ltemp.StorageConfiguration = &storageConfiguration + } + case "warmStoreConfiguration": + if v != nil { + var warmStoreConfigurationProperties WarmStoreConfigurationProperties + err = json.Unmarshal(*v, &warmStoreConfigurationProperties) + if err != nil { + return err + } + ltemp.WarmStoreConfigurationProperties = &warmStoreConfigurationProperties + } + } + } + + return nil } // LongTermEnvironmentResource an environment is a set of time-series data available for query, and is the @@ -2167,6 +2292,116 @@ type LongTermEnvironmentResourceProperties struct { TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. StorageConfiguration *LongTermStorageConfigurationOutput `json:"storageConfiguration,omitempty"` + // WarmStoreConfigurationProperties - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. + *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` +} + +// MarshalJSON is the custom marshaler for LongTermEnvironmentResourceProperties. +func (lterp LongTermEnvironmentResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lterp.Status != nil { + objectMap["status"] = lterp.Status + } + if lterp.ProvisioningState != "" { + objectMap["provisioningState"] = lterp.ProvisioningState + } + if lterp.TimeSeriesIDProperties != nil { + objectMap["timeSeriesIdProperties"] = lterp.TimeSeriesIDProperties + } + if lterp.StorageConfiguration != nil { + objectMap["storageConfiguration"] = lterp.StorageConfiguration + } + if lterp.WarmStoreConfigurationProperties != nil { + objectMap["warmStoreConfiguration"] = lterp.WarmStoreConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LongTermEnvironmentResourceProperties struct. +func (lterp *LongTermEnvironmentResourceProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "dataAccessId": + if v != nil { + var dataAccessID uuid.UUID + err = json.Unmarshal(*v, &dataAccessID) + if err != nil { + return err + } + lterp.DataAccessID = &dataAccessID + } + case "dataAccessFqdn": + if v != nil { + var dataAccessFqdn string + err = json.Unmarshal(*v, &dataAccessFqdn) + if err != nil { + return err + } + lterp.DataAccessFqdn = &dataAccessFqdn + } + case "status": + if v != nil { + var status EnvironmentStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + lterp.Status = &status + } + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + lterp.ProvisioningState = provisioningState + } + case "creationTime": + if v != nil { + var creationTime date.Time + err = json.Unmarshal(*v, &creationTime) + if err != nil { + return err + } + lterp.CreationTime = &creationTime + } + case "timeSeriesIdProperties": + if v != nil { + var timeSeriesIDProperties []TimeSeriesIDProperty + err = json.Unmarshal(*v, &timeSeriesIDProperties) + if err != nil { + return err + } + lterp.TimeSeriesIDProperties = &timeSeriesIDProperties + } + case "storageConfiguration": + if v != nil { + var storageConfiguration LongTermStorageConfigurationOutput + err = json.Unmarshal(*v, &storageConfiguration) + if err != nil { + return err + } + lterp.StorageConfiguration = &storageConfiguration + } + case "warmStoreConfiguration": + if v != nil { + var warmStoreConfigurationProperties WarmStoreConfigurationProperties + err = json.Unmarshal(*v, &warmStoreConfigurationProperties) + if err != nil { + return err + } + lterp.WarmStoreConfigurationProperties = &warmStoreConfigurationProperties + } + } + } + + return nil } // LongTermEnvironmentUpdateParameters parameters supplied to the Update Environment operation to update a @@ -2657,7 +2892,7 @@ type ResourceProperties struct { // standard environments the sku determines the capacity of the environment, the ingress rate, and the // billing rate. type Sku struct { - // Name - The name of this SKU. Possible values include: 'S1', 'S2', 'L1' + // Name - The name of this SKU. Possible values include: 'S1', 'S2', 'P1', 'L1' Name SkuName `json:"name,omitempty"` // Capacity - The capacity of the sku. For standard environments, this value can be changed to support scale out of environments after they have been created. Capacity *int32 `json:"capacity,omitempty"` @@ -3071,3 +3306,111 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { } return json.Marshal(objectMap) } + +// WarmStorageEnvironmentStatus an object that represents the status of warm storage on an environment. +type WarmStorageEnvironmentStatus struct { + // WarmStoragePropertiesUsage - An object that contains the status of warm storage properties usage. + *WarmStoragePropertiesUsage `json:"propertiesUsage,omitempty"` +} + +// MarshalJSON is the custom marshaler for WarmStorageEnvironmentStatus. +func (wses WarmStorageEnvironmentStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wses.WarmStoragePropertiesUsage != nil { + objectMap["propertiesUsage"] = wses.WarmStoragePropertiesUsage + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WarmStorageEnvironmentStatus struct. +func (wses *WarmStorageEnvironmentStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "propertiesUsage": + if v != nil { + var warmStoragePropertiesUsage WarmStoragePropertiesUsage + err = json.Unmarshal(*v, &warmStoragePropertiesUsage) + if err != nil { + return err + } + wses.WarmStoragePropertiesUsage = &warmStoragePropertiesUsage + } + } + } + + return nil +} + +// WarmStoragePropertiesUsage an object that contains the status of warm storage properties usage. +type WarmStoragePropertiesUsage struct { + // State - This string represents the state of warm storage properties usage. It can be "Ok", "Error", "Unknown". Possible values include: 'WarmStoragePropertiesStateOk', 'WarmStoragePropertiesStateError', 'WarmStoragePropertiesStateUnknown' + State WarmStoragePropertiesState `json:"state,omitempty"` + // WarmStoragePropertiesUsageStateDetails - An object that contains the details about warm storage properties usage state. + *WarmStoragePropertiesUsageStateDetails `json:"stateDetails,omitempty"` +} + +// MarshalJSON is the custom marshaler for WarmStoragePropertiesUsage. +func (wspu WarmStoragePropertiesUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wspu.State != "" { + objectMap["state"] = wspu.State + } + if wspu.WarmStoragePropertiesUsageStateDetails != nil { + objectMap["stateDetails"] = wspu.WarmStoragePropertiesUsageStateDetails + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WarmStoragePropertiesUsage struct. +func (wspu *WarmStoragePropertiesUsage) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "state": + if v != nil { + var state WarmStoragePropertiesState + err = json.Unmarshal(*v, &state) + if err != nil { + return err + } + wspu.State = state + } + case "stateDetails": + if v != nil { + var warmStoragePropertiesUsageStateDetails WarmStoragePropertiesUsageStateDetails + err = json.Unmarshal(*v, &warmStoragePropertiesUsageStateDetails) + if err != nil { + return err + } + wspu.WarmStoragePropertiesUsageStateDetails = &warmStoragePropertiesUsageStateDetails + } + } + } + + return nil +} + +// WarmStoragePropertiesUsageStateDetails an object that contains the details about warm storage properties +// usage state. +type WarmStoragePropertiesUsageStateDetails struct { + // CurrentCount - A value that represents the number of properties used by the environment for S1/S2 SKU and number of properties used by Warm Store for PAYG SKU + CurrentCount *int32 `json:"currentCount,omitempty"` + // MaxCount - A value that represents the maximum number of properties used allowed by the environment for S1/S2 SKU and maximum number of properties allowed by Warm Store for PAYG SKU. + MaxCount *int32 `json:"maxCount,omitempty"` +} + +// WarmStoreConfigurationProperties the warm store configuration provides the details to create a warm +// store cache that will retain a copy of the environment's data available for faster query. +type WarmStoreConfigurationProperties struct { + // DataRetention - ISO8601 timespan specifying the number of days the environment's events will be available for query from the warm store. + DataRetention *string `json:"dataRetention,omitempty"` +} diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/timeseriesinsightsapi/interfaces.go b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/timeseriesinsightsapi/interfaces.go index 5c7a76f3d4d8..66a97d23eb30 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/timeseriesinsightsapi/interfaces.go +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/timeseriesinsightsapi/interfaces.go @@ -37,7 +37,7 @@ type EnvironmentsClientAPI interface { Get(ctx context.Context, resourceGroupName string, environmentName string, expand string) (result timeseriesinsights.EnvironmentResourceModel, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result timeseriesinsights.EnvironmentListResponse, err error) ListBySubscription(ctx context.Context) (result timeseriesinsights.EnvironmentListResponse, err error) - Update(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters timeseriesinsights.EnvironmentUpdateParameters) (result timeseriesinsights.EnvironmentsUpdateFuture, err error) + Update(ctx context.Context, resourceGroupName string, environmentName string, standardEnvironmentUpdateParameters timeseriesinsights.StandardEnvironmentUpdateParameters) (result timeseriesinsights.EnvironmentsUpdateFuture, err error) } var _ EnvironmentsClientAPI = (*timeseriesinsights.EnvironmentsClient)(nil) diff --git a/services/resources/mgmt/2019-09-01/policy/assignments.go b/services/resources/mgmt/2019-09-01/policy/assignments.go new file mode 100644 index 000000000000..1828ec35d2a9 --- /dev/null +++ b/services/resources/mgmt/2019-09-01/policy/assignments.go @@ -0,0 +1,966 @@ +package policy + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AssignmentsClient is the to manage and control access to your resources, you can define customized policies and +// assign them at a scope. +type AssignmentsClient struct { + BaseClient +} + +// NewAssignmentsClient creates an instance of the AssignmentsClient client. +func NewAssignmentsClient(subscriptionID string) AssignmentsClient { + return NewAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAssignmentsClientWithBaseURI creates an instance of the AssignmentsClient client. +func NewAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) AssignmentsClient { + return AssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create this operation creates or updates a policy assignment with the given scope and name. Policy assignments apply +// to all resources contained within their scope. For example, when you assign a policy at resource group scope, that +// policy applies to all resources in the group. +// Parameters: +// scope - the scope of the policy assignment. Valid scopes are: management group (format: +// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: +// '/subscriptions/{subscriptionId}'), resource group (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' +// policyAssignmentName - the name of the policy assignment. +// parameters - parameters for the policy assignment. +func (client AssignmentsClient) Create(ctx context.Context, scope string, policyAssignmentName string, parameters Assignment) (result Assignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policy.AssignmentsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, scope, policyAssignmentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client AssignmentsClient) CreatePreparer(ctx context.Context, scope string, policyAssignmentName string, parameters Assignment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "scope": scope, + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Type = nil + parameters.Name = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) CreateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) CreateResponder(resp *http.Response) (result Assignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateByID this operation creates or updates the policy assignment with the given ID. Policy assignments made on a +// scope apply to all resources contained in that scope. For example, when you assign a policy to a resource group that +// policy applies to all resources in the group. Policy assignment IDs have this format: +// '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management +// group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: +// '/subscriptions/{subscriptionId}'), resource group (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. +// Parameters: +// policyAssignmentID - the ID of the policy assignment to create. Use the format +// '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. +// parameters - parameters for policy assignment. +func (client AssignmentsClient) CreateByID(ctx context.Context, policyAssignmentID string, parameters Assignment) (result Assignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.CreateByID") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policy.AssignmentsClient", "CreateByID", err.Error()) + } + + req, err := client.CreateByIDPreparer(ctx, policyAssignmentID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "CreateByID", nil, "Failure preparing request") + return + } + + resp, err := client.CreateByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "CreateByID", resp, "Failure sending request") + return + } + + result, err = client.CreateByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "CreateByID", resp, "Failure responding to request") + } + + return +} + +// CreateByIDPreparer prepares the CreateByID request. +func (client AssignmentsClient) CreateByIDPreparer(ctx context.Context, policyAssignmentID string, parameters Assignment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyAssignmentId": policyAssignmentID, + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Type = nil + parameters.Name = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{policyAssignmentId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateByIDSender sends the CreateByID request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) CreateByIDSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateByIDResponder handles the response to the CreateByID request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) CreateByIDResponder(resp *http.Response) (result Assignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete this operation deletes a policy assignment, given its name and the scope it was created in. The scope of a +// policy assignment is the part of its ID preceding +// '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. +// Parameters: +// scope - the scope of the policy assignment. Valid scopes are: management group (format: +// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: +// '/subscriptions/{subscriptionId}'), resource group (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' +// policyAssignmentName - the name of the policy assignment to delete. +func (client AssignmentsClient) Delete(ctx context.Context, scope string, policyAssignmentName string) (result Assignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.Delete") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, scope, policyAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AssignmentsClient) DeletePreparer(ctx context.Context, scope string, policyAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "scope": scope, + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) DeleteResponder(resp *http.Response) (result Assignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteByID this operation deletes the policy with the given ID. Policy assignment IDs have this format: +// '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} are: +// '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), +// '/subscriptions/{subscriptionId}' (subscription), +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' +// (resource). +// Parameters: +// policyAssignmentID - the ID of the policy assignment to delete. Use the format +// '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. +func (client AssignmentsClient) DeleteByID(ctx context.Context, policyAssignmentID string) (result Assignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.DeleteByID") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteByIDPreparer(ctx, policyAssignmentID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "DeleteByID", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "DeleteByID", resp, "Failure sending request") + return + } + + result, err = client.DeleteByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "DeleteByID", resp, "Failure responding to request") + } + + return +} + +// DeleteByIDPreparer prepares the DeleteByID request. +func (client AssignmentsClient) DeleteByIDPreparer(ctx context.Context, policyAssignmentID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyAssignmentId": policyAssignmentID, + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{policyAssignmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteByIDSender sends the DeleteByID request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) DeleteByIDSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteByIDResponder handles the response to the DeleteByID request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) DeleteByIDResponder(resp *http.Response) (result Assignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get this operation retrieves a single policy assignment, given its name and the scope it was created at. +// Parameters: +// scope - the scope of the policy assignment. Valid scopes are: management group (format: +// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: +// '/subscriptions/{subscriptionId}'), resource group (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' +// policyAssignmentName - the name of the policy assignment to get. +func (client AssignmentsClient) Get(ctx context.Context, scope string, policyAssignmentName string) (result Assignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, scope, policyAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AssignmentsClient) GetPreparer(ctx context.Context, scope string, policyAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyAssignmentName": autorest.Encode("path", policyAssignmentName), + "scope": scope, + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) GetResponder(resp *http.Response) (result Assignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByID the operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: +// '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: management +// group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: +// '/subscriptions/{subscriptionId}'), resource group (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: +// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. +// Parameters: +// policyAssignmentID - the ID of the policy assignment to get. Use the format +// '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. +func (client AssignmentsClient) GetByID(ctx context.Context, policyAssignmentID string) (result Assignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.GetByID") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByIDPreparer(ctx, policyAssignmentID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "GetByID", nil, "Failure preparing request") + return + } + + resp, err := client.GetByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "GetByID", resp, "Failure sending request") + return + } + + result, err = client.GetByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "GetByID", resp, "Failure responding to request") + } + + return +} + +// GetByIDPreparer prepares the GetByID request. +func (client AssignmentsClient) GetByIDPreparer(ctx context.Context, policyAssignmentID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyAssignmentId": policyAssignmentID, + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{policyAssignmentId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByIDSender sends the GetByID request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) GetByIDSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetByIDResponder handles the response to the GetByID request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) GetByIDResponder(resp *http.Response) (result Assignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List this operation retrieves the list of all policy assignments associated with the given subscription that match +// the optional given $filter. Valid values for $filter are: 'atScope()' or 'policyDefinitionId eq '{value}''. If +// $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, +// including those that apply directly or from management groups that contain the given subscription, as well as any +// applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes +// all policy assignments that apply to the subscription, which is everything in the unfiltered list except those +// applied to objects contained within the subscription. If $filter=policyDefinitionId eq '{value}' is provided, the +// returned list includes all policy assignments of the policy definition whose id is {value}. +// Parameters: +// filter - the filter to apply on the operation. Valid values for $filter are: 'atScope()' or +// 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. +func (client AssignmentsClient) List(ctx context.Context, filter string) (result AssignmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.List") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", resp, "Failure sending request") + return + } + + result.alr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AssignmentsClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) ListResponder(resp *http.Response) (result AssignmentListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AssignmentsClient) listNextResults(ctx context.Context, lastResults AssignmentListResult) (result AssignmentListResult, err error) { + req, err := lastResults.assignmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AssignmentsClient) ListComplete(ctx context.Context, filter string) (result AssignmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// ListForResource this operation retrieves the list of all policy assignments associated with the specified resource +// in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: +// 'atScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all +// policy assignments associated with the resource, including those that apply directly or from all containing scopes, +// as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned +// list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except +// those applied to resources contained within the resource. If $filter=policyDefinitionId eq '{value}' is provided, +// the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the +// resource. Three parameters plus the resource name are used to identify a specific resource. If the resource is not +// part of a parent resource (the more common case), the parent resource path should not be provided (or provided as +// ''). For example a web app could be specified as ({resourceProviderNamespace} == 'Microsoft.Web', +// {parentResourcePath} == '', {resourceType} == 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a +// parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified +// as ({resourceProviderNamespace} == 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', +// {resourceType} == 'domainNames', {resourceName} == 'MyComputerName'). A convenient alternative to providing the +// namespace and type name separately is to provide both in the {resourceType} parameter, format: +// ({resourceProviderNamespace} == '', {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', +// {resourceName} == 'MyWebApp'). +// Parameters: +// resourceGroupName - the name of the resource group containing the resource. +// resourceProviderNamespace - the namespace of the resource provider. For example, the namespace of a virtual +// machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) +// parentResourcePath - the parent resource path. Use empty string if there is none. +// resourceType - the resource type name. For example the type name of a web app is 'sites' (from +// Microsoft.Web/sites). +// resourceName - the name of the resource. +// filter - the filter to apply on the operation. Valid values for $filter are: 'atScope()' or +// 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. +func (client AssignmentsClient) ListForResource(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result AssignmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.ListForResource") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("policy.AssignmentsClient", "ListForResource", err.Error()) + } + + result.fn = client.listForResourceNextResults + req, err := client.ListForResourcePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListForResourceSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", resp, "Failure sending request") + return + } + + result.alr, err = client.ListForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", resp, "Failure responding to request") + } + + return +} + +// ListForResourcePreparer prepares the ListForResource request. +func (client AssignmentsClient) ListForResourcePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "parentResourcePath": parentResourcePath, + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace), + "resourceType": resourceType, + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForResourceSender sends the ListForResource request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) ListForResourceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListForResourceResponder handles the response to the ListForResource request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) ListForResourceResponder(resp *http.Response) (result AssignmentListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForResourceNextResults retrieves the next set of results, if any. +func (client AssignmentsClient) listForResourceNextResults(ctx context.Context, lastResults AssignmentListResult) (result AssignmentListResult, err error) { + req, err := lastResults.assignmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listForResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listForResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listForResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client AssignmentsClient) ListForResourceComplete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result AssignmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.ListForResource") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListForResource(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter) + return +} + +// ListForResourceGroup this operation retrieves the list of all policy assignments associated with the given resource +// group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()' or +// 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments +// associated with the resource group, including those that apply directly or apply from containing scopes, as well as +// any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list +// includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except +// those applied to resources contained within the resource group. If $filter=policyDefinitionId eq '{value}' is +// provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply +// to the resource group. +// Parameters: +// resourceGroupName - the name of the resource group that contains policy assignments. +// filter - the filter to apply on the operation. Valid values for $filter are: 'atScope()' or +// 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. +func (client AssignmentsClient) ListForResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result AssignmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.ListForResourceGroup") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("policy.AssignmentsClient", "ListForResourceGroup", err.Error()) + } + + result.fn = client.listForResourceGroupNextResults + req, err := client.ListForResourceGroupPreparer(ctx, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListForResourceGroupSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", resp, "Failure sending request") + return + } + + result.alr, err = client.ListForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListForResourceGroupPreparer prepares the ListForResourceGroup request. +func (client AssignmentsClient) ListForResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListForResourceGroupSender sends the ListForResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AssignmentsClient) ListForResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListForResourceGroupResponder handles the response to the ListForResourceGroup request. The method always +// closes the http.Response Body. +func (client AssignmentsClient) ListForResourceGroupResponder(resp *http.Response) (result AssignmentListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listForResourceGroupNextResults retrieves the next set of results, if any. +func (client AssignmentsClient) listForResourceGroupNextResults(ctx context.Context, lastResults AssignmentListResult) (result AssignmentListResult, err error) { + req, err := lastResults.assignmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listForResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listForResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "listForResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListForResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AssignmentsClient) ListForResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result AssignmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentsClient.ListForResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListForResourceGroup(ctx, resourceGroupName, filter) + return +} diff --git a/services/resources/mgmt/2019-09-01/policy/client.go b/services/resources/mgmt/2019-09-01/policy/client.go new file mode 100644 index 000000000000..5f51f601e186 --- /dev/null +++ b/services/resources/mgmt/2019-09-01/policy/client.go @@ -0,0 +1,51 @@ +// Package policy implements the Azure ARM Policy service API version 2019-09-01. +// +// To manage and control access to your resources, you can define customized policies and assign them at a scope. +package policy + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Policy + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Policy. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/resources/mgmt/2019-09-01/policy/definitions.go b/services/resources/mgmt/2019-09-01/policy/definitions.go new file mode 100644 index 000000000000..dd3b3621eaf4 --- /dev/null +++ b/services/resources/mgmt/2019-09-01/policy/definitions.go @@ -0,0 +1,910 @@ +package policy + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DefinitionsClient is the to manage and control access to your resources, you can define customized policies and +// assign them at a scope. +type DefinitionsClient struct { + BaseClient +} + +// NewDefinitionsClient creates an instance of the DefinitionsClient client. +func NewDefinitionsClient(subscriptionID string) DefinitionsClient { + return NewDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDefinitionsClientWithBaseURI creates an instance of the DefinitionsClient client. +func NewDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) DefinitionsClient { + return DefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate this operation creates or updates a policy definition in the given subscription with the given name. +// Parameters: +// policyDefinitionName - the name of the policy definition to create. +// parameters - the policy definition properties. +func (client DefinitionsClient) CreateOrUpdate(ctx context.Context, policyDefinitionName string, parameters Definition) (result Definition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, policyDefinitionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, policyDefinitionName string, parameters Definition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Name = nil + parameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result Definition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateAtManagementGroup this operation creates or updates a policy definition in the given management group +// with the given name. +// Parameters: +// policyDefinitionName - the name of the policy definition to create. +// parameters - the policy definition properties. +// managementGroupID - the ID of the management group. +func (client DefinitionsClient) CreateOrUpdateAtManagementGroup(ctx context.Context, policyDefinitionName string, parameters Definition, managementGroupID string) (result Definition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.CreateOrUpdateAtManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdateAtManagementGroupPreparer(ctx, policyDefinitionName, parameters, managementGroupID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdateAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdateAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "CreateOrUpdateAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateAtManagementGroupPreparer prepares the CreateOrUpdateAtManagementGroup request. +func (client DefinitionsClient) CreateOrUpdateAtManagementGroupPreparer(ctx context.Context, policyDefinitionName string, parameters Definition, managementGroupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Name = nil + parameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateAtManagementGroupSender sends the CreateOrUpdateAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) CreateOrUpdateAtManagementGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateAtManagementGroupResponder handles the response to the CreateOrUpdateAtManagementGroup request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) CreateOrUpdateAtManagementGroupResponder(resp *http.Response) (result Definition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete this operation deletes the policy definition in the given subscription with the given name. +// Parameters: +// policyDefinitionName - the name of the policy definition to delete. +func (client DefinitionsClient) Delete(ctx context.Context, policyDefinitionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policyDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DefinitionsClient) DeletePreparer(ctx context.Context, policyDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteAtManagementGroup this operation deletes the policy definition in the given management group with the given +// name. +// Parameters: +// policyDefinitionName - the name of the policy definition to delete. +// managementGroupID - the ID of the management group. +func (client DefinitionsClient) DeleteAtManagementGroup(ctx context.Context, policyDefinitionName string, managementGroupID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.DeleteAtManagementGroup") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteAtManagementGroupPreparer(ctx, policyDefinitionName, managementGroupID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "DeleteAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteAtManagementGroupSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "DeleteAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.DeleteAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "DeleteAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// DeleteAtManagementGroupPreparer prepares the DeleteAtManagementGroup request. +func (client DefinitionsClient) DeleteAtManagementGroupPreparer(ctx context.Context, policyDefinitionName string, managementGroupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteAtManagementGroupSender sends the DeleteAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) DeleteAtManagementGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteAtManagementGroupResponder handles the response to the DeleteAtManagementGroup request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) DeleteAtManagementGroupResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get this operation retrieves the policy definition in the given subscription with the given name. +// Parameters: +// policyDefinitionName - the name of the policy definition to get. +func (client DefinitionsClient) Get(ctx context.Context, policyDefinitionName string) (result Definition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policyDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DefinitionsClient) GetPreparer(ctx context.Context, policyDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) GetResponder(resp *http.Response) (result Definition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAtManagementGroup this operation retrieves the policy definition in the given management group with the given +// name. +// Parameters: +// policyDefinitionName - the name of the policy definition to get. +// managementGroupID - the ID of the management group. +func (client DefinitionsClient) GetAtManagementGroup(ctx context.Context, policyDefinitionName string, managementGroupID string) (result Definition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.GetAtManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAtManagementGroupPreparer(ctx, policyDefinitionName, managementGroupID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "GetAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.GetAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "GetAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.GetAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "GetAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// GetAtManagementGroupPreparer prepares the GetAtManagementGroup request. +func (client DefinitionsClient) GetAtManagementGroupPreparer(ctx context.Context, policyDefinitionName string, managementGroupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAtManagementGroupSender sends the GetAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) GetAtManagementGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAtManagementGroupResponder handles the response to the GetAtManagementGroup request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) GetAtManagementGroupResponder(resp *http.Response) (result Definition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBuiltIn this operation retrieves the built-in policy definition with the given name. +// Parameters: +// policyDefinitionName - the name of the built-in policy definition to get. +func (client DefinitionsClient) GetBuiltIn(ctx context.Context, policyDefinitionName string) (result Definition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.GetBuiltIn") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetBuiltInPreparer(ctx, policyDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "GetBuiltIn", nil, "Failure preparing request") + return + } + + resp, err := client.GetBuiltInSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "GetBuiltIn", resp, "Failure sending request") + return + } + + result, err = client.GetBuiltInResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "GetBuiltIn", resp, "Failure responding to request") + } + + return +} + +// GetBuiltInPreparer prepares the GetBuiltIn request. +func (client DefinitionsClient) GetBuiltInPreparer(ctx context.Context, policyDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyDefinitionName": autorest.Encode("path", policyDefinitionName), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBuiltInSender sends the GetBuiltIn request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) GetBuiltInSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetBuiltInResponder handles the response to the GetBuiltIn request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) GetBuiltInResponder(resp *http.Response) (result Definition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List this operation retrieves a list of all the policy definitions in a given subscription. +func (client DefinitionsClient) List(ctx context.Context) (result DefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.List") + defer func() { + sc := -1 + if result.dlr.Response.Response != nil { + sc = result.dlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", resp, "Failure sending request") + return + } + + result.dlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DefinitionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) ListResponder(resp *http.Response) (result DefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DefinitionsClient) listNextResults(ctx context.Context, lastResults DefinitionListResult) (result DefinitionListResult, err error) { + req, err := lastResults.definitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DefinitionsClient) ListComplete(ctx context.Context) (result DefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListBuiltIn this operation retrieves a list of all the built-in policy definitions. +func (client DefinitionsClient) ListBuiltIn(ctx context.Context) (result DefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.ListBuiltIn") + defer func() { + sc := -1 + if result.dlr.Response.Response != nil { + sc = result.dlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBuiltInNextResults + req, err := client.ListBuiltInPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "ListBuiltIn", nil, "Failure preparing request") + return + } + + resp, err := client.ListBuiltInSender(req) + if err != nil { + result.dlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "ListBuiltIn", resp, "Failure sending request") + return + } + + result.dlr, err = client.ListBuiltInResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "ListBuiltIn", resp, "Failure responding to request") + } + + return +} + +// ListBuiltInPreparer prepares the ListBuiltIn request. +func (client DefinitionsClient) ListBuiltInPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Authorization/policyDefinitions"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBuiltInSender sends the ListBuiltIn request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) ListBuiltInSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBuiltInResponder handles the response to the ListBuiltIn request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) ListBuiltInResponder(resp *http.Response) (result DefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBuiltInNextResults retrieves the next set of results, if any. +func (client DefinitionsClient) listBuiltInNextResults(ctx context.Context, lastResults DefinitionListResult) (result DefinitionListResult, err error) { + req, err := lastResults.definitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listBuiltInNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBuiltInSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listBuiltInNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBuiltInResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listBuiltInNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBuiltInComplete enumerates all values, automatically crossing page boundaries as required. +func (client DefinitionsClient) ListBuiltInComplete(ctx context.Context) (result DefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.ListBuiltIn") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBuiltIn(ctx) + return +} + +// ListByManagementGroup this operation retrieves a list of all the policy definitions in a given management group. +// Parameters: +// managementGroupID - the ID of the management group. +func (client DefinitionsClient) ListByManagementGroup(ctx context.Context, managementGroupID string) (result DefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.ListByManagementGroup") + defer func() { + sc := -1 + if result.dlr.Response.Response != nil { + sc = result.dlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByManagementGroupNextResults + req, err := client.ListByManagementGroupPreparer(ctx, managementGroupID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "ListByManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByManagementGroupSender(req) + if err != nil { + result.dlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "ListByManagementGroup", resp, "Failure sending request") + return + } + + result.dlr, err = client.ListByManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "ListByManagementGroup", resp, "Failure responding to request") + } + + return +} + +// ListByManagementGroupPreparer prepares the ListByManagementGroup request. +func (client DefinitionsClient) ListByManagementGroupPreparer(ctx context.Context, managementGroupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByManagementGroupSender sends the ListByManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DefinitionsClient) ListByManagementGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByManagementGroupResponder handles the response to the ListByManagementGroup request. The method always +// closes the http.Response Body. +func (client DefinitionsClient) ListByManagementGroupResponder(resp *http.Response) (result DefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByManagementGroupNextResults retrieves the next set of results, if any. +func (client DefinitionsClient) listByManagementGroupNextResults(ctx context.Context, lastResults DefinitionListResult) (result DefinitionListResult, err error) { + req, err := lastResults.definitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listByManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listByManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "listByManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DefinitionsClient) ListByManagementGroupComplete(ctx context.Context, managementGroupID string) (result DefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionsClient.ListByManagementGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByManagementGroup(ctx, managementGroupID) + return +} diff --git a/services/resources/mgmt/2019-09-01/policy/models.go b/services/resources/mgmt/2019-09-01/policy/models.go new file mode 100644 index 000000000000..814e5645f18b --- /dev/null +++ b/services/resources/mgmt/2019-09-01/policy/models.go @@ -0,0 +1,1120 @@ +package policy + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-09-01/policy" + +// EnforcementMode enumerates the values for enforcement mode. +type EnforcementMode string + +const ( + // Default The policy effect is enforced during resource creation or update. + Default EnforcementMode = "Default" + // DoNotEnforce The policy effect is not enforced during resource creation or update. + DoNotEnforce EnforcementMode = "DoNotEnforce" +) + +// PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. +func PossibleEnforcementModeValues() []EnforcementMode { + return []EnforcementMode{Default, DoNotEnforce} +} + +// ParameterType enumerates the values for parameter type. +type ParameterType string + +const ( + // Array ... + Array ParameterType = "Array" + // Boolean ... + Boolean ParameterType = "Boolean" + // DateTime ... + DateTime ParameterType = "DateTime" + // Float ... + Float ParameterType = "Float" + // Integer ... + Integer ParameterType = "Integer" + // Object ... + Object ParameterType = "Object" + // String ... + String ParameterType = "String" +) + +// PossibleParameterTypeValues returns an array of possible values for the ParameterType const type. +func PossibleParameterTypeValues() []ParameterType { + return []ParameterType{Array, Boolean, DateTime, Float, Integer, Object, String} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned} +} + +// Type enumerates the values for type. +type Type string + +const ( + // BuiltIn ... + BuiltIn Type = "BuiltIn" + // Custom ... + Custom Type = "Custom" + // NotSpecified ... + NotSpecified Type = "NotSpecified" + // Static ... + Static Type = "Static" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{BuiltIn, Custom, NotSpecified, Static} +} + +// Assignment the policy assignment. +type Assignment struct { + autorest.Response `json:"-"` + // AssignmentProperties - Properties for the policy assignment. + *AssignmentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The ID of the policy assignment. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the policy assignment. + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; The name of the policy assignment. + Name *string `json:"name,omitempty"` + // Sku - The policy sku. This property is optional, obsolete, and will be ignored. + Sku *Sku `json:"sku,omitempty"` + // Location - The location of the policy assignment. Only required when utilizing managed identity. + Location *string `json:"location,omitempty"` + // Identity - The managed identity associated with the policy assignment. + Identity *Identity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for Assignment. +func (a Assignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AssignmentProperties != nil { + objectMap["properties"] = a.AssignmentProperties + } + if a.Sku != nil { + objectMap["sku"] = a.Sku + } + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.Identity != nil { + objectMap["identity"] = a.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Assignment struct. +func (a *Assignment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var assignmentProperties AssignmentProperties + err = json.Unmarshal(*v, &assignmentProperties) + if err != nil { + return err + } + a.AssignmentProperties = &assignmentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + a.Sku = &sku + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + a.Identity = &identity + } + } + } + + return nil +} + +// AssignmentListResult list of policy assignments. +type AssignmentListResult struct { + autorest.Response `json:"-"` + // Value - An array of policy assignments. + Value *[]Assignment `json:"value,omitempty"` + // NextLink - The URL to use for getting the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AssignmentListResultIterator provides access to a complete listing of Assignment values. +type AssignmentListResultIterator struct { + i int + page AssignmentListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AssignmentListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AssignmentListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AssignmentListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AssignmentListResultIterator) Response() AssignmentListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AssignmentListResultIterator) Value() Assignment { + if !iter.page.NotDone() { + return Assignment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AssignmentListResultIterator type. +func NewAssignmentListResultIterator(page AssignmentListResultPage) AssignmentListResultIterator { + return AssignmentListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr AssignmentListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// assignmentListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr AssignmentListResult) assignmentListResultPreparer(ctx context.Context) (*http.Request, error) { + if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// AssignmentListResultPage contains a page of Assignment values. +type AssignmentListResultPage struct { + fn func(context.Context, AssignmentListResult) (AssignmentListResult, error) + alr AssignmentListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AssignmentListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssignmentListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AssignmentListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AssignmentListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AssignmentListResultPage) Response() AssignmentListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AssignmentListResultPage) Values() []Assignment { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// Creates a new instance of the AssignmentListResultPage type. +func NewAssignmentListResultPage(getNextPage func(context.Context, AssignmentListResult) (AssignmentListResult, error)) AssignmentListResultPage { + return AssignmentListResultPage{fn: getNextPage} +} + +// AssignmentProperties the policy assignment properties. +type AssignmentProperties struct { + // DisplayName - The display name of the policy assignment. + DisplayName *string `json:"displayName,omitempty"` + // PolicyDefinitionID - The ID of the policy definition or policy set definition being assigned. + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // Scope - The scope for the policy assignment. + Scope *string `json:"scope,omitempty"` + // NotScopes - The policy's excluded scopes. + NotScopes *[]string `json:"notScopes,omitempty"` + // Parameters - The parameter values for the assigned policy rule. The keys are the parameter names. + Parameters map[string]*ParameterValuesValue `json:"parameters"` + // Description - This message will be part of response in case of policy violation. + Description *string `json:"description,omitempty"` + // Metadata - The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. + Metadata interface{} `json:"metadata,omitempty"` + // EnforcementMode - The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. Possible values include: 'Default', 'DoNotEnforce' + EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` +} + +// MarshalJSON is the custom marshaler for AssignmentProperties. +func (ap AssignmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.DisplayName != nil { + objectMap["displayName"] = ap.DisplayName + } + if ap.PolicyDefinitionID != nil { + objectMap["policyDefinitionId"] = ap.PolicyDefinitionID + } + if ap.Scope != nil { + objectMap["scope"] = ap.Scope + } + if ap.NotScopes != nil { + objectMap["notScopes"] = ap.NotScopes + } + if ap.Parameters != nil { + objectMap["parameters"] = ap.Parameters + } + if ap.Description != nil { + objectMap["description"] = ap.Description + } + if ap.Metadata != nil { + objectMap["metadata"] = ap.Metadata + } + if ap.EnforcementMode != "" { + objectMap["enforcementMode"] = ap.EnforcementMode + } + return json.Marshal(objectMap) +} + +// CloudError an error response from a policy operation. +type CloudError struct { + Error *ErrorResponse `json:"error,omitempty"` +} + +// Definition the policy definition. +type Definition struct { + autorest.Response `json:"-"` + // DefinitionProperties - The policy definition properties. + *DefinitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The ID of the policy definition. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the policy definition. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource (Microsoft.Authorization/policyDefinitions). + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Definition. +func (d Definition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DefinitionProperties != nil { + objectMap["properties"] = d.DefinitionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Definition struct. +func (d *Definition) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var definitionProperties DefinitionProperties + err = json.Unmarshal(*v, &definitionProperties) + if err != nil { + return err + } + d.DefinitionProperties = &definitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + } + } + + return nil +} + +// DefinitionGroup the policy definition group. +type DefinitionGroup struct { + // Name - The name of the group. + Name *string `json:"name,omitempty"` + // DisplayName - The group's display name. + DisplayName *string `json:"displayName,omitempty"` + // Category - The group's category. + Category *string `json:"category,omitempty"` + // Description - The group's description. + Description *string `json:"description,omitempty"` + // AdditionalMetadataID - A resource ID of a resource that contains additional metadata about the group. + AdditionalMetadataID *string `json:"additionalMetadataId,omitempty"` +} + +// DefinitionListResult list of policy definitions. +type DefinitionListResult struct { + autorest.Response `json:"-"` + // Value - An array of policy definitions. + Value *[]Definition `json:"value,omitempty"` + // NextLink - The URL to use for getting the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DefinitionListResultIterator provides access to a complete listing of Definition values. +type DefinitionListResultIterator struct { + i int + page DefinitionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DefinitionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DefinitionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DefinitionListResultIterator) Response() DefinitionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DefinitionListResultIterator) Value() Definition { + if !iter.page.NotDone() { + return Definition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DefinitionListResultIterator type. +func NewDefinitionListResultIterator(page DefinitionListResultPage) DefinitionListResultIterator { + return DefinitionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dlr DefinitionListResult) IsEmpty() bool { + return dlr.Value == nil || len(*dlr.Value) == 0 +} + +// definitionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dlr DefinitionListResult) definitionListResultPreparer(ctx context.Context) (*http.Request, error) { + if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dlr.NextLink))) +} + +// DefinitionListResultPage contains a page of Definition values. +type DefinitionListResultPage struct { + fn func(context.Context, DefinitionListResult) (DefinitionListResult, error) + dlr DefinitionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DefinitionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.dlr) + if err != nil { + return err + } + page.dlr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DefinitionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DefinitionListResultPage) NotDone() bool { + return !page.dlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DefinitionListResultPage) Response() DefinitionListResult { + return page.dlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DefinitionListResultPage) Values() []Definition { + if page.dlr.IsEmpty() { + return nil + } + return *page.dlr.Value +} + +// Creates a new instance of the DefinitionListResultPage type. +func NewDefinitionListResultPage(getNextPage func(context.Context, DefinitionListResult) (DefinitionListResult, error)) DefinitionListResultPage { + return DefinitionListResultPage{fn: getNextPage} +} + +// DefinitionProperties the policy definition properties. +type DefinitionProperties struct { + // PolicyType - The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom', 'Static' + PolicyType Type `json:"policyType,omitempty"` + // Mode - The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. + Mode *string `json:"mode,omitempty"` + // DisplayName - The display name of the policy definition. + DisplayName *string `json:"displayName,omitempty"` + // Description - The policy definition description. + Description *string `json:"description,omitempty"` + // PolicyRule - The policy rule. + PolicyRule interface{} `json:"policyRule,omitempty"` + // Metadata - The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. + Metadata interface{} `json:"metadata,omitempty"` + // Parameters - The parameter definitions for parameters used in the policy rule. The keys are the parameter names. + Parameters map[string]*ParameterDefinitionsValue `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for DefinitionProperties. +func (dp DefinitionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.PolicyType != "" { + objectMap["policyType"] = dp.PolicyType + } + if dp.Mode != nil { + objectMap["mode"] = dp.Mode + } + if dp.DisplayName != nil { + objectMap["displayName"] = dp.DisplayName + } + if dp.Description != nil { + objectMap["description"] = dp.Description + } + if dp.PolicyRule != nil { + objectMap["policyRule"] = dp.PolicyRule + } + if dp.Metadata != nil { + objectMap["metadata"] = dp.Metadata + } + if dp.Parameters != nil { + objectMap["parameters"] = dp.Parameters + } + return json.Marshal(objectMap) +} + +// DefinitionReference the policy definition reference. +type DefinitionReference struct { + // PolicyDefinitionID - The ID of the policy definition or policy set definition. + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // Parameters - The parameter values for the referenced policy rule. The keys are the parameter names. + Parameters map[string]*ParameterValuesValue `json:"parameters"` + // PolicyDefinitionReferenceID - A unique id (within the policy set definition) for this policy definition reference. + PolicyDefinitionReferenceID *string `json:"policyDefinitionReferenceId,omitempty"` + // GroupNames - The name of the groups that this policy definition reference belongs to. + GroupNames *[]string `json:"groupNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefinitionReference. +func (dr DefinitionReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dr.PolicyDefinitionID != nil { + objectMap["policyDefinitionId"] = dr.PolicyDefinitionID + } + if dr.Parameters != nil { + objectMap["parameters"] = dr.Parameters + } + if dr.PolicyDefinitionReferenceID != nil { + objectMap["policyDefinitionReferenceId"] = dr.PolicyDefinitionReferenceID + } + if dr.GroupNames != nil { + objectMap["groupNames"] = dr.GroupNames + } + return json.Marshal(objectMap) +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// ErrorResponse the resource management error response. +type ErrorResponse struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// Identity identity for the resource. +type Identity struct { + // PrincipalID - READ-ONLY; The principal ID of the resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of the resource identity. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'SystemAssigned', 'None' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// ParameterDefinitionsValue ... +type ParameterDefinitionsValue struct { + // Type - The data type of the parameter. Possible values include: 'String', 'Array', 'Object', 'Boolean', 'Integer', 'Float', 'DateTime' + Type ParameterType `json:"type,omitempty"` + // AllowedValues - The allowed values for the parameter. + AllowedValues *[]interface{} `json:"allowedValues,omitempty"` + // DefaultValue - The default value for the parameter if no value is provided. + DefaultValue interface{} `json:"defaultValue,omitempty"` + // Metadata - General metadata for the parameter. + Metadata *ParameterDefinitionsValueMetadata `json:"metadata,omitempty"` +} + +// ParameterDefinitionsValueMetadata general metadata for the parameter. +type ParameterDefinitionsValueMetadata struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // DisplayName - The display name for the parameter. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the parameter. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ParameterDefinitionsValueMetadata. +func (pdv ParameterDefinitionsValueMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pdv.DisplayName != nil { + objectMap["displayName"] = pdv.DisplayName + } + if pdv.Description != nil { + objectMap["description"] = pdv.Description + } + for k, v := range pdv.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ParameterDefinitionsValueMetadata struct. +func (pdv *ParameterDefinitionsValueMetadata) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if pdv.AdditionalProperties == nil { + pdv.AdditionalProperties = make(map[string]interface{}) + } + pdv.AdditionalProperties[k] = additionalProperties + } + case "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + pdv.DisplayName = &displayName + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + pdv.Description = &description + } + } + } + + return nil +} + +// ParameterValuesValue ... +type ParameterValuesValue struct { + // Value - The value of the parameter. + Value interface{} `json:"value,omitempty"` +} + +// SetDefinition the policy set definition. +type SetDefinition struct { + autorest.Response `json:"-"` + // SetDefinitionProperties - The policy definition properties. + *SetDefinitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The ID of the policy set definition. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the policy set definition. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource (Microsoft.Authorization/policySetDefinitions). + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SetDefinition. +func (sd SetDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sd.SetDefinitionProperties != nil { + objectMap["properties"] = sd.SetDefinitionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SetDefinition struct. +func (sd *SetDefinition) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var setDefinitionProperties SetDefinitionProperties + err = json.Unmarshal(*v, &setDefinitionProperties) + if err != nil { + return err + } + sd.SetDefinitionProperties = &setDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sd.Type = &typeVar + } + } + } + + return nil +} + +// SetDefinitionListResult list of policy set definitions. +type SetDefinitionListResult struct { + autorest.Response `json:"-"` + // Value - An array of policy set definitions. + Value *[]SetDefinition `json:"value,omitempty"` + // NextLink - The URL to use for getting the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SetDefinitionListResultIterator provides access to a complete listing of SetDefinition values. +type SetDefinitionListResultIterator struct { + i int + page SetDefinitionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SetDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SetDefinitionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SetDefinitionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SetDefinitionListResultIterator) Response() SetDefinitionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SetDefinitionListResultIterator) Value() SetDefinition { + if !iter.page.NotDone() { + return SetDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SetDefinitionListResultIterator type. +func NewSetDefinitionListResultIterator(page SetDefinitionListResultPage) SetDefinitionListResultIterator { + return SetDefinitionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sdlr SetDefinitionListResult) IsEmpty() bool { + return sdlr.Value == nil || len(*sdlr.Value) == 0 +} + +// setDefinitionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sdlr SetDefinitionListResult) setDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { + if sdlr.NextLink == nil || len(to.String(sdlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sdlr.NextLink))) +} + +// SetDefinitionListResultPage contains a page of SetDefinition values. +type SetDefinitionListResultPage struct { + fn func(context.Context, SetDefinitionListResult) (SetDefinitionListResult, error) + sdlr SetDefinitionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SetDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sdlr) + if err != nil { + return err + } + page.sdlr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SetDefinitionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SetDefinitionListResultPage) NotDone() bool { + return !page.sdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SetDefinitionListResultPage) Response() SetDefinitionListResult { + return page.sdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SetDefinitionListResultPage) Values() []SetDefinition { + if page.sdlr.IsEmpty() { + return nil + } + return *page.sdlr.Value +} + +// Creates a new instance of the SetDefinitionListResultPage type. +func NewSetDefinitionListResultPage(getNextPage func(context.Context, SetDefinitionListResult) (SetDefinitionListResult, error)) SetDefinitionListResultPage { + return SetDefinitionListResultPage{fn: getNextPage} +} + +// SetDefinitionProperties the policy set definition properties. +type SetDefinitionProperties struct { + // PolicyType - The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. Possible values include: 'NotSpecified', 'BuiltIn', 'Custom', 'Static' + PolicyType Type `json:"policyType,omitempty"` + // DisplayName - The display name of the policy set definition. + DisplayName *string `json:"displayName,omitempty"` + // Description - The policy set definition description. + Description *string `json:"description,omitempty"` + // Metadata - The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. + Metadata interface{} `json:"metadata,omitempty"` + // Parameters - The policy set definition parameters that can be used in policy definition references. + Parameters map[string]*ParameterDefinitionsValue `json:"parameters"` + // PolicyDefinitions - An array of policy definition references. + PolicyDefinitions *[]DefinitionReference `json:"policyDefinitions,omitempty"` + // PolicyDefinitionGroups - The metadata describing groups of policy definition references within the policy set definition. + PolicyDefinitionGroups *[]DefinitionGroup `json:"policyDefinitionGroups,omitempty"` +} + +// MarshalJSON is the custom marshaler for SetDefinitionProperties. +func (sdp SetDefinitionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdp.PolicyType != "" { + objectMap["policyType"] = sdp.PolicyType + } + if sdp.DisplayName != nil { + objectMap["displayName"] = sdp.DisplayName + } + if sdp.Description != nil { + objectMap["description"] = sdp.Description + } + if sdp.Metadata != nil { + objectMap["metadata"] = sdp.Metadata + } + if sdp.Parameters != nil { + objectMap["parameters"] = sdp.Parameters + } + if sdp.PolicyDefinitions != nil { + objectMap["policyDefinitions"] = sdp.PolicyDefinitions + } + if sdp.PolicyDefinitionGroups != nil { + objectMap["policyDefinitionGroups"] = sdp.PolicyDefinitionGroups + } + return json.Marshal(objectMap) +} + +// Sku the policy sku. This property is optional, obsolete, and will be ignored. +type Sku struct { + // Name - The name of the policy sku. Possible values are A0 and A1. + Name *string `json:"name,omitempty"` + // Tier - The policy sku tier. Possible values are Free and Standard. + Tier *string `json:"tier,omitempty"` +} diff --git a/services/resources/mgmt/2019-09-01/policy/policyapi/interfaces.go b/services/resources/mgmt/2019-09-01/policy/policyapi/interfaces.go new file mode 100644 index 000000000000..c4c6e9309bd6 --- /dev/null +++ b/services/resources/mgmt/2019-09-01/policy/policyapi/interfaces.go @@ -0,0 +1,71 @@ +package policyapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-09-01/policy" + "github.com/Azure/go-autorest/autorest" +) + +// AssignmentsClientAPI contains the set of methods on the AssignmentsClient type. +type AssignmentsClientAPI interface { + Create(ctx context.Context, scope string, policyAssignmentName string, parameters policy.Assignment) (result policy.Assignment, err error) + CreateByID(ctx context.Context, policyAssignmentID string, parameters policy.Assignment) (result policy.Assignment, err error) + Delete(ctx context.Context, scope string, policyAssignmentName string) (result policy.Assignment, err error) + DeleteByID(ctx context.Context, policyAssignmentID string) (result policy.Assignment, err error) + Get(ctx context.Context, scope string, policyAssignmentName string) (result policy.Assignment, err error) + GetByID(ctx context.Context, policyAssignmentID string) (result policy.Assignment, err error) + List(ctx context.Context, filter string) (result policy.AssignmentListResultPage, err error) + ListForResource(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result policy.AssignmentListResultPage, err error) + ListForResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result policy.AssignmentListResultPage, err error) +} + +var _ AssignmentsClientAPI = (*policy.AssignmentsClient)(nil) + +// DefinitionsClientAPI contains the set of methods on the DefinitionsClient type. +type DefinitionsClientAPI interface { + CreateOrUpdate(ctx context.Context, policyDefinitionName string, parameters policy.Definition) (result policy.Definition, err error) + CreateOrUpdateAtManagementGroup(ctx context.Context, policyDefinitionName string, parameters policy.Definition, managementGroupID string) (result policy.Definition, err error) + Delete(ctx context.Context, policyDefinitionName string) (result autorest.Response, err error) + DeleteAtManagementGroup(ctx context.Context, policyDefinitionName string, managementGroupID string) (result autorest.Response, err error) + Get(ctx context.Context, policyDefinitionName string) (result policy.Definition, err error) + GetAtManagementGroup(ctx context.Context, policyDefinitionName string, managementGroupID string) (result policy.Definition, err error) + GetBuiltIn(ctx context.Context, policyDefinitionName string) (result policy.Definition, err error) + List(ctx context.Context) (result policy.DefinitionListResultPage, err error) + ListBuiltIn(ctx context.Context) (result policy.DefinitionListResultPage, err error) + ListByManagementGroup(ctx context.Context, managementGroupID string) (result policy.DefinitionListResultPage, err error) +} + +var _ DefinitionsClientAPI = (*policy.DefinitionsClient)(nil) + +// SetDefinitionsClientAPI contains the set of methods on the SetDefinitionsClient type. +type SetDefinitionsClientAPI interface { + CreateOrUpdate(ctx context.Context, policySetDefinitionName string, parameters policy.SetDefinition) (result policy.SetDefinition, err error) + CreateOrUpdateAtManagementGroup(ctx context.Context, policySetDefinitionName string, parameters policy.SetDefinition, managementGroupID string) (result policy.SetDefinition, err error) + Delete(ctx context.Context, policySetDefinitionName string) (result autorest.Response, err error) + DeleteAtManagementGroup(ctx context.Context, policySetDefinitionName string, managementGroupID string) (result autorest.Response, err error) + Get(ctx context.Context, policySetDefinitionName string) (result policy.SetDefinition, err error) + GetAtManagementGroup(ctx context.Context, policySetDefinitionName string, managementGroupID string) (result policy.SetDefinition, err error) + GetBuiltIn(ctx context.Context, policySetDefinitionName string) (result policy.SetDefinition, err error) + List(ctx context.Context) (result policy.SetDefinitionListResultPage, err error) + ListBuiltIn(ctx context.Context) (result policy.SetDefinitionListResultPage, err error) + ListByManagementGroup(ctx context.Context, managementGroupID string) (result policy.SetDefinitionListResultPage, err error) +} + +var _ SetDefinitionsClientAPI = (*policy.SetDefinitionsClient)(nil) diff --git a/services/resources/mgmt/2019-09-01/policy/setdefinitions.go b/services/resources/mgmt/2019-09-01/policy/setdefinitions.go new file mode 100644 index 000000000000..34a78b50a3f5 --- /dev/null +++ b/services/resources/mgmt/2019-09-01/policy/setdefinitions.go @@ -0,0 +1,927 @@ +package policy + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SetDefinitionsClient is the to manage and control access to your resources, you can define customized policies and +// assign them at a scope. +type SetDefinitionsClient struct { + BaseClient +} + +// NewSetDefinitionsClient creates an instance of the SetDefinitionsClient client. +func NewSetDefinitionsClient(subscriptionID string) SetDefinitionsClient { + return NewSetDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSetDefinitionsClientWithBaseURI creates an instance of the SetDefinitionsClient client. +func NewSetDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) SetDefinitionsClient { + return SetDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate this operation creates or updates a policy set definition in the given subscription with the given +// name. +// Parameters: +// policySetDefinitionName - the name of the policy set definition to create. +// parameters - the policy set definition properties. +func (client SetDefinitionsClient) CreateOrUpdate(ctx context.Context, policySetDefinitionName string, parameters SetDefinition) (result SetDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SetDefinitionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SetDefinitionProperties.PolicyDefinitions", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policy.SetDefinitionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, policySetDefinitionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SetDefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, policySetDefinitionName string, parameters SetDefinition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Name = nil + parameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result SetDefinition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateAtManagementGroup this operation creates or updates a policy set definition in the given management +// group with the given name. +// Parameters: +// policySetDefinitionName - the name of the policy set definition to create. +// parameters - the policy set definition properties. +// managementGroupID - the ID of the management group. +func (client SetDefinitionsClient) CreateOrUpdateAtManagementGroup(ctx context.Context, policySetDefinitionName string, parameters SetDefinition, managementGroupID string) (result SetDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.CreateOrUpdateAtManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SetDefinitionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SetDefinitionProperties.PolicyDefinitions", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("policy.SetDefinitionsClient", "CreateOrUpdateAtManagementGroup", err.Error()) + } + + req, err := client.CreateOrUpdateAtManagementGroupPreparer(ctx, policySetDefinitionName, parameters, managementGroupID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "CreateOrUpdateAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "CreateOrUpdateAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "CreateOrUpdateAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateAtManagementGroupPreparer prepares the CreateOrUpdateAtManagementGroup request. +func (client SetDefinitionsClient) CreateOrUpdateAtManagementGroupPreparer(ctx context.Context, policySetDefinitionName string, parameters SetDefinition, managementGroupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Name = nil + parameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateAtManagementGroupSender sends the CreateOrUpdateAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) CreateOrUpdateAtManagementGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// CreateOrUpdateAtManagementGroupResponder handles the response to the CreateOrUpdateAtManagementGroup request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) CreateOrUpdateAtManagementGroupResponder(resp *http.Response) (result SetDefinition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete this operation deletes the policy set definition in the given subscription with the given name. +// Parameters: +// policySetDefinitionName - the name of the policy set definition to delete. +func (client SetDefinitionsClient) Delete(ctx context.Context, policySetDefinitionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, policySetDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SetDefinitionsClient) DeletePreparer(ctx context.Context, policySetDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteAtManagementGroup this operation deletes the policy set definition in the given management group with the +// given name. +// Parameters: +// policySetDefinitionName - the name of the policy set definition to delete. +// managementGroupID - the ID of the management group. +func (client SetDefinitionsClient) DeleteAtManagementGroup(ctx context.Context, policySetDefinitionName string, managementGroupID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.DeleteAtManagementGroup") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteAtManagementGroupPreparer(ctx, policySetDefinitionName, managementGroupID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "DeleteAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteAtManagementGroupSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "DeleteAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.DeleteAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "DeleteAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// DeleteAtManagementGroupPreparer prepares the DeleteAtManagementGroup request. +func (client SetDefinitionsClient) DeleteAtManagementGroupPreparer(ctx context.Context, policySetDefinitionName string, managementGroupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteAtManagementGroupSender sends the DeleteAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) DeleteAtManagementGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteAtManagementGroupResponder handles the response to the DeleteAtManagementGroup request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) DeleteAtManagementGroupResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get this operation retrieves the policy set definition in the given subscription with the given name. +// Parameters: +// policySetDefinitionName - the name of the policy set definition to get. +func (client SetDefinitionsClient) Get(ctx context.Context, policySetDefinitionName string) (result SetDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, policySetDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SetDefinitionsClient) GetPreparer(ctx context.Context, policySetDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) GetResponder(resp *http.Response) (result SetDefinition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAtManagementGroup this operation retrieves the policy set definition in the given management group with the given +// name. +// Parameters: +// policySetDefinitionName - the name of the policy set definition to get. +// managementGroupID - the ID of the management group. +func (client SetDefinitionsClient) GetAtManagementGroup(ctx context.Context, policySetDefinitionName string, managementGroupID string) (result SetDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.GetAtManagementGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAtManagementGroupPreparer(ctx, policySetDefinitionName, managementGroupID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "GetAtManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.GetAtManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "GetAtManagementGroup", resp, "Failure sending request") + return + } + + result, err = client.GetAtManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "GetAtManagementGroup", resp, "Failure responding to request") + } + + return +} + +// GetAtManagementGroupPreparer prepares the GetAtManagementGroup request. +func (client SetDefinitionsClient) GetAtManagementGroupPreparer(ctx context.Context, policySetDefinitionName string, managementGroupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAtManagementGroupSender sends the GetAtManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) GetAtManagementGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetAtManagementGroupResponder handles the response to the GetAtManagementGroup request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) GetAtManagementGroupResponder(resp *http.Response) (result SetDefinition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBuiltIn this operation retrieves the built-in policy set definition with the given name. +// Parameters: +// policySetDefinitionName - the name of the policy set definition to get. +func (client SetDefinitionsClient) GetBuiltIn(ctx context.Context, policySetDefinitionName string) (result SetDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.GetBuiltIn") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetBuiltInPreparer(ctx, policySetDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "GetBuiltIn", nil, "Failure preparing request") + return + } + + resp, err := client.GetBuiltInSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "GetBuiltIn", resp, "Failure sending request") + return + } + + result, err = client.GetBuiltInResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "GetBuiltIn", resp, "Failure responding to request") + } + + return +} + +// GetBuiltInPreparer prepares the GetBuiltIn request. +func (client SetDefinitionsClient) GetBuiltInPreparer(ctx context.Context, policySetDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBuiltInSender sends the GetBuiltIn request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) GetBuiltInSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetBuiltInResponder handles the response to the GetBuiltIn request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) GetBuiltInResponder(resp *http.Response) (result SetDefinition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List this operation retrieves a list of all the policy set definitions in the given subscription. +func (client SetDefinitionsClient) List(ctx context.Context) (result SetDefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.List") + defer func() { + sc := -1 + if result.sdlr.Response.Response != nil { + sc = result.sdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "List", resp, "Failure sending request") + return + } + + result.sdlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SetDefinitionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) ListResponder(resp *http.Response) (result SetDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SetDefinitionsClient) listNextResults(ctx context.Context, lastResults SetDefinitionListResult) (result SetDefinitionListResult, err error) { + req, err := lastResults.setDefinitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SetDefinitionsClient) ListComplete(ctx context.Context) (result SetDefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListBuiltIn this operation retrieves a list of all the built-in policy set definitions. +func (client SetDefinitionsClient) ListBuiltIn(ctx context.Context) (result SetDefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.ListBuiltIn") + defer func() { + sc := -1 + if result.sdlr.Response.Response != nil { + sc = result.sdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBuiltInNextResults + req, err := client.ListBuiltInPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "ListBuiltIn", nil, "Failure preparing request") + return + } + + resp, err := client.ListBuiltInSender(req) + if err != nil { + result.sdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "ListBuiltIn", resp, "Failure sending request") + return + } + + result.sdlr, err = client.ListBuiltInResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "ListBuiltIn", resp, "Failure responding to request") + } + + return +} + +// ListBuiltInPreparer prepares the ListBuiltIn request. +func (client SetDefinitionsClient) ListBuiltInPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Authorization/policySetDefinitions"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBuiltInSender sends the ListBuiltIn request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) ListBuiltInSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListBuiltInResponder handles the response to the ListBuiltIn request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) ListBuiltInResponder(resp *http.Response) (result SetDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBuiltInNextResults retrieves the next set of results, if any. +func (client SetDefinitionsClient) listBuiltInNextResults(ctx context.Context, lastResults SetDefinitionListResult) (result SetDefinitionListResult, err error) { + req, err := lastResults.setDefinitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listBuiltInNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBuiltInSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listBuiltInNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBuiltInResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listBuiltInNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBuiltInComplete enumerates all values, automatically crossing page boundaries as required. +func (client SetDefinitionsClient) ListBuiltInComplete(ctx context.Context) (result SetDefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.ListBuiltIn") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBuiltIn(ctx) + return +} + +// ListByManagementGroup this operation retrieves a list of all the a policy set definition in the given management +// group. +// Parameters: +// managementGroupID - the ID of the management group. +func (client SetDefinitionsClient) ListByManagementGroup(ctx context.Context, managementGroupID string) (result SetDefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.ListByManagementGroup") + defer func() { + sc := -1 + if result.sdlr.Response.Response != nil { + sc = result.sdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByManagementGroupNextResults + req, err := client.ListByManagementGroupPreparer(ctx, managementGroupID) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "ListByManagementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByManagementGroupSender(req) + if err != nil { + result.sdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "ListByManagementGroup", resp, "Failure sending request") + return + } + + result.sdlr, err = client.ListByManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "ListByManagementGroup", resp, "Failure responding to request") + } + + return +} + +// ListByManagementGroupPreparer prepares the ListByManagementGroup request. +func (client SetDefinitionsClient) ListByManagementGroupPreparer(ctx context.Context, managementGroupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + } + + const APIVersion = "2019-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementgroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByManagementGroupSender sends the ListByManagementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SetDefinitionsClient) ListByManagementGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByManagementGroupResponder handles the response to the ListByManagementGroup request. The method always +// closes the http.Response Body. +func (client SetDefinitionsClient) ListByManagementGroupResponder(resp *http.Response) (result SetDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByManagementGroupNextResults retrieves the next set of results, if any. +func (client SetDefinitionsClient) listByManagementGroupNextResults(ctx context.Context, lastResults SetDefinitionListResult) (result SetDefinitionListResult, err error) { + req, err := lastResults.setDefinitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listByManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listByManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "listByManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SetDefinitionsClient) ListByManagementGroupComplete(ctx context.Context, managementGroupID string) (result SetDefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SetDefinitionsClient.ListByManagementGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByManagementGroup(ctx, managementGroupID) + return +} diff --git a/services/resources/mgmt/2019-09-01/policy/version.go b/services/resources/mgmt/2019-09-01/policy/version.go new file mode 100644 index 000000000000..abcb254ae768 --- /dev/null +++ b/services/resources/mgmt/2019-09-01/policy/version.go @@ -0,0 +1,30 @@ +package policy + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " policy/2019-09-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/serialconsole/mgmt/2018-05-01/serialconsole/client.go b/services/serialconsole/mgmt/2018-05-01/serialconsole/client.go index 33d59a00a544..fdc5b4671f12 100644 --- a/services/serialconsole/mgmt/2018-05-01/serialconsole/client.go +++ b/services/serialconsole/mgmt/2018-05-01/serialconsole/client.go @@ -1,6 +1,6 @@ // Package serialconsole implements the Azure ARM Serialconsole service API version 2018-05-01. // -// Azure Virtual Machine Serial Console allows you to access serial console of a Virtual Machine +// The Azure Serial Console allows you to access the serial console of a Virtual Machine or VM scale set instance package serialconsole // Copyright (c) Microsoft and contributors. All rights reserved. @@ -21,7 +21,11 @@ package serialconsole // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "context" "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" ) const ( @@ -49,3 +53,296 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { SubscriptionID: subscriptionID, } } + +// DisableConsole disables the Serial Console service for all VMs and VM scale sets in the provided subscription +// Parameters: +// defaultParameter - default parameter. Leave the value as "default". +func (client BaseClient) DisableConsole(ctx context.Context, defaultParameter string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableConsole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DisableConsolePreparer(ctx, defaultParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "DisableConsole", nil, "Failure preparing request") + return + } + + resp, err := client.DisableConsoleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "DisableConsole", resp, "Failure sending request") + return + } + + result, err = client.DisableConsoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "DisableConsole", resp, "Failure responding to request") + } + + return +} + +// DisableConsolePreparer prepares the DisableConsole request. +func (client BaseClient) DisableConsolePreparer(ctx context.Context, defaultParameter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "default": autorest.Encode("path", defaultParameter), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableConsoleSender sends the DisableConsole request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DisableConsoleSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DisableConsoleResponder handles the response to the DisableConsole request. The method always +// closes the http.Response Body. +func (client BaseClient) DisableConsoleResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// EnableConsole enables the Serial Console service for all VMs and VM scale sets in the provided subscription +// Parameters: +// defaultParameter - default parameter. Leave the value as "default". +func (client BaseClient) EnableConsole(ctx context.Context, defaultParameter string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableConsole") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.EnableConsolePreparer(ctx, defaultParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "EnableConsole", nil, "Failure preparing request") + return + } + + resp, err := client.EnableConsoleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "EnableConsole", resp, "Failure sending request") + return + } + + result, err = client.EnableConsoleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "EnableConsole", resp, "Failure responding to request") + } + + return +} + +// EnableConsolePreparer prepares the EnableConsole request. +func (client BaseClient) EnableConsolePreparer(ctx context.Context, defaultParameter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "default": autorest.Encode("path", defaultParameter), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EnableConsoleSender sends the EnableConsole request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) EnableConsoleSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// EnableConsoleResponder handles the response to the EnableConsole request. The method always +// closes the http.Response Body. +func (client BaseClient) EnableConsoleResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetConsoleStatus gets whether or not Serial Console is disabled for a given subscription +// Parameters: +// defaultParameter - default parameter. Leave the value as "default". +func (client BaseClient) GetConsoleStatus(ctx context.Context, defaultParameter string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetConsoleStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetConsoleStatusPreparer(ctx, defaultParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "GetConsoleStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetConsoleStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "GetConsoleStatus", resp, "Failure sending request") + return + } + + result, err = client.GetConsoleStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "GetConsoleStatus", resp, "Failure responding to request") + } + + return +} + +// GetConsoleStatusPreparer prepares the GetConsoleStatus request. +func (client BaseClient) GetConsoleStatusPreparer(ctx context.Context, defaultParameter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "default": autorest.Encode("path", defaultParameter), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetConsoleStatusSender sends the GetConsoleStatus request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetConsoleStatusSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetConsoleStatusResponder handles the response to the GetConsoleStatus request. The method always +// closes the http.Response Body. +func (client BaseClient) GetConsoleStatusResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOperations gets a list of Serial Console API operations. +func (client BaseClient) ListOperations(ctx context.Context) (result Operations, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListOperations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListOperationsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "ListOperations", nil, "Failure preparing request") + return + } + + resp, err := client.ListOperationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "ListOperations", resp, "Failure sending request") + return + } + + result, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "serialconsole.BaseClient", "ListOperations", resp, "Failure responding to request") + } + + return +} + +// ListOperationsPreparer prepares the ListOperations request. +func (client BaseClient) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2018-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.SerialConsole/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOperationsSender sends the ListOperations request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListOperationsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListOperationsResponder handles the response to the ListOperations request. The method always +// closes the http.Response Body. +func (client BaseClient) ListOperationsResponder(resp *http.Response) (result Operations, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/serialconsole/mgmt/2018-05-01/serialconsole/console.go b/services/serialconsole/mgmt/2018-05-01/serialconsole/console.go deleted file mode 100644 index 5e3ffc917c3d..000000000000 --- a/services/serialconsole/mgmt/2018-05-01/serialconsole/console.go +++ /dev/null @@ -1,187 +0,0 @@ -package serialconsole - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ConsoleClient is the azure Virtual Machine Serial Console allows you to access serial console of a Virtual Machine -type ConsoleClient struct { - BaseClient -} - -// NewConsoleClient creates an instance of the ConsoleClient client. -func NewConsoleClient(subscriptionID string) ConsoleClient { - return NewConsoleClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewConsoleClientWithBaseURI creates an instance of the ConsoleClient client. -func NewConsoleClientWithBaseURI(baseURI string, subscriptionID string) ConsoleClient { - return ConsoleClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// DisableConsole disables Serial Console for a subscription -func (client ConsoleClient) DisableConsole(ctx context.Context) (result SetDisabledResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConsoleClient.DisableConsole") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DisableConsolePreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "serialconsole.ConsoleClient", "DisableConsole", nil, "Failure preparing request") - return - } - - resp, err := client.DisableConsoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "serialconsole.ConsoleClient", "DisableConsole", resp, "Failure sending request") - return - } - - result, err = client.DisableConsoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "serialconsole.ConsoleClient", "DisableConsole", resp, "Failure responding to request") - } - - return -} - -// DisableConsolePreparer prepares the DisableConsole request. -func (client ConsoleClient) DisableConsolePreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "default": autorest.Encode("path", "default"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisableConsoleSender sends the DisableConsole request. The method will close the -// http.Response Body if it receives an error. -func (client ConsoleClient) DisableConsoleSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// DisableConsoleResponder handles the response to the DisableConsole request. The method always -// closes the http.Response Body. -func (client ConsoleClient) DisableConsoleResponder(resp *http.Response) (result SetDisabledResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// EnableConsole enables Serial Console for a subscription -func (client ConsoleClient) EnableConsole(ctx context.Context) (result SetDisabledResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConsoleClient.EnableConsole") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.EnableConsolePreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "serialconsole.ConsoleClient", "EnableConsole", nil, "Failure preparing request") - return - } - - resp, err := client.EnableConsoleSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "serialconsole.ConsoleClient", "EnableConsole", resp, "Failure sending request") - return - } - - result, err = client.EnableConsoleResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "serialconsole.ConsoleClient", "EnableConsole", resp, "Failure responding to request") - } - - return -} - -// EnableConsolePreparer prepares the EnableConsole request. -func (client ConsoleClient) EnableConsolePreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "default": autorest.Encode("path", "default"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnableConsoleSender sends the EnableConsole request. The method will close the -// http.Response Body if it receives an error. -func (client ConsoleClient) EnableConsoleSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// EnableConsoleResponder handles the response to the EnableConsole request. The method always -// closes the http.Response Body. -func (client ConsoleClient) EnableConsoleResponder(resp *http.Response) (result SetDisabledResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/serialconsole/mgmt/2018-05-01/serialconsole/list.go b/services/serialconsole/mgmt/2018-05-01/serialconsole/list.go deleted file mode 100644 index bd4b390191ee..000000000000 --- a/services/serialconsole/mgmt/2018-05-01/serialconsole/list.go +++ /dev/null @@ -1,113 +0,0 @@ -package serialconsole - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ListClient is the azure Virtual Machine Serial Console allows you to access serial console of a Virtual Machine -type ListClient struct { - BaseClient -} - -// NewListClient creates an instance of the ListClient client. -func NewListClient(subscriptionID string) ListClient { - return NewListClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewListClientWithBaseURI creates an instance of the ListClient client. -func NewListClientWithBaseURI(baseURI string, subscriptionID string) ListClient { - return ListClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Operations gets a list of Serial Console API operations. -func (client ListClient) Operations(ctx context.Context) (result Operations, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListClient.Operations") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.OperationsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "serialconsole.ListClient", "Operations", nil, "Failure preparing request") - return - } - - resp, err := client.OperationsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "serialconsole.ListClient", "Operations", resp, "Failure sending request") - return - } - - result, err = client.OperationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "serialconsole.ListClient", "Operations", resp, "Failure responding to request") - } - - return -} - -// OperationsPreparer prepares the Operations request. -func (client ListClient) OperationsPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/operations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// OperationsSender sends the Operations request. The method will close the -// http.Response Body if it receives an error. -func (client ListClient) OperationsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// OperationsResponder handles the response to the Operations request. The method always -// closes the http.Response Body. -func (client ListClient) OperationsResponder(resp *http.Response) (result Operations, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/serialconsole/mgmt/2018-05-01/serialconsole/listconsole.go b/services/serialconsole/mgmt/2018-05-01/serialconsole/listconsole.go deleted file mode 100644 index 672535b7725c..000000000000 --- a/services/serialconsole/mgmt/2018-05-01/serialconsole/listconsole.go +++ /dev/null @@ -1,115 +0,0 @@ -package serialconsole - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ListConsoleClient is the azure Virtual Machine Serial Console allows you to access serial console of a Virtual -// Machine -type ListConsoleClient struct { - BaseClient -} - -// NewListConsoleClient creates an instance of the ListConsoleClient client. -func NewListConsoleClient(subscriptionID string) ListConsoleClient { - return NewListConsoleClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewListConsoleClientWithBaseURI creates an instance of the ListConsoleClient client. -func NewListConsoleClientWithBaseURI(baseURI string, subscriptionID string) ListConsoleClient { - return ListConsoleClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Disabled gets if Serial Console is disabled for a subscription. -func (client ListConsoleClient) Disabled(ctx context.Context) (result GetDisabledResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListConsoleClient.Disabled") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DisabledPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "serialconsole.ListConsoleClient", "Disabled", nil, "Failure preparing request") - return - } - - resp, err := client.DisabledSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "serialconsole.ListConsoleClient", "Disabled", resp, "Failure sending request") - return - } - - result, err = client.DisabledResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "serialconsole.ListConsoleClient", "Disabled", resp, "Failure responding to request") - } - - return -} - -// DisabledPreparer prepares the Disabled request. -func (client ListConsoleClient) DisabledPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "default": autorest.Encode("path", "default"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-05-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisabledSender sends the Disabled request. The method will close the -// http.Response Body if it receives an error. -func (client ListConsoleClient) DisabledSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// DisabledResponder handles the response to the Disabled request. The method always -// closes the http.Response Body. -func (client ListConsoleClient) DisabledResponder(resp *http.Response) (result GetDisabledResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/serialconsole/mgmt/2018-05-01/serialconsole/models.go b/services/serialconsole/mgmt/2018-05-01/serialconsole/models.go index 9f8a937e42d5..6e2a40f1484d 100644 --- a/services/serialconsole/mgmt/2018-05-01/serialconsole/models.go +++ b/services/serialconsole/mgmt/2018-05-01/serialconsole/models.go @@ -24,36 +24,56 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/serialconsole/mgmt/2018-05-01/serialconsole" -// DeploymentValidateResult details on Failure -type DeploymentValidateResult struct { - // ErrorMessage - Error message - ErrorMessage *string `json:"errorMessage,omitempty"` +// DisableSerialConsoleResult returns whether or not Serial Console is disabled. +type DisableSerialConsoleResult struct { + // Disabled - Whether or not Serial Console is disabled. + Disabled *bool `json:"disabled,omitempty"` } -// GetDisabledResult returns whether or not Serial Console is disabled for this given subscription -type GetDisabledResult struct { - autorest.Response `json:"-"` - // Disabled - Disabled result +// EnableSerialConsoleResult returns whether or not Serial Console is disabled (enabled). +type EnableSerialConsoleResult struct { + // Disabled - Whether or not Serial Console is disabled (enabled). Disabled *bool `json:"disabled,omitempty"` } -// GetResult returns whether or not Serial Console is disabled. -type GetResult struct { - // Value - Whether or not Serial Console is disabled. - Value *bool `json:"value,omitempty"` +// GetSerialConsoleSubscriptionNotFound error saying that the provided subscription could not be found +type GetSerialConsoleSubscriptionNotFound struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Subscription not found message + Message *string `json:"message,omitempty"` } // Operations serial Console operations type Operations struct { autorest.Response `json:"-"` - // Value - Serial Console operations - Value *string `json:"value,omitempty"` + // Value - A list of Serial Console operations + Value *[]OperationsValueItem `json:"value,omitempty"` +} + +// OperationsValueItem ... +type OperationsValueItem struct { + Name *string `json:"name,omitempty"` + IsDataAction *string `json:"isDataAction,omitempty"` + Display *OperationsValueItemDisplay `json:"display,omitempty"` } -// SetDisabledResult sets disable status and returns whether or not Serial Console is now disabled for this -// given subscription -type SetDisabledResult struct { +// OperationsValueItemDisplay ... +type OperationsValueItemDisplay struct { + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` + Operation *string `json:"operation,omitempty"` + Description *string `json:"description,omitempty"` +} + +// SetObject ... +type SetObject struct { autorest.Response `json:"-"` - // Disabled - Disabled result + Value interface{} `json:"value,omitempty"` +} + +// Status returns whether or not Serial Console is disabled. +type Status struct { + // Disabled - Whether or not Serial Console is disabled. Disabled *bool `json:"disabled,omitempty"` } diff --git a/services/serialconsole/mgmt/2018-05-01/serialconsole/serialconsoleapi/interfaces.go b/services/serialconsole/mgmt/2018-05-01/serialconsole/serialconsoleapi/interfaces.go index 085688c7f15c..def4c515dd0d 100644 --- a/services/serialconsole/mgmt/2018-05-01/serialconsole/serialconsoleapi/interfaces.go +++ b/services/serialconsole/mgmt/2018-05-01/serialconsole/serialconsoleapi/interfaces.go @@ -22,24 +22,12 @@ import ( "github.com/Azure/azure-sdk-for-go/services/serialconsole/mgmt/2018-05-01/serialconsole" ) -// ListClientAPI contains the set of methods on the ListClient type. -type ListClientAPI interface { - Operations(ctx context.Context) (result serialconsole.Operations, err error) +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + DisableConsole(ctx context.Context, defaultParameter string) (result serialconsole.SetObject, err error) + EnableConsole(ctx context.Context, defaultParameter string) (result serialconsole.SetObject, err error) + GetConsoleStatus(ctx context.Context, defaultParameter string) (result serialconsole.SetObject, err error) + ListOperations(ctx context.Context) (result serialconsole.Operations, err error) } -var _ ListClientAPI = (*serialconsole.ListClient)(nil) - -// ListConsoleClientAPI contains the set of methods on the ListConsoleClient type. -type ListConsoleClientAPI interface { - Disabled(ctx context.Context) (result serialconsole.GetDisabledResult, err error) -} - -var _ ListConsoleClientAPI = (*serialconsole.ListConsoleClient)(nil) - -// ConsoleClientAPI contains the set of methods on the ConsoleClient type. -type ConsoleClientAPI interface { - DisableConsole(ctx context.Context) (result serialconsole.SetDisabledResult, err error) - EnableConsole(ctx context.Context) (result serialconsole.SetDisabledResult, err error) -} - -var _ ConsoleClientAPI = (*serialconsole.ConsoleClient)(nil) +var _ BaseClientAPI = (*serialconsole.BaseClient)(nil) diff --git a/services/signalr/mgmt/2018-10-01/signalr/models.go b/services/signalr/mgmt/2018-10-01/signalr/models.go index 39a3e259d3a8..a500056701ec 100644 --- a/services/signalr/mgmt/2018-10-01/signalr/models.go +++ b/services/signalr/mgmt/2018-10-01/signalr/models.go @@ -30,6 +30,21 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2018-10-01/signalr" +// FeatureFlags enumerates the values for feature flags. +type FeatureFlags string + +const ( + // EnableConnectivityLogs ... + EnableConnectivityLogs FeatureFlags = "EnableConnectivityLogs" + // ServiceMode ... + ServiceMode FeatureFlags = "ServiceMode" +) + +// PossibleFeatureFlagsValues returns an array of possible values for the FeatureFlags const type. +func PossibleFeatureFlagsValues() []FeatureFlags { + return []FeatureFlags{EnableConnectivityLogs, ServiceMode} +} + // KeyType enumerates the values for key type. type KeyType string @@ -211,10 +226,31 @@ type Dimension struct { ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` } +// ErrorResponse contains information about an API error. +type ErrorResponse struct { + // Error - Describes a particular API error with an error code and a message. + Error *ErrorResponseBody `json:"error,omitempty"` +} + +// ErrorResponseBody describes a particular API error with an error code and a message. +type ErrorResponseBody struct { + // Code - An error code that describes the error condition more precisely than an HTTP status code. + // Can be used to programmatically handle specific error cases. + Code *string `json:"code,omitempty"` + // Message - A message that describes the error in detail and provides debugging information. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error (for example, the name of the property in error). + Target *string `json:"target,omitempty"` + // Details - Contains nested errors that are related to this error. + Details *[]ErrorResponseBody `json:"details,omitempty"` +} + // Feature feature of a SignalR resource, which controls the SignalR runtime behavior. type Feature struct { - // Flag - Kind of feature. Required. - Flag *string `json:"flag,omitempty"` + // Flag - FeatureFlags is the supported features of Azure SignalR service. + // - ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your application doesn't have a backend server; "Classic": for backward compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use. + // - EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category respectively. Possible values include: 'ServiceMode', 'EnableConnectivityLogs' + Flag FeatureFlags `json:"flag,omitempty"` // Value - Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/en-us/azure/azure-signalr/ for allowed values. Value *string `json:"value,omitempty"` // Properties - Optional properties related to this feature. @@ -224,7 +260,7 @@ type Feature struct { // MarshalJSON is the custom marshaler for Feature. func (f Feature) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if f.Flag != nil { + if f.Flag != "" { objectMap["flag"] = f.Flag } if f.Value != nil { @@ -249,6 +285,14 @@ type Keys struct { SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"` } +// LogSpecification specifications of the Logs for Azure Monitoring. +type LogSpecification struct { + // Name - Name of the log. + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the log. + DisplayName *string `json:"displayName,omitempty"` +} + // MetricSpecification specifications of the Metrics for Azure Monitoring. type MetricSpecification struct { // Name - Name of the metric. @@ -852,6 +896,8 @@ func (future *RestartFuture) Result(client Client) (ar autorest.Response, err er type ServiceSpecification struct { // MetricSpecifications - Specifications of the Metrics for Azure Monitoring. MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` + // LogSpecifications - Specifications of the Logs for Azure Monitoring. + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` } // TrackedResource the resource model definition for a ARM tracked top level resource. diff --git a/services/storage/mgmt/2019-06-01/storage/blobservices.go b/services/storage/mgmt/2019-06-01/storage/blobservices.go index bd3dc1ea0b20..8f29d93d078e 100644 --- a/services/storage/mgmt/2019-06-01/storage/blobservices.go +++ b/services/storage/mgmt/2019-06-01/storage/blobservices.go @@ -265,6 +265,12 @@ func (client BlobServicesClient) SetServiceProperties(ctx context.Context, resou {Target: "parameters.BlobServicePropertiesProperties.DeleteRetentionPolicy.Days", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, }}, }}, + {Target: "parameters.BlobServicePropertiesProperties.ContainerDeleteRetentionPolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.ContainerDeleteRetentionPolicy.Days", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.ContainerDeleteRetentionPolicy.Days", Name: validation.InclusiveMaximum, Rule: int64(365), Chain: nil}, + {Target: "parameters.BlobServicePropertiesProperties.ContainerDeleteRetentionPolicy.Days", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}, + }}, }}}}}); err != nil { return result, validation.NewError("storage.BlobServicesClient", "SetServiceProperties", err.Error()) } diff --git a/services/storage/mgmt/2019-06-01/storage/fileservices.go b/services/storage/mgmt/2019-06-01/storage/fileservices.go index 8e51cb0cb250..ff5cf18860cb 100644 --- a/services/storage/mgmt/2019-06-01/storage/fileservices.go +++ b/services/storage/mgmt/2019-06-01/storage/fileservices.go @@ -256,7 +256,16 @@ func (client FileServicesClient) SetServiceProperties(ctx context.Context, resou Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.FileServicePropertiesProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FileServicePropertiesProperties.ShareDeleteRetentionPolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FileServicePropertiesProperties.ShareDeleteRetentionPolicy.Days", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FileServicePropertiesProperties.ShareDeleteRetentionPolicy.Days", Name: validation.InclusiveMaximum, Rule: int64(365), Chain: nil}, + {Target: "parameters.FileServicePropertiesProperties.ShareDeleteRetentionPolicy.Days", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("storage.FileServicesClient", "SetServiceProperties", err.Error()) } diff --git a/services/storage/mgmt/2019-06-01/storage/models.go b/services/storage/mgmt/2019-06-01/storage/models.go index 7a0a714f741c..c83dfc8724a5 100644 --- a/services/storage/mgmt/2019-06-01/storage/models.go +++ b/services/storage/mgmt/2019-06-01/storage/models.go @@ -1502,12 +1502,14 @@ type BlobServicePropertiesProperties struct { Cors *CorsRules `json:"cors,omitempty"` // DefaultServiceVersion - DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. DefaultServiceVersion *string `json:"defaultServiceVersion,omitempty"` - // DeleteRetentionPolicy - The blob service properties for soft delete. + // DeleteRetentionPolicy - The blob service properties for blob soft delete. DeleteRetentionPolicy *DeleteRetentionPolicy `json:"deleteRetentionPolicy,omitempty"` // AutomaticSnapshotPolicyEnabled - Automatic Snapshot is enabled if set to true. AutomaticSnapshotPolicyEnabled *bool `json:"automaticSnapshotPolicyEnabled,omitempty"` // ChangeFeed - The blob service properties for change feed events. ChangeFeed *ChangeFeed `json:"changeFeed,omitempty"` + // ContainerDeleteRetentionPolicy - The blob service properties for container soft delete. + ContainerDeleteRetentionPolicy *DeleteRetentionPolicy `json:"containerDeleteRetentionPolicy,omitempty"` } // ChangeFeed the blob service properties for change feed events. @@ -1775,6 +1777,8 @@ func (fsp *FileServiceProperties) UnmarshalJSON(body []byte) error { type FileServicePropertiesProperties struct { // Cors - Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. Cors *CorsRules `json:"cors,omitempty"` + // ShareDeleteRetentionPolicy - The file service properties for share soft delete. + ShareDeleteRetentionPolicy *DeleteRetentionPolicy `json:"shareDeleteRetentionPolicy,omitempty"` } // FileShare properties of the file share, including Id, resource name, resource type, Etag. diff --git a/version/version.go b/version/version.go index f50d7da23510..4a5edd7cb681 100644 --- a/version/version.go +++ b/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v35.1.0" +const Number = "v36.0.0"