From 2e62f976f4de2713ef1b8bb3254bebb81b95b638 Mon Sep 17 00:00:00 2001 From: Arcturus Date: Tue, 7 Jan 2020 10:08:25 +0800 Subject: [PATCH] v38.0.0 (#6576) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [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 * Generated from a6daf4c9c7b1cfc18a382c62b4976f2e007a80ee (#6229) fix typo Diretory * Generated from 9b04684de70e634c8d4fa85d60138d4a1db84065 (#6238) Change type to object * Generated from 0210af2e5503488fd65957c1368f0794a7e782f0 (#6255) add PreferredIPVersion to ConnectivityCheck * Generated from 85d0f24f003c50b536c896138a30218c36cf310a (#6251) Addressing Spell check validation, changed the description * [AutoPR storage/resource-manager] [SRP][Fix Typo] DeleteRetentionPolicy is a common class that applies to both file and blob (#6250) * Generated from 6fdcf1e8098868c3b8216ac8e3babce62ad56d1e [SRP][Fix Typo] DeleteRetentionPolicy is a common class that applies to both file and blob * Generated from 6fdcf1e8098868c3b8216ac8e3babce62ad56d1e [SRP][Fix Typo] DeleteRetentionPolicy is a common class that applies to both file and blob * Generated from 1424fb90b9195f05229265d9b4147df55b3d5b6e (#6243) Fix * Generated from b6c83befb9732d44d75feb7ea12a8f198a853ec1 (#6260) Fix formatting * Generated from 3f60f47410cabe369be98ab8b7cd168756bfd5d9 (#6261) Add Microsoft.PolicyInsights/policyMetadata resource type spec * Generated from 84ce9e7f669adb50f2aaa62f3e12167edbea67e1 (#6269) Update spec and examples * Generated from 5384fe0c3361da843a2b55c9bb7aa55e494ab984 (#6263) [SRP] Remove a recent added property for container soft delete * Generated from 1e8bea7a181abb6181f79aa0319c293abbf95d7e (#6266) Updating examples * [AutoPR storage/resource-manager] [SRP] Add account sku to file/blob service response (#6267) * Generated from 4d9474e12075391cb75073fc6ae94ddd8eff4cdb Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into getservicesku * Generated from 4d9474e12075391cb75073fc6ae94ddd8eff4cdb Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into getservicesku * Generated from 041683be0cdb0426e8980f1a64cbce91241bee73 (#6247) [Datafactory] Enable SQL DW Copy Command * Generated from ce02bcef77b445fbe83c8bfdaa3fa15924efe56a (#6274) Merge branch 'master' into liran-dev-security-Microsoft.Security-2019-08-01 * Generated from 545db164471cc4f95bd68237971c43891a40d884 (#6277) remove locale from links * Generated from 0dc5634c5903bc4d13f936f6c39ccf0a6965de96 (#6278) remove locale from link * [AutoPR cdn/resource-manager] update description for UrlRewrite Action (#6268) * Generated from 2a23b07c8b2bfa82a1116c2c2280880c1241a8fc update comment * Generated from 9540dc91c52499e1c968bb715bffc9cc2577c557 update * Generated from 0cd1f96acaf7a73b29d816516c3b081b3f711799 (#6162) use secure link for documentation * Generated from 5fb6d44e6933230e3f88c488bdff8b22438b72cf (#6287) ANF-327 New swagger for 2019-08-01 API With upstream pull and rerun of prettier * Generated from f20be645a748cae6147290a5e091c348a9924902 (#6273) Code review fixes * [AutoPR sql/resource-manager] Update databaseVulnerabilityAssessments.json (#6272) * Generated from b2ff9bfa546b57e9905bb6f57322b1add1b29c17 Fixed documentation for storageAccountAccessKey parameter in SQL templates * Generated from b2ff9bfa546b57e9905bb6f57322b1add1b29c17 Fixed documentation for storageAccountAccessKey parameter in SQL templates * Generated from fa0523b043ef003c72ade04ddbf0a00f10d00c3b (#6307) Moving Priority and EvictionPolicy enum to the definitions section and adding 'Spot' priority * [AutoPR resources/resource-manager] Add new version for Microsoft.Solutions (#6253) * Generated from a91d692810c9a1298b0f6e5939659e5a5b0195e9 Fix PR comments. Remove update access since it should be internal only(used by PIM team) * Generated from 88ed32612d64850c82dd01b6980edcf7f0997c15 Capitalization to fix build. * Generated from 5be1da0610dd72272c94afd2c03601100de3b4df Read only properties * Generated from 98cefa2b437103affbcbfd6ce4c63061b24373ad Removed application definition artifact, which is internal and don't need a swagger. * [AutoPR cognitiveservices/data-plane/QnAMaker] [QnA Maker] Update API data fields. (#6289) * Generated from 10bb2e899dfa41564fa014275648f7e5daa17761 [QnA Maker] Update API data fields. * Generated from 670e771f95a96c8f9b94321fd499fba61bbba309 camel casing * Generated from 04ca3a88d31b7bda6982e2281216993545e61ff8 (#6313) Sql auditing swagger- update examples * Generated from cb0caf6c25ca5d28fdaeb005d6c9e53477176166 (#6296) Added enableCustomerAnalytics Flag to create SapMonitor * [AutoPR security/resource-manager] fix swagger completeness issue (#6311) * Generated from cd736d4605f25bafc1e210b4e83e6805863fe23f Merge pull request #2 from yibirnba2/swaggerCompletenessIssue Update operationId * Generated from e6e7573b8f17ee08d9ecc68eeaa525f51172f720 Merge pull request #3 from yibirnba2/swaggerCompletenessIssue Change operationId * Generated from cda6951d6e73baed7ab431b9a3c17aabfe7f2b02 (#6327) Fixing description for deleteEmptyServerFarm * Generated from 202c280ac47ce63c6d4480d4c271da833821378b (#6170) bump python sdk version to 0.3.0 * Generated from 59b008b02ef9d4b11bea303f3ba0a6d71c8985ad (#6333) Minor fix * Generated from 18dc9b0284cda48e71eea8526d1592ff7a44e985 (#6357) Add composite package for sql * Generated from 832cf0fea9b335b4b651208eabdfc01b80c274e0 (#6314) Update * [AutoPR compute/resource-manager] Adding "proximityPlacementGroup" property in "VirtualMachineScaleSetUpdateProperties". Adding "includeColocationStatus" optional flag as part of Get ProximityPlacementGroup URL (#6301) * Generated from 80c837ae06239705ae88dc34678c55b41be55334 making changes * Generated from eee3b6d1bddefc1777a676b10292593fdab97c3c making changes * [AutoPR containerservice/resource-manager] AKS: making the `count` field optiona; (#6302) * Generated from 2495a97b588dc0bef4afbae76f3df4461921073e 2019-10-01: allowing for `count` to be nil during updates * Generated from 27d03a14592691f08e01b1eb885a16cd74d9a9d5 kubernetes: removing the inclusiveMinumum since this is only applicable on creation * Generated from 1c3e1c696ee08a19ac689399f1b39dc4dd254780 (#6372) run prettier * [AutoPR compute/resource-manager] [Compute] Add patch spec for SharedImageGallery (#6320) * Generated from 861dd1bc2d11f46b781ac8e0ccd470bfe770125a change descriptions to updated * Generated from 50f8e2ff68772de9ca3bbd01baa59d1d8989a7b8 updateresource * Generated from c53057ddac2e6b3be44ff07da16ab09cdd77f936 Added example and id/type to UpdateResource * Generated from a5ef75d4927df2d8a8c967b993926766254cff30 add name * Generated from fd8f83b368a420de1057b009b7efeb5988d94cfb make gallery json pretty * Generated from 6be0dfe37350941e2f186d620c18a33615f0d72b (#6378) add AKS listClusterMonitoringUserCredential API * [AutoPR containerregistry/resource-manager] Panwang/taskruns (#6303) * Generated from 0aff28cdc236df42db680cf238d0d36f0c5ad5d3 Remove default response from swagger * Generated from c21bed5bdc9a77c0572d12e73faa3557c89b6cd9 add missing type * Generated from 9db43d8870a318c9ce12267b73aa4aac3f09b1b2 Revert changes for these two files. * Generated from 19671edd71bf89d2df6e25695e48d56b57d0ea98 Update error description * Generated from 6ac6e268eae9c51c39ffa3313ddd9f4fc4543487 (#6403) [SRP] Increase the max file share quota for LFS * Generated from e3a597fe31e3fe840445de05facd9a24b937fc9c (#6401) Merge remote-tracking branch 'upstream/master' * Generated from 732ab86bf2b6d48a82f71da16cda38426bd6f4e6 Maintenance: add readme.java.md with tags * Generated from f0e72d897029d6e7fccf7b99b696589864def0da removed resource conflict * Generated from 4dd708660b1fe07aa7ac0f08dc62d15ddc39d178 add version 2019-08-01 to preview * Generated from 7b90d52bfb2ef86c16b9ef23bec841feec127606 Merge branch 'master' into cosmos-python-afterscripts * Generated from 5084ecf452a19f4d2f40fc9f7ef1e823be81afcd rearranged tests * Generated from 9bf096e9a9c7322fd801364235daddd062879527 Updating the version to 2019-11-01 Updating the version to 2019-11-01 * Generated from 9bf096e9a9c7322fd801364235daddd062879527 Updating the version to 2019-11-01 Updating the version to 2019-11-01 * [AutoPR policyinsights/resource-manager] Fix Microsoft.policyInsights/policyMetadata query parameter (#6385) * Generated from a989d1c3759e3a241d2a3011c27b3988815a6300 Fix Microsoft.policyInsights/policyMetadata query parameter * Generated from b57d760f98cd19cd4164f61e976f61a9759b1860 Fix slim metadata properties * Generated from db239cc46757350995e9550c606b838278930d36 (#6343) customer lockbox preview swagger * Generated from aa17e4ecd833c5d63614fa55beb123bea03b37b4 (#6376) Adding MaxLength Validation to eventHubName * [AutoPR cdn/resource-manager] [CDN] Copy changes from API version 2019-04-15 into 2019-06-15-preview. (#6400) * Generated from 9eb5ce2a840c1c665d36a6da2a436ae5b0310435 Sync latest changes from CDN 2019-04-15 to 2019-06-15-preview * Generated from 05393216e4ed62e704d2a1dae890a3f9f1645ed5 Sync latest changes from CDN 2019-04-15 to 2019-06-15-preview * Generated from dcc8dc3f2f2654a45ef53be71368be83eaf44ebb (#6442) fix api method * [AutoPR datafactory/resource-manager] Update MySqlLinkedServiceTypeProperties and PostgreSqlLinkedServiceTy… (#6326) * Generated from 515979ad8a4a728feb04fcdcc61785c1f7895914 Update MySqlLinkedServiceTypeProperties and PostgreSqlLinkedServiceTypeProperties connectionString type object * Generated from a1ecfec4e43b84693ac05cf40b12edf707e13b28 Update * Generated from a1ecfec4e43b84693ac05cf40b12edf707e13b28 Update * [AutoPR resourcegraph/resource-manager] Microsoft.ResoureGraph/queries path typo fix (#6418) * Generated from 257f27fb2d50e20e7a0b899adc24123bb590cd62 typo fix * Generated from 658b7b9a0b033e3c3996847c45824546e4990c65 making validation pass * Generated from 469e1a6305c280790c34e2b09d6b4eaaebc6d5da (#6423) Adding incident info to GetBookmarks * Generated from latest swagger * Simple grammar fix * Generated from d62eb16808d56932d9ee52faec9af253d36b1f09 (#6471) Change the order of parameters in swagger to comply the convention in SDK * Generated from e728666e3d48dcd45bcc643b4e2e42ae4c48ada6 (#6474) Changed some orders that missed by previous commit * Generated from 0de57e1ab5e1425affd87fcd66931cdedd0aa7b6 (#6486) [Storage] Fix the share max quota to right value 102400 * Generated from 3786c70ea058829697c199f9d9c68264ed6e965e (#6469) fixes * Generated from f89b3577784d34e4da75467c09dc8dc036d959a8 (#6459) update swagger for public ip * [AutoPR datafactory/resource-manager] Update Salesforce LinkedService Add ApiVersion (#6455) * Generated from 9dde2e58adb477a3b8716ab374b9bd82c139e278 Update Salesforce LinkedService Add ApiVersion * Generated from 9dde2e58adb477a3b8716ab374b9bd82c139e278 Update Salesforce LinkedService Add ApiVersion * Generated from d23b8338e812c3eb4da964c1ad8ca7fe8efc97f4 (#6470) [DataFactory]Support partition of SAP HANA * Generated from 7badadb92e5ba5d471ed8b8158be54ea7b451ccd (#6476) Revert "Update Salesforce LinkedService Add ApiVersion (#7865)" This reverts commit 3b494714b0ef2ba3e720f97d09c97de89873066f. * [AutoPR servicefabric/data-plane] Swagger specification for Service Fabric runtime version 7.0 (#6407) * Generated from 6f31bc763a8f1b0aebacc3d263e4a30f714cd335 updated read me s. * Generated from fa67c1c55a4dd7d8acd3839f1113b9029622361a updated propery custom-words.txt * [AutoPR mysql/resource-manager] Support MySQL ServerVersion 8.0 (#6451) * Generated from 79969c14e7081ce9e76d370b33fe1f65cc20196e support mysql ServerVersion 8.0 * Generated from 880ac9bc1c136104465964cd4d21d3901abecf77 Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into support-mysql-ver-8.0 * [AutoPR cosmos-db/resource-manager] Fix response structure (#6365) * Generated from 49871ca03fed5f6e6d5868c5fc779abb07f38e1d Fix response structure * Generated from ee13f8f1b953ef574227af8d0d6296aedad206a6 Add new properties and fix CI * Generated from c89a971a7edf5c22aa990089bc59f68a6c61747b Remove unrelated properties * Generated from 95419ab0fc19466e62f05035c84d4f6b7bc80cb9 Remove unrelated properties * Generated from 0a82cc765a42ef6b077b887d153075923fcc7f56 (#6481) Add resource layer in the throughput read response * Regenerate from latest swagger * [AutoPR cognitiveservices/data-plane/Personalizer] Adding current personalizer.json with all apis (#6156) * Generated from 4c3b969794c2290e5ce635f2e9ea76fc41679f31 fix readme.md * Generated from 8aa89593dc01488bff150b67219d6f9910da37ee Merge branch 'master' into dwaijam/personalzierstable * Generated from 8a5afd3b0ba8c1aec3f2223ef9414e3177ad5c52 update swager * Generated from 68033bcb14c12419b7183afe21b552e06f6f2d34 resolve API review board feedback * Generated from 29b40e15816bd76f999b409e40c37f3eaf871784 fix typo * Generated from 173935fb64f81a195e033c84b3fb7e3128997b26 delete model, policy -> reset model, policy * Generated from a9771ff183295912f33602791bc25559bc7f1018 made the model vaildation pass * Generated from da48a54cf0068154a6ac389f781c008887731b92 Remove readonly * Update code generator version * containerService2017-07-01 * containerService2017-08-31 * containerServices2017-09-30 * container service 2018-03-31 * container service 2019-02-01 * container service 2019-04-30 * container service 2019-06-01 * container service 2019-08-01 * container service 2019-10-01 * container service 2019-11-01 * container service 2018-08-01-preview * container service 2018-09-30-preview * container service 2019-09-30-preview * deploymentmanager 2019-11-01-preview * policyinsights 2018-07-01-preview * policyinsights 2019-10-01 * Generate profile * Generated from latest swagger * v38.0.0 Co-authored-by: Azure SDK Bot Co-authored-by: Joel Hendrix Co-authored-by: Steve Gore --- CHANGELOG.md | 44 + Gopkg.lock | 19 +- Gopkg.toml | 2 +- .../cognitiveservices/textanalytics/models.go | 1 - .../latest/compute/mgmt/compute/models.go | 1 + .../mgmt/containerservice/models.go | 10 +- .../mgmt/databoxedge/databoxedgeapi/models.go | 5 +- .../databoxedge/mgmt/databoxedge/models.go | 147 +- .../databricks/mgmt/databricks/models.go | 15 + .../datafactory/mgmt/datafactory/models.go | 69 + .../machinelearningservicesapi/models.go | 4 +- .../mgmt/machinelearningservices/models.go | 60 +- .../latest/mediaservices/mgmt/media/models.go | 3 + profiles/latest/netapp/mgmt/netapp/models.go | 48 +- .../netapp/mgmt/netapp/netappapi/models.go | 2 +- .../mgmt/resourcehealth/models.go | 48 + .../resourcehealthapi/models.go | 1 + .../cognitiveservices/textanalytics/models.go | 1 - .../preview/compute/mgmt/compute/models.go | 1 + .../mgmt/containerservice/models.go | 10 +- .../mgmt/databoxedge/databoxedgeapi/models.go | 5 +- .../databoxedge/mgmt/databoxedge/models.go | 147 +- .../databricks/mgmt/databricks/models.go | 15 + .../datafactory/mgmt/datafactory/models.go | 69 + .../machinelearningservicesapi/models.go | 4 +- .../mgmt/machinelearningservices/models.go | 60 +- .../mediaservices/mgmt/media/models.go | 3 + profiles/preview/netapp/mgmt/netapp/models.go | 48 +- .../netapp/mgmt/netapp/netappapi/models.go | 2 +- .../blueprint/mgmt/blueprint/models.go | 2 - .../anomalydetector/models.go | 2 + .../containerregistryapi/models.go | 5 +- .../mgmt/containerregistry/models.go | 259 +- .../hdinsight/mgmt/hdinsight/models.go | 2 + .../personalizer/personalizer/models.go | 67 +- .../personalizer/personalizerapi/models.go | 5 + .../preview/security/mgmt/security/models.go | 178 +- .../mgmt/security/securityapi/models.go | 3 + .../servicebus/mgmt/servicebus/models.go | 21 + .../preview/windowsesu/windowsesu/models.go | 123 + .../windowsesu/windowsesuapi/models.go | 25 + .../mgmt/resourcehealth/models.go | 48 + .../resourcehealthapi/models.go | 1 + .../mgmt/2015-05-01/insights/models.go | 8 + .../authorizationapi/interfaces.go | 4 +- .../provideroperationsmetadata.go | 20 +- .../2017-04-18/cognitiveservices/accounts.go | 6 +- .../v2.1/textanalytics/client.go | 8 +- .../v2.1/textanalytics/models.go | 7 +- .../textanalyticsapi/interfaces.go | 2 +- .../compute/mgmt/2018-10-01/compute/models.go | 4 +- .../compute/mgmt/2019-03-01/compute/models.go | 12 +- .../compute/mgmt/2019-07-01/compute/models.go | 49 +- .../2019-07-01/compute/virtualmachines.go | 8 +- .../2019-11-01/containerservice/agentpools.go | 3 - .../2019-11-01/containerservice/client.go | 2 +- .../containerservice/containerservices.go | 60 +- .../containerservice/managedclusters.go | 49 +- .../2019-11-01/containerservice/models.go | 520 +- .../openshiftmanagedclusters.go | 14 +- .../2019-11-01/containerservice/version.go | 2 +- .../mgmt/2019-08-01/databoxedge/alerts.go | 235 + .../databoxedge/bandwidthschedules.go | 407 ++ .../mgmt/2019-08-01/databoxedge/client.go | 51 + .../mgmt/2019-08-01/databoxedge/containers.go | 490 ++ .../databoxedge/databoxedgeapi/interfaces.go | 178 + .../mgmt/2019-08-01/databoxedge/devices.go | 1229 ++++ .../mgmt/2019-08-01/databoxedge/jobs.go | 120 + .../mgmt/2019-08-01/databoxedge/models.go | 5978 +++++++++++++++++ .../mgmt/2019-08-01/databoxedge/nodes.go | 118 + .../mgmt/2019-08-01/databoxedge/operations.go | 147 + .../databoxedge/operationsstatus.go | 120 + .../mgmt/2019-08-01/databoxedge/orders.go | 410 ++ .../mgmt/2019-08-01/databoxedge/roles.go | 395 ++ .../mgmt/2019-08-01/databoxedge/shares.go | 485 ++ .../mgmt/2019-08-01/databoxedge/skus.go | 118 + .../databoxedge/storageaccountcredentials.go | 406 ++ .../2019-08-01/databoxedge/storageaccounts.go | 402 ++ .../mgmt/2019-08-01/databoxedge/triggers.go | 399 ++ .../mgmt/2019-08-01/databoxedge/users.go | 410 ++ .../mgmt/2019-08-01/databoxedge/version.go | 30 + .../mgmt/2018-04-01/databricks/models.go | 73 +- .../mgmt/2018-04-01/databricks/workspaces.go | 29 +- .../mgmt/2018-06-01/datafactory/models.go | 3329 +++++++-- .../machinelearningservices/client.go | 165 + .../machinelearningcompute.go | 646 ++ .../machinelearningservicesapi/interfaces.go | 110 + .../machinelearningservices/models.go | 3673 ++++++++++ .../machinelearningservices/operations.go | 109 + .../privateendpointconnections.go | 289 + .../privatelinkresources.go | 119 + .../machinelearningservices/quotas.go | 245 + .../machinelearningservices/usages.go | 161 + .../machinelearningservices/version.go | 30 + .../virtualmachinesizes.go | 124 + .../workspacefeatures.go | 156 + .../machinelearningservices/workspaces.go | 741 ++ .../mgmt/2018-07-01/media/models.go | 79 +- .../netapp/mgmt/2019-10-01/netapp/accounts.go | 478 ++ .../netapp/mgmt/2019-10-01/netapp/client.go | 51 + .../netapp/mgmt/2019-10-01/netapp/models.go | 1572 +++++ .../mgmt/2019-10-01/netapp/mounttargets.go | 131 + .../2019-10-01/netapp/netappapi/interfaces.go | 95 + .../mgmt/2019-10-01/netapp/operations.go | 109 + .../netapp/mgmt/2019-10-01/netapp/pools.go | 499 ++ .../netapp/mgmt/2019-10-01/netapp/resource.go | 212 + .../mgmt/2019-10-01/netapp/snapshots.go | 517 ++ .../netapp/mgmt/2019-10-01/netapp/version.go | 30 + .../netapp/mgmt/2019-10-01/netapp/volumes.go | 971 +++ .../authorizationapi/interfaces.go | 4 +- .../provideroperationsmetadata.go | 20 +- .../2018-11-01-preview/blueprint/models.go | 32 +- .../anomalydetectorapi/interfaces.go | 1 + .../v1.0/anomalydetector/client.go | 92 +- .../v1.0/anomalydetector/models.go | 29 +- .../containerregistry/client.go | 51 + .../containerregistryapi/interfaces.go | 72 + .../containerregistry/models.go | 2494 +++++++ .../containerregistry/operations.go | 147 + .../containerregistry/registries.go | 1078 +++ .../containerregistry/replications.go | 544 ++ .../containerregistry/version.go | 30 + .../containerregistry/webhooks.go | 867 +++ .../customerlockboxapi/interfaces.go | 6 +- .../customerlockbox/operations.go | 13 +- .../customerlockbox/requests.go | 16 +- .../2015-03-01-preview/hdinsight/models.go | 18 + .../2018-06-01-preview/hdinsight/models.go | 20 +- .../managedservicesapi/interfaces.go | 18 +- .../2018-06-01/managedservices/operations.go | 9 +- .../registrationassignments.go | 36 +- .../registrationdefinitions.go | 36 +- .../managedservicesapi/interfaces.go | 18 +- .../2019-04-01/managedservices/operations.go | 9 +- .../registrationassignments.go | 36 +- .../registrationdefinitions.go | 36 +- .../personalizer/v1.0/personalizer/client.go | 8 +- .../v1.0/personalizer/evaluations.go | 342 + .../personalizer/v1.0/personalizer/events.go | 11 +- .../personalizer/v1.0/personalizer/log.go | 171 + .../personalizer/v1.0/personalizer/model.go | 236 + .../personalizer/v1.0/personalizer/models.go | 237 +- .../personalizerapi/interfaces.go | 44 + .../personalizer/v1.0/personalizer/policy.go | 252 + .../v1.0/personalizer/serviceconfiguration.go | 198 + .../mgmt/v1.0/security/automations.go | 643 ++ .../security/mgmt/v1.0/security/models.go | 740 +- .../v1.0/security/securityapi/interfaces.go | 12 + .../mgmt/v2.0/security/automations.go | 643 ++ .../security/mgmt/v2.0/security/models.go | 740 +- .../v2.0/security/securityapi/interfaces.go | 12 + .../mgmt/v3.0/security/assessmentsmetadata.go | 221 + .../assessmentsmetadatasubscription.go | 409 ++ .../mgmt/v3.0/security/automations.go | 643 ++ .../security/mgmt/v3.0/security/models.go | 1111 ++- .../v3.0/security/securityapi/interfaces.go | 30 + .../2018-01-01-preview/servicebus/models.go | 56 + .../servicefabric/clusters.go | 48 +- .../servicefabric/clusterversions.go | 32 +- .../servicefabric/operations.go | 13 +- .../servicefabricapi/interfaces.go | 22 +- .../servicefabric/operations.go | 13 +- .../servicefabricapi/interfaces.go | 2 +- .../preview/sql/mgmt/v3.0/sql/capabilities.go | 2 +- services/preview/sql/mgmt/v3.0/sql/models.go | 150 +- .../sql/mgmt/v3.0/sql/sqlapi/interfaces.go | 14 +- .../2019-09-16-preview/windowsesu/client.go | 51 + .../2019-09-16-preview/windowsesu/models.go | 632 ++ .../windowsesu/multipleactivationkeys.go | 642 ++ .../windowsesu/operations.go | 147 + .../2019-09-16-preview/windowsesu/version.go | 30 + .../windowsesu/windowsesuapi/interfaces.go | 43 + .../mgmt/2018-07-10/siterecovery/models.go | 20 + .../resourcehealth/emergingissues.go | 219 + .../mgmt/2017-07-01/resourcehealth/models.go | 377 ++ .../resourcehealthapi/interfaces.go | 8 + .../resources/provideroperationdetails.go | 11 +- .../mgmt/2015-11-01/resources/resources.go | 36 +- .../resources/resourcesapi/interfaces.go | 12 +- .../mgmt/2016-02-01/resources/resources.go | 36 +- .../resources/resourcesapi/interfaces.go | 10 +- .../mgmt/2016-07-01/resources/resources.go | 40 +- .../resources/resourcesapi/interfaces.go | 10 +- .../mgmt/2016-09-01/resources/resources.go | 80 +- .../resources/resourcesapi/interfaces.go | 20 +- .../mgmt/2017-05-10/resources/resources.go | 80 +- .../resources/resourcesapi/interfaces.go | 20 +- .../mgmt/2018-02-01/resources/resources.go | 80 +- .../resources/resourcesapi/interfaces.go | 20 +- .../mgmt/2018-05-01/resources/resources.go | 80 +- .../resources/resourcesapi/interfaces.go | 20 +- .../mgmt/2019-03-01/resources/resources.go | 80 +- .../resources/resourcesapi/interfaces.go | 20 +- .../mgmt/2019-05-01/resources/resources.go | 80 +- .../resources/resourcesapi/interfaces.go | 20 +- .../features/featuresapi/interfaces.go | 20 +- .../mgmt/2019-07-01/features/resources.go | 80 +- .../mgmt/2019-09-01/policy/models.go | 11 +- .../2018-02-01/servicefabric/operations.go | 13 +- .../servicefabricapi/interfaces.go | 2 +- .../2019-03-01/servicefabric/operations.go | 13 +- .../servicefabricapi/interfaces.go | 2 +- .../mgmt/2019-06-01/storage/fileshares.go | 2 +- version/version.go | 2 +- 204 files changed, 43113 insertions(+), 1977 deletions(-) create mode 100644 profiles/preview/preview/windowsesu/windowsesu/models.go create mode 100644 profiles/preview/preview/windowsesu/windowsesu/windowsesuapi/models.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/alerts.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/bandwidthschedules.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/client.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/containers.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/databoxedgeapi/interfaces.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/devices.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/jobs.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/models.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/nodes.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/operations.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/operationsstatus.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/orders.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/roles.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/shares.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/skus.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/storageaccountcredentials.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/storageaccounts.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/triggers.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/users.go create mode 100644 services/databoxedge/mgmt/2019-08-01/databoxedge/version.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/client.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/machinelearningcompute.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/machinelearningservicesapi/interfaces.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/models.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/operations.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/privateendpointconnections.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/privatelinkresources.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/quotas.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/usages.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/version.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/virtualmachinesizes.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/workspacefeatures.go create mode 100644 services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/workspaces.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/accounts.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/client.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/models.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/mounttargets.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/netappapi/interfaces.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/operations.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/pools.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/resource.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/snapshots.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/version.go create mode 100644 services/netapp/mgmt/2019-10-01/netapp/volumes.go create mode 100644 services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/client.go create mode 100644 services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi/interfaces.go create mode 100644 services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/models.go create mode 100644 services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/operations.go create mode 100644 services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/registries.go create mode 100644 services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/replications.go create mode 100644 services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/version.go create mode 100644 services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/webhooks.go create mode 100644 services/preview/personalizer/v1.0/personalizer/evaluations.go create mode 100644 services/preview/personalizer/v1.0/personalizer/log.go create mode 100644 services/preview/personalizer/v1.0/personalizer/model.go create mode 100644 services/preview/personalizer/v1.0/personalizer/policy.go create mode 100644 services/preview/personalizer/v1.0/personalizer/serviceconfiguration.go create mode 100644 services/preview/security/mgmt/v1.0/security/automations.go create mode 100644 services/preview/security/mgmt/v2.0/security/automations.go create mode 100644 services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go create mode 100644 services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go create mode 100644 services/preview/security/mgmt/v3.0/security/automations.go create mode 100644 services/preview/windowsesu/2019-09-16-preview/windowsesu/client.go create mode 100644 services/preview/windowsesu/2019-09-16-preview/windowsesu/models.go create mode 100644 services/preview/windowsesu/2019-09-16-preview/windowsesu/multipleactivationkeys.go create mode 100644 services/preview/windowsesu/2019-09-16-preview/windowsesu/operations.go create mode 100644 services/preview/windowsesu/2019-09-16-preview/windowsesu/version.go create mode 100644 services/preview/windowsesu/2019-09-16-preview/windowsesu/windowsesuapi/interfaces.go create mode 100644 services/resourcehealth/mgmt/2017-07-01/resourcehealth/emergingissues.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cee479c9347..1f00f911ae67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,49 @@ # CHANGELOG +## `v38.0.0` + +### New Packages + +| Package Name | API Version | +| -----------: | :---------: | +| containerregistry | 2019-12-01-preview | +| databoxedge | 2019-08-01 | +| machinelearningservices | 2020-01-01 | +| netapp | 2019-10-01 | +| windowsesu | 2019-09-16-preview | + +### Updated Packages + +| Package Name | API Version | +| -----------: | :---------: | +| anomalydetector | v1.0 | +| hdinsight | 2015-03-01-preview
2018-06-01-preview | +| insights | 2015-05-01 | +| media | 2018-07-01 | +| personalizer | v1.0 | +| resourcehealth | 2017-07-01 | +| servicebus | 2018-01-01-preview | +| siterecovery | 2018-07-10 | + +### BreakingChanges + +| Package Name | API Version | +| -----------: | :---------: | +| authorization | 2015-07-01
2017-10-01-preview | +| blueprint | 2018-11-01-preview | +| compute | 2018-10-01
2019-03-01
2019-07-01 | +| containerservice | 2019-11-01 | +| customerlockbox | 2018-02-28-preview | +| databricks | 2018-04-01 | +| datafactory | 2018-06-01 | +| features | 2019-07-01 | +| managedservices | 2018-06-01
2019-04-01 | +| resources | 2015-11-01
2016-02-01
2016-07-01
2016-09-01
2017-05-10
2018-02-01
2018-05-01
2019-03-01
2019-05-01 | +| security | v1.0
v2.0
v3.0 | +| servicefabric | 2017-07-01-preview
2018-02-01
2019-03-01
2019-03-01-preview | +| sql | v3.0 | +| textanalytics | v2.1 | + ## `v37.2.0` ### New Packages diff --git a/Gopkg.lock b/Gopkg.lock index 43aa10c8f048..bf58cc9ce29a 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,7 +2,7 @@ [[projects]] - digest = "1:6a638b1a468a4a8b67fc80ae6a075811a932c6aea327cc28b3ef3a29fba31f4a" + digest = "1:2e9f9f3381b65a6f99438e30ce398cbc13eb224187950158321ad9e560261f40" name = "github.com/Azure/go-autorest" packages = [ "autorest", @@ -17,16 +17,16 @@ "tracing", ] pruneopts = "UT" - revision = "3492b2aff5036c67228ab3c7dba3577c871db200" - version = "v13.3.0" + revision = "21d4b01533b1005be0d020da67a6d3f8ebdf0141" + version = "v13.3.1" [[projects]] - digest = "1:a5f0485ed2aad9b9c6a730815d1f2bc92b0acc126d7ee8e36c1a51882fc284f5" + digest = "1:f313598719f69ec4edbcd75b0f2ef1c8ed9e00f6ff3d7583ac3966db2d70d326" name = "github.com/Masterminds/semver" packages = ["."] pruneopts = "UT" - revision = "25911d36c978be5eb3e81847734874fd4e1dc6c7" - version = "v3.0.2" + revision = "910aa146bd66780c2815d652b92a7fc5331e533c" + version = "v3.0.3" [[projects]] digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55" @@ -150,11 +150,11 @@ "pkcs12/internal/rc2", ] pruneopts = "UT" - revision = "ac88ee75c92c889b97e05591e9a39b6480c538b3" + revision = "becbf705a91575484002d598f87d74f0002801e7" [[projects]] branch = "master" - digest = "1:10c612b4f89a6d75ac2a0e7cd33cb9474034e8914844231d76a40fe7cd799945" + digest = "1:81034a933b8e243f6c700951903f436029c1c1b53b0d694a9e8626cdeb835b00" name = "golang.org/x/tools" packages = [ "go/ast/astutil", @@ -169,10 +169,9 @@ "internal/imports", "internal/module", "internal/semver", - "internal/span", ] pruneopts = "UT" - revision = "ecd32218bd7f33fd31c1abbfb74283690bedd093" + revision = "3721262b3e7c542ed1607f063180bccdb22c2d02" [[projects]] branch = "v1" diff --git a/Gopkg.toml b/Gopkg.toml index 397fd11b923c..dba913f3a5bc 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -25,7 +25,7 @@ [[constraint]] name = "github.com/Azure/go-autorest" - version = "13.3.0" + version = "13.3.1" [[constraint]] branch = "master" diff --git a/profiles/latest/cognitiveservices/textanalytics/models.go b/profiles/latest/cognitiveservices/textanalytics/models.go index 27f372d77bc9..745f6ffc696a 100644 --- a/profiles/latest/cognitiveservices/textanalytics/models.go +++ b/profiles/latest/cognitiveservices/textanalytics/models.go @@ -42,7 +42,6 @@ type MultiLanguageInput = original.MultiLanguageInput type RequestStatistics = original.RequestStatistics type SentimentBatchResult = original.SentimentBatchResult type SentimentBatchResultItem = original.SentimentBatchResultItem -type SetObject = original.SetObject func New(endpoint string) BaseClient { return original.New(endpoint) diff --git a/profiles/latest/compute/mgmt/compute/models.go b/profiles/latest/compute/mgmt/compute/models.go index af120f14e85c..953a2c77e4b3 100644 --- a/profiles/latest/compute/mgmt/compute/models.go +++ b/profiles/latest/compute/mgmt/compute/models.go @@ -935,6 +935,7 @@ type SourceVault = original.SourceVault type StorageProfile = original.StorageProfile type SubResource = original.SubResource type SubResourceReadOnly = original.SubResourceReadOnly +type SubResourceWithColocationStatus = original.SubResourceWithColocationStatus type TargetRegion = original.TargetRegion type TerminateNotificationProfile = original.TerminateNotificationProfile type ThrottledRequestsInput = original.ThrottledRequestsInput diff --git a/profiles/latest/containerservice/mgmt/containerservice/models.go b/profiles/latest/containerservice/mgmt/containerservice/models.go index ca5241b88abb..d86df85d27d4 100644 --- a/profiles/latest/containerservice/mgmt/containerservice/models.go +++ b/profiles/latest/containerservice/mgmt/containerservice/models.go @@ -39,6 +39,7 @@ const ( type Kind = original.Kind const ( + KindAADIdentityProvider Kind = original.KindAADIdentityProvider KindOpenShiftManagedClusterBaseIdentityProvider Kind = original.KindOpenShiftManagedClusterBaseIdentityProvider ) @@ -358,14 +359,6 @@ type BaseClient = original.BaseClient type BasicOpenShiftManagedClusterBaseIdentityProvider = original.BasicOpenShiftManagedClusterBaseIdentityProvider type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody -type Componentsschemasagentpoolallof1 = original.Componentsschemasagentpoolallof1 -type Componentsschemascontainerserviceallof1 = original.Componentsschemascontainerserviceallof1 -type Componentsschemasmanagedclusteraccessprofileallof1 = original.Componentsschemasmanagedclusteraccessprofileallof1 -type Componentsschemasmanagedclusteragentpoolprofileallof1 = original.Componentsschemasmanagedclusteragentpoolprofileallof1 -type Componentsschemasmanagedclusterallof1 = original.Componentsschemasmanagedclusterallof1 -type Componentsschemasmanagedclusterpropertiespropertiesidentityprofileadditionalproperties = original.Componentsschemasmanagedclusterpropertiespropertiesidentityprofileadditionalproperties -type Componentsschemasopenshiftmanagedclusteraadidentityproviderallof1 = original.Componentsschemasopenshiftmanagedclusteraadidentityproviderallof1 -type Componentsschemasopenshiftmanagedclusterallof1 = original.Componentsschemasopenshiftmanagedclusterallof1 type ContainerService = original.ContainerService type ContainerServicesClient = original.ContainerServicesClient type ContainerServicesCreateOrUpdateFutureType = original.ContainerServicesCreateOrUpdateFutureType @@ -398,6 +391,7 @@ type ManagedClusterLoadBalancerProfileOutboundIPs = original.ManagedClusterLoadB type ManagedClusterPoolUpgradeProfile = original.ManagedClusterPoolUpgradeProfile type ManagedClusterPoolUpgradeProfileUpgradesItem = original.ManagedClusterPoolUpgradeProfileUpgradesItem type ManagedClusterProperties = original.ManagedClusterProperties +type ManagedClusterPropertiesIdentityProfileValue = original.ManagedClusterPropertiesIdentityProfileValue type ManagedClusterServicePrincipalProfile = original.ManagedClusterServicePrincipalProfile type ManagedClusterUpgradeProfile = original.ManagedClusterUpgradeProfile type ManagedClusterUpgradeProfileProperties = original.ManagedClusterUpgradeProfileProperties diff --git a/profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go b/profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go index fa769db5d05e..1ffe67fd69c9 100644 --- a/profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go +++ b/profiles/latest/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go @@ -19,10 +19,11 @@ package databoxedgeapi -import original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi" +import original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-08-01/databoxedge/databoxedgeapi" type AlertsClientAPI = original.AlertsClientAPI type BandwidthSchedulesClientAPI = original.BandwidthSchedulesClientAPI +type ContainersClientAPI = original.ContainersClientAPI type DevicesClientAPI = original.DevicesClientAPI type JobsClientAPI = original.JobsClientAPI type NodesClientAPI = original.NodesClientAPI @@ -31,6 +32,8 @@ type OperationsStatusClientAPI = original.OperationsStatusClientAPI type OrdersClientAPI = original.OrdersClientAPI type RolesClientAPI = original.RolesClientAPI type SharesClientAPI = original.SharesClientAPI +type SkusClientAPI = original.SkusClientAPI type StorageAccountCredentialsClientAPI = original.StorageAccountCredentialsClientAPI +type StorageAccountsClientAPI = original.StorageAccountsClientAPI type TriggersClientAPI = original.TriggersClientAPI type UsersClientAPI = original.UsersClientAPI diff --git a/profiles/latest/databoxedge/mgmt/databoxedge/models.go b/profiles/latest/databoxedge/mgmt/databoxedge/models.go index 3f9c78273acc..6844582275aa 100644 --- a/profiles/latest/databoxedge/mgmt/databoxedge/models.go +++ b/profiles/latest/databoxedge/mgmt/databoxedge/models.go @@ -22,7 +22,7 @@ package databoxedge import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge" + original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-08-01/databoxedge" ) const ( @@ -67,6 +67,16 @@ const ( ReadWrite ClientPermissionType = original.ReadWrite ) +type ContainerStatus = original.ContainerStatus + +const ( + NeedsAttention ContainerStatus = original.NeedsAttention + Offline ContainerStatus = original.Offline + OK ContainerStatus = original.OK + Unknown ContainerStatus = original.Unknown + Updating ContainerStatus = original.Updating +) + type DataPolicy = original.DataPolicy const ( @@ -89,13 +99,13 @@ const ( type DeviceStatus = original.DeviceStatus const ( - Disconnected DeviceStatus = original.Disconnected - Maintenance DeviceStatus = original.Maintenance - NeedsAttention DeviceStatus = original.NeedsAttention - Offline DeviceStatus = original.Offline - Online DeviceStatus = original.Online - PartiallyDisconnected DeviceStatus = original.PartiallyDisconnected - ReadyToSetup DeviceStatus = original.ReadyToSetup + DeviceStatusDisconnected DeviceStatus = original.DeviceStatusDisconnected + DeviceStatusMaintenance DeviceStatus = original.DeviceStatusMaintenance + DeviceStatusNeedsAttention DeviceStatus = original.DeviceStatusNeedsAttention + DeviceStatusOffline DeviceStatus = original.DeviceStatusOffline + DeviceStatusOnline DeviceStatus = original.DeviceStatusOnline + DeviceStatusPartiallyDisconnected DeviceStatus = original.DeviceStatusPartiallyDisconnected + DeviceStatusReadyToSetup DeviceStatus = original.DeviceStatusReadyToSetup ) type DeviceType = original.DeviceType @@ -107,10 +117,10 @@ const ( type DownloadPhase = original.DownloadPhase const ( - Downloading DownloadPhase = original.Downloading - Initializing DownloadPhase = original.Initializing - Unknown DownloadPhase = original.Unknown - Verifying DownloadPhase = original.Verifying + DownloadPhaseDownloading DownloadPhase = original.DownloadPhaseDownloading + DownloadPhaseInitializing DownloadPhase = original.DownloadPhaseInitializing + DownloadPhaseUnknown DownloadPhase = original.DownloadPhaseUnknown + DownloadPhaseVerifying DownloadPhase = original.DownloadPhaseVerifying ) type EncryptionAlgorithm = original.EncryptionAlgorithm @@ -144,11 +154,12 @@ const ( type JobType = original.JobType const ( - JobTypeDownloadUpdates JobType = original.JobTypeDownloadUpdates - JobTypeInstallUpdates JobType = original.JobTypeInstallUpdates - JobTypeInvalid JobType = original.JobTypeInvalid - JobTypeRefreshShare JobType = original.JobTypeRefreshShare - JobTypeScanForUpdates JobType = original.JobTypeScanForUpdates + JobTypeDownloadUpdates JobType = original.JobTypeDownloadUpdates + JobTypeInstallUpdates JobType = original.JobTypeInstallUpdates + JobTypeInvalid JobType = original.JobTypeInvalid + JobTypeRefreshContainer JobType = original.JobTypeRefreshContainer + JobTypeRefreshShare JobType = original.JobTypeRefreshShare + JobTypeScanForUpdates JobType = original.JobTypeScanForUpdates ) type Kind = original.Kind @@ -321,8 +332,22 @@ const ( type SkuName = original.SkuName const ( - Edge SkuName = original.Edge - Gateway SkuName = original.Gateway + Edge SkuName = original.Edge + Gateway SkuName = original.Gateway + TEA1Node SkuName = original.TEA1Node + TEA1NodeHeater SkuName = original.TEA1NodeHeater + TEA1NodeUPS SkuName = original.TEA1NodeUPS + TEA1NodeUPSHeater SkuName = original.TEA1NodeUPSHeater + TEA4NodeHeater SkuName = original.TEA4NodeHeater + TEA4NodeUPSHeater SkuName = original.TEA4NodeUPSHeater + TMA SkuName = original.TMA +) + +type SkuRestrictionReasonCode = original.SkuRestrictionReasonCode + +const ( + NotAvailableForSubscription SkuRestrictionReasonCode = original.NotAvailableForSubscription + QuotaID SkuRestrictionReasonCode = original.QuotaID ) type SkuTier = original.SkuTier @@ -331,6 +356,16 @@ const ( Standard SkuTier = original.Standard ) +type StorageAccountStatus = original.StorageAccountStatus + +const ( + StorageAccountStatusNeedsAttention StorageAccountStatus = original.StorageAccountStatusNeedsAttention + StorageAccountStatusOffline StorageAccountStatus = original.StorageAccountStatusOffline + StorageAccountStatusOK StorageAccountStatus = original.StorageAccountStatusOK + StorageAccountStatusUnknown StorageAccountStatus = original.StorageAccountStatusUnknown + StorageAccountStatusUpdating StorageAccountStatus = original.StorageAccountStatusUpdating +) + type TimeGrain = original.TimeGrain const ( @@ -375,6 +410,14 @@ const ( UpdateOperationStageUnknown UpdateOperationStage = original.UpdateOperationStageUnknown ) +type UserType = original.UserType + +const ( + UserTypeARM UserType = original.UserTypeARM + UserTypeLocalManagement UserType = original.UserTypeLocalManagement + UserTypeShare UserType = original.UserTypeShare +) + type ARMBaseModel = original.ARMBaseModel type Address = original.Address type Alert = original.Alert @@ -402,6 +445,15 @@ type ClientAccessRight = original.ClientAccessRight type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody type ContactDetails = original.ContactDetails +type Container = original.Container +type ContainerList = original.ContainerList +type ContainerListIterator = original.ContainerListIterator +type ContainerListPage = original.ContainerListPage +type ContainerProperties = original.ContainerProperties +type ContainersClient = original.ContainersClient +type ContainersCreateOrUpdateFuture = original.ContainersCreateOrUpdateFuture +type ContainersDeleteFuture = original.ContainersDeleteFuture +type ContainersRefreshFuture = original.ContainersRefreshFuture type Device = original.Device type DeviceExtendedInfo = original.DeviceExtendedInfo type DeviceExtendedInfoProperties = original.DeviceExtendedInfoProperties @@ -463,6 +515,7 @@ type PeriodicTimerProperties = original.PeriodicTimerProperties type PeriodicTimerSourceInfo = original.PeriodicTimerSourceInfo type RawCertificateData = original.RawCertificateData type RefreshDetails = original.RefreshDetails +type ResourceTypeSku = original.ResourceTypeSku type Role = original.Role type RoleList = original.RoleList type RoleListIterator = original.RoleListIterator @@ -486,6 +539,13 @@ type SharesCreateOrUpdateFuture = original.SharesCreateOrUpdateFuture type SharesDeleteFuture = original.SharesDeleteFuture type SharesRefreshFuture = original.SharesRefreshFuture type Sku = original.Sku +type SkuCost = original.SkuCost +type SkuInformationList = original.SkuInformationList +type SkuLocationInfo = original.SkuLocationInfo +type SkuRestriction = original.SkuRestriction +type SkuRestrictionInfo = original.SkuRestrictionInfo +type SkusClient = original.SkusClient +type StorageAccount = original.StorageAccount type StorageAccountCredential = original.StorageAccountCredential type StorageAccountCredentialList = original.StorageAccountCredentialList type StorageAccountCredentialListIterator = original.StorageAccountCredentialListIterator @@ -494,6 +554,13 @@ type StorageAccountCredentialProperties = original.StorageAccountCredentialPrope type StorageAccountCredentialsClient = original.StorageAccountCredentialsClient type StorageAccountCredentialsCreateOrUpdateFuture = original.StorageAccountCredentialsCreateOrUpdateFuture type StorageAccountCredentialsDeleteFuture = original.StorageAccountCredentialsDeleteFuture +type StorageAccountList = original.StorageAccountList +type StorageAccountListIterator = original.StorageAccountListIterator +type StorageAccountListPage = original.StorageAccountListPage +type StorageAccountProperties = original.StorageAccountProperties +type StorageAccountsClient = original.StorageAccountsClient +type StorageAccountsCreateOrUpdateFuture = original.StorageAccountsCreateOrUpdateFuture +type StorageAccountsDeleteFuture = original.StorageAccountsDeleteFuture type SymmetricKey = original.SymmetricKey type TrackingInfo = original.TrackingInfo type Trigger = original.Trigger @@ -547,6 +614,18 @@ func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) Bandwidt func NewBandwidthSchedulesListPage(getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage { return original.NewBandwidthSchedulesListPage(getNextPage) } +func NewContainerListIterator(page ContainerListPage) ContainerListIterator { + return original.NewContainerListIterator(page) +} +func NewContainerListPage(getNextPage func(context.Context, ContainerList) (ContainerList, error)) ContainerListPage { + return original.NewContainerListPage(getNextPage) +} +func NewContainersClient(subscriptionID string) ContainersClient { + return original.NewContainersClient(subscriptionID) +} +func NewContainersClientWithBaseURI(baseURI string, subscriptionID string) ContainersClient { + return original.NewContainersClientWithBaseURI(baseURI, subscriptionID) +} func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { return original.NewDeviceListIterator(page) } @@ -625,6 +704,12 @@ func NewSharesClient(subscriptionID string) SharesClient { func NewSharesClientWithBaseURI(baseURI string, subscriptionID string) SharesClient { return original.NewSharesClientWithBaseURI(baseURI, subscriptionID) } +func NewSkusClient(subscriptionID string) SkusClient { + return original.NewSkusClient(subscriptionID) +} +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return original.NewSkusClientWithBaseURI(baseURI, subscriptionID) +} func NewStorageAccountCredentialListIterator(page StorageAccountCredentialListPage) StorageAccountCredentialListIterator { return original.NewStorageAccountCredentialListIterator(page) } @@ -637,6 +722,18 @@ func NewStorageAccountCredentialsClient(subscriptionID string) StorageAccountCre func NewStorageAccountCredentialsClientWithBaseURI(baseURI string, subscriptionID string) StorageAccountCredentialsClient { return original.NewStorageAccountCredentialsClientWithBaseURI(baseURI, subscriptionID) } +func NewStorageAccountListIterator(page StorageAccountListPage) StorageAccountListIterator { + return original.NewStorageAccountListIterator(page) +} +func NewStorageAccountListPage(getNextPage func(context.Context, StorageAccountList) (StorageAccountList, error)) StorageAccountListPage { + return original.NewStorageAccountListPage(getNextPage) +} +func NewStorageAccountsClient(subscriptionID string) StorageAccountsClient { + return original.NewStorageAccountsClient(subscriptionID) +} +func NewStorageAccountsClientWithBaseURI(baseURI string, subscriptionID string) StorageAccountsClient { + return original.NewStorageAccountsClientWithBaseURI(baseURI, subscriptionID) +} func NewTriggerListIterator(page TriggerListPage) TriggerListIterator { return original.NewTriggerListIterator(page) } @@ -679,6 +776,9 @@ func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat { func PossibleClientPermissionTypeValues() []ClientPermissionType { return original.PossibleClientPermissionTypeValues() } +func PossibleContainerStatusValues() []ContainerStatus { + return original.PossibleContainerStatusValues() +} func PossibleDataPolicyValues() []DataPolicy { return original.PossibleDataPolicyValues() } @@ -766,9 +866,15 @@ func PossibleShareStatusValues() []ShareStatus { func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } +func PossibleSkuRestrictionReasonCodeValues() []SkuRestrictionReasonCode { + return original.PossibleSkuRestrictionReasonCodeValues() +} func PossibleSkuTierValues() []SkuTier { return original.PossibleSkuTierValues() } +func PossibleStorageAccountStatusValues() []StorageAccountStatus { + return original.PossibleStorageAccountStatusValues() +} func PossibleTimeGrainValues() []TimeGrain { return original.PossibleTimeGrainValues() } @@ -778,6 +884,9 @@ func PossibleUpdateOperationStageValues() []UpdateOperationStage { func PossibleUpdateOperationValues() []UpdateOperation { return original.PossibleUpdateOperationValues() } +func PossibleUserTypeValues() []UserType { + return original.PossibleUserTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/latest" } diff --git a/profiles/latest/databricks/mgmt/databricks/models.go b/profiles/latest/databricks/mgmt/databricks/models.go index a69719677bed..770dd38e4274 100644 --- a/profiles/latest/databricks/mgmt/databricks/models.go +++ b/profiles/latest/databricks/mgmt/databricks/models.go @@ -29,6 +29,14 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) +type CustomParameterType = original.CustomParameterType + +const ( + Bool CustomParameterType = original.Bool + Object CustomParameterType = original.Object + String CustomParameterType = original.String +) + type ProvisioningState = original.ProvisioningState const ( @@ -59,6 +67,10 @@ type Resource = original.Resource type Sku = original.Sku type TrackedResource = original.TrackedResource type Workspace = original.Workspace +type WorkspaceCustomBooleanParameter = original.WorkspaceCustomBooleanParameter +type WorkspaceCustomObjectParameter = original.WorkspaceCustomObjectParameter +type WorkspaceCustomParameters = original.WorkspaceCustomParameters +type WorkspaceCustomStringParameter = original.WorkspaceCustomStringParameter type WorkspaceListResult = original.WorkspaceListResult type WorkspaceListResultIterator = original.WorkspaceListResultIterator type WorkspaceListResultPage = original.WorkspaceListResultPage @@ -100,6 +112,9 @@ func NewWorkspacesClient(subscriptionID string) WorkspacesClient { func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { return original.NewWorkspacesClientWithBaseURI(baseURI, subscriptionID) } +func PossibleCustomParameterTypeValues() []CustomParameterType { + return original.PossibleCustomParameterTypeValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/latest/datafactory/mgmt/datafactory/models.go b/profiles/latest/datafactory/mgmt/datafactory/models.go index 7af2ee7637f3..e3ba33c3686e 100644 --- a/profiles/latest/datafactory/mgmt/datafactory/models.go +++ b/profiles/latest/datafactory/mgmt/datafactory/models.go @@ -978,6 +978,23 @@ const ( TypeZipDeflate TypeBasicDatasetCompression = original.TypeZipDeflate ) +type TypeBasicDatasetLocation = original.TypeBasicDatasetLocation + +const ( + TypeAmazonS3Location TypeBasicDatasetLocation = original.TypeAmazonS3Location + TypeAzureBlobFSLocation TypeBasicDatasetLocation = original.TypeAzureBlobFSLocation + TypeAzureBlobStorageLocation TypeBasicDatasetLocation = original.TypeAzureBlobStorageLocation + TypeAzureDataLakeStoreLocation TypeBasicDatasetLocation = original.TypeAzureDataLakeStoreLocation + TypeAzureFileStorageLocation TypeBasicDatasetLocation = original.TypeAzureFileStorageLocation + TypeDatasetLocation TypeBasicDatasetLocation = original.TypeDatasetLocation + TypeFileServerLocation TypeBasicDatasetLocation = original.TypeFileServerLocation + TypeFtpServerLocation TypeBasicDatasetLocation = original.TypeFtpServerLocation + TypeGoogleCloudStorageLocation TypeBasicDatasetLocation = original.TypeGoogleCloudStorageLocation + TypeHdfsLocation TypeBasicDatasetLocation = original.TypeHdfsLocation + TypeHTTPServerLocation TypeBasicDatasetLocation = original.TypeHTTPServerLocation + TypeSftpLocation TypeBasicDatasetLocation = original.TypeSftpLocation +) + type TypeBasicDatasetStorageFormat = original.TypeBasicDatasetStorageFormat const ( @@ -1006,6 +1023,22 @@ const ( TypeFactoryVSTSConfiguration TypeBasicFactoryRepoConfiguration = original.TypeFactoryVSTSConfiguration ) +type TypeBasicFormatReadSettings = original.TypeBasicFormatReadSettings + +const ( + TypeDelimitedTextReadSettings TypeBasicFormatReadSettings = original.TypeDelimitedTextReadSettings + TypeFormatReadSettings TypeBasicFormatReadSettings = original.TypeFormatReadSettings +) + +type TypeBasicFormatWriteSettings = original.TypeBasicFormatWriteSettings + +const ( + TypeAvroWriteSettings TypeBasicFormatWriteSettings = original.TypeAvroWriteSettings + TypeDelimitedTextWriteSettings TypeBasicFormatWriteSettings = original.TypeDelimitedTextWriteSettings + TypeFormatWriteSettings TypeBasicFormatWriteSettings = original.TypeFormatWriteSettings + TypeJSONWriteSettings TypeBasicFormatWriteSettings = original.TypeJSONWriteSettings +) + type TypeBasicIntegrationRuntime = original.TypeBasicIntegrationRuntime const ( @@ -1132,6 +1165,23 @@ const ( TypeSsisObjectMetadata TypeBasicSsisObjectMetadata = original.TypeSsisObjectMetadata ) +type TypeBasicStoreReadSettings = original.TypeBasicStoreReadSettings + +const ( + TypeAmazonS3ReadSettings TypeBasicStoreReadSettings = original.TypeAmazonS3ReadSettings + TypeAzureBlobFSReadSettings TypeBasicStoreReadSettings = original.TypeAzureBlobFSReadSettings + TypeAzureBlobStorageReadSettings TypeBasicStoreReadSettings = original.TypeAzureBlobStorageReadSettings + TypeAzureDataLakeStoreReadSettings TypeBasicStoreReadSettings = original.TypeAzureDataLakeStoreReadSettings + TypeAzureFileStorageReadSettings TypeBasicStoreReadSettings = original.TypeAzureFileStorageReadSettings + TypeFileServerReadSettings TypeBasicStoreReadSettings = original.TypeFileServerReadSettings + TypeFtpReadSettings TypeBasicStoreReadSettings = original.TypeFtpReadSettings + TypeGoogleCloudStorageReadSettings TypeBasicStoreReadSettings = original.TypeGoogleCloudStorageReadSettings + TypeHdfsReadSettings TypeBasicStoreReadSettings = original.TypeHdfsReadSettings + TypeHTTPReadSettings TypeBasicStoreReadSettings = original.TypeHTTPReadSettings + TypeSftpReadSettings TypeBasicStoreReadSettings = original.TypeSftpReadSettings + TypeStoreReadSettings TypeBasicStoreReadSettings = original.TypeStoreReadSettings +) + type TypeBasicStoreWriteSettings = original.TypeBasicStoreWriteSettings const ( @@ -1139,6 +1189,7 @@ const ( TypeAzureBlobStorageWriteSettings TypeBasicStoreWriteSettings = original.TypeAzureBlobStorageWriteSettings TypeAzureDataLakeStoreWriteSettings TypeBasicStoreWriteSettings = original.TypeAzureDataLakeStoreWriteSettings TypeFileServerWriteSettings TypeBasicStoreWriteSettings = original.TypeFileServerWriteSettings + TypeSftpWriteSettings TypeBasicStoreWriteSettings = original.TypeSftpWriteSettings TypeStoreWriteSettings TypeBasicStoreWriteSettings = original.TypeStoreWriteSettings ) @@ -1322,10 +1373,13 @@ type BasicCustomSetupBase = original.BasicCustomSetupBase type BasicDataFlow = original.BasicDataFlow type BasicDataset = original.BasicDataset type BasicDatasetCompression = original.BasicDatasetCompression +type BasicDatasetLocation = original.BasicDatasetLocation type BasicDatasetStorageFormat = original.BasicDatasetStorageFormat type BasicDependencyReference = original.BasicDependencyReference type BasicExecutionActivity = original.BasicExecutionActivity type BasicFactoryRepoConfiguration = original.BasicFactoryRepoConfiguration +type BasicFormatReadSettings = original.BasicFormatReadSettings +type BasicFormatWriteSettings = original.BasicFormatWriteSettings type BasicIntegrationRuntime = original.BasicIntegrationRuntime type BasicIntegrationRuntimeStatus = original.BasicIntegrationRuntimeStatus type BasicLinkedIntegrationRuntimeType = original.BasicLinkedIntegrationRuntimeType @@ -1333,6 +1387,7 @@ type BasicLinkedService = original.BasicLinkedService type BasicMultiplePipelineTrigger = original.BasicMultiplePipelineTrigger type BasicSecretBase = original.BasicSecretBase type BasicSsisObjectMetadata = original.BasicSsisObjectMetadata +type BasicStoreReadSettings = original.BasicStoreReadSettings type BasicStoreWriteSettings = original.BasicStoreWriteSettings type BasicTabularSource = original.BasicTabularSource type BasicTrigger = original.BasicTrigger @@ -1500,6 +1555,7 @@ type EnvironmentVariableSetup = original.EnvironmentVariableSetup type EnvironmentVariableSetupTypeProperties = original.EnvironmentVariableSetupTypeProperties type ExecuteDataFlowActivity = original.ExecuteDataFlowActivity type ExecuteDataFlowActivityTypeProperties = original.ExecuteDataFlowActivityTypeProperties +type ExecuteDataFlowActivityTypePropertiesCompute = original.ExecuteDataFlowActivityTypePropertiesCompute type ExecutePipelineActivity = original.ExecutePipelineActivity type ExecutePipelineActivityTypeProperties = original.ExecutePipelineActivityTypeProperties type ExecuteSSISPackageActivity = original.ExecuteSSISPackageActivity @@ -1937,6 +1993,7 @@ type SftpLocation = original.SftpLocation type SftpReadSettings = original.SftpReadSettings type SftpServerLinkedService = original.SftpServerLinkedService type SftpServerLinkedServiceTypeProperties = original.SftpServerLinkedServiceTypeProperties +type SftpWriteSettings = original.SftpWriteSettings type ShopifyLinkedService = original.ShopifyLinkedService type ShopifyLinkedServiceTypeProperties = original.ShopifyLinkedServiceTypeProperties type ShopifyObjectDataset = original.ShopifyObjectDataset @@ -2446,6 +2503,9 @@ func PossibleTypeBasicDataFlowValues() []TypeBasicDataFlow { func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression { return original.PossibleTypeBasicDatasetCompressionValues() } +func PossibleTypeBasicDatasetLocationValues() []TypeBasicDatasetLocation { + return original.PossibleTypeBasicDatasetLocationValues() +} func PossibleTypeBasicDatasetStorageFormatValues() []TypeBasicDatasetStorageFormat { return original.PossibleTypeBasicDatasetStorageFormatValues() } @@ -2458,6 +2518,12 @@ func PossibleTypeBasicDependencyReferenceValues() []TypeBasicDependencyReference func PossibleTypeBasicFactoryRepoConfigurationValues() []TypeBasicFactoryRepoConfiguration { return original.PossibleTypeBasicFactoryRepoConfigurationValues() } +func PossibleTypeBasicFormatReadSettingsValues() []TypeBasicFormatReadSettings { + return original.PossibleTypeBasicFormatReadSettingsValues() +} +func PossibleTypeBasicFormatWriteSettingsValues() []TypeBasicFormatWriteSettings { + return original.PossibleTypeBasicFormatWriteSettingsValues() +} func PossibleTypeBasicIntegrationRuntimeStatusValues() []TypeBasicIntegrationRuntimeStatus { return original.PossibleTypeBasicIntegrationRuntimeStatusValues() } @@ -2470,6 +2536,9 @@ func PossibleTypeBasicLinkedServiceValues() []TypeBasicLinkedService { func PossibleTypeBasicSsisObjectMetadataValues() []TypeBasicSsisObjectMetadata { return original.PossibleTypeBasicSsisObjectMetadataValues() } +func PossibleTypeBasicStoreReadSettingsValues() []TypeBasicStoreReadSettings { + return original.PossibleTypeBasicStoreReadSettingsValues() +} func PossibleTypeBasicStoreWriteSettingsValues() []TypeBasicStoreWriteSettings { return original.PossibleTypeBasicStoreWriteSettingsValues() } diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index c4a603b4c42c..02636c78618d 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-11-01/machinelearningservices/machinelearningservicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/machinelearningservicesapi" type BaseClientAPI = original.BaseClientAPI type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type QuotasClientAPI = original.QuotasClientAPI type UsagesClientAPI = original.UsagesClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go index 3b33f523c201..cb5128e1561a 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-11-01/machinelearningservices" + original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices" ) const ( @@ -88,16 +88,33 @@ const ( Unusable NodeState = original.Unusable ) +type PrivateEndpointConnectionProvisioningState = original.PrivateEndpointConnectionProvisioningState + +const ( + Creating PrivateEndpointConnectionProvisioningState = original.Creating + Deleting PrivateEndpointConnectionProvisioningState = original.Deleting + Failed PrivateEndpointConnectionProvisioningState = original.Failed + Succeeded PrivateEndpointConnectionProvisioningState = original.Succeeded +) + +type PrivateEndpointServiceConnectionStatus = original.PrivateEndpointServiceConnectionStatus + +const ( + Approved PrivateEndpointServiceConnectionStatus = original.Approved + Pending PrivateEndpointServiceConnectionStatus = original.Pending + Rejected PrivateEndpointServiceConnectionStatus = original.Rejected +) + type ProvisioningState = original.ProvisioningState const ( - Canceled ProvisioningState = original.Canceled - Creating ProvisioningState = original.Creating - Deleting ProvisioningState = original.Deleting - Failed ProvisioningState = original.Failed - Succeeded ProvisioningState = original.Succeeded - Unknown ProvisioningState = original.Unknown - Updating ProvisioningState = original.Updating + ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled + ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating + ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded + ProvisioningStateUnknown ProvisioningState = original.ProvisioningStateUnknown + ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating ) type QuotaUnit = original.QuotaUnit @@ -223,6 +240,15 @@ type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage type Password = original.Password +type PrivateEndpoint = original.PrivateEndpoint +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateLinkResource = original.PrivateLinkResource +type PrivateLinkResourceListResult = original.PrivateLinkResourceListResult +type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState type QuotaBaseProperties = original.QuotaBaseProperties type QuotaUpdateParameters = original.QuotaUpdateParameters type QuotasClient = original.QuotasClient @@ -306,6 +332,18 @@ func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesList func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { return original.NewPaginatedComputeResourcesListPage(getNextPage) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewQuotasClient(subscriptionID string) QuotasClient { return original.NewQuotasClient(subscriptionID) } @@ -369,6 +407,12 @@ func PossibleComputeTypeValues() []ComputeType { func PossibleNodeStateValues() []NodeState { return original.PossibleNodeStateValues() } +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return original.PossiblePrivateEndpointConnectionProvisioningStateValues() +} +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return original.PossiblePrivateEndpointServiceConnectionStatusValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/latest/mediaservices/mgmt/media/models.go b/profiles/latest/mediaservices/mgmt/media/models.go index 5c68c50f85cd..2d6e65db32eb 100644 --- a/profiles/latest/mediaservices/mgmt/media/models.go +++ b/profiles/latest/mediaservices/mgmt/media/models.go @@ -62,6 +62,7 @@ const ( type ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.ContentKeyPolicyFairPlayRentalAndLeaseKeyType const ( + DualExpiry ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.DualExpiry PersistentLimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.PersistentLimited PersistentUnlimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.PersistentUnlimited Undefined ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.Undefined @@ -122,6 +123,7 @@ type EncoderNamedPreset = original.EncoderNamedPreset const ( AACGoodQualityAudio EncoderNamedPreset = original.AACGoodQualityAudio AdaptiveStreaming EncoderNamedPreset = original.AdaptiveStreaming + ContentAwareEncoding EncoderNamedPreset = original.ContentAwareEncoding ContentAwareEncodingExperimental EncoderNamedPreset = original.ContentAwareEncodingExperimental H264MultipleBitrate1080p EncoderNamedPreset = original.H264MultipleBitrate1080p H264MultipleBitrate720p EncoderNamedPreset = original.H264MultipleBitrate720p @@ -556,6 +558,7 @@ type ContentKeyPolicyCollectionIterator = original.ContentKeyPolicyCollectionIte type ContentKeyPolicyCollectionPage = original.ContentKeyPolicyCollectionPage type ContentKeyPolicyConfiguration = original.ContentKeyPolicyConfiguration type ContentKeyPolicyFairPlayConfiguration = original.ContentKeyPolicyFairPlayConfiguration +type ContentKeyPolicyFairPlayOfflineRentalConfiguration = original.ContentKeyPolicyFairPlayOfflineRentalConfiguration type ContentKeyPolicyOpenRestriction = original.ContentKeyPolicyOpenRestriction type ContentKeyPolicyOption = original.ContentKeyPolicyOption type ContentKeyPolicyPlayReadyConfiguration = original.ContentKeyPolicyPlayReadyConfiguration diff --git a/profiles/latest/netapp/mgmt/netapp/models.go b/profiles/latest/netapp/mgmt/netapp/models.go index 962468f7c67e..0c849f443f5d 100644 --- a/profiles/latest/netapp/mgmt/netapp/models.go +++ b/profiles/latest/netapp/mgmt/netapp/models.go @@ -19,7 +19,7 @@ package netapp -import original "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-08-01/netapp" +import original "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-10-01/netapp" const ( DefaultBaseURI = original.DefaultBaseURI @@ -34,6 +34,13 @@ const ( MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckNameResourceTypes = original.MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ) +type EndpointType = original.EndpointType + +const ( + Dst EndpointType = original.Dst + Src EndpointType = original.Src +) + type InAvailabilityReasonType = original.InAvailabilityReasonType const ( @@ -41,6 +48,31 @@ const ( Invalid InAvailabilityReasonType = original.Invalid ) +type MirrorState = original.MirrorState + +const ( + Broken MirrorState = original.Broken + Mirrored MirrorState = original.Mirrored + Uninitialized MirrorState = original.Uninitialized +) + +type RelationshipStatus = original.RelationshipStatus + +const ( + Idle RelationshipStatus = original.Idle + Transferring RelationshipStatus = original.Transferring +) + +type ReplicationSchedule = original.ReplicationSchedule + +const ( + OneZerominutely ReplicationSchedule = original.OneZerominutely + Daily ReplicationSchedule = original.Daily + Hourly ReplicationSchedule = original.Hourly + Monthly ReplicationSchedule = original.Monthly + Weekly ReplicationSchedule = original.Weekly +) + type ServiceLevel = original.ServiceLevel const ( @@ -57,6 +89,7 @@ type AccountsClient = original.AccountsClient type AccountsCreateOrUpdateFuture = original.AccountsCreateOrUpdateFuture type AccountsDeleteFuture = original.AccountsDeleteFuture type ActiveDirectory = original.ActiveDirectory +type AuthorizeRequest = original.AuthorizeRequest type BaseClient = original.BaseClient type CapacityPool = original.CapacityPool type CapacityPoolList = original.CapacityPoolList @@ -79,6 +112,7 @@ type PoolsClient = original.PoolsClient type PoolsCreateOrUpdateFuture = original.PoolsCreateOrUpdateFuture type PoolsDeleteFuture = original.PoolsDeleteFuture type ReplicationObject = original.ReplicationObject +type ReplicationStatus = original.ReplicationStatus type ResourceClient = original.ResourceClient type ResourceNameAvailability = original.ResourceNameAvailability type ResourceNameAvailabilityRequest = original.ResourceNameAvailabilityRequest @@ -153,9 +187,21 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { return original.PossibleCheckNameResourceTypesValues() } +func PossibleEndpointTypeValues() []EndpointType { + return original.PossibleEndpointTypeValues() +} func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { return original.PossibleInAvailabilityReasonTypeValues() } +func PossibleMirrorStateValues() []MirrorState { + return original.PossibleMirrorStateValues() +} +func PossibleRelationshipStatusValues() []RelationshipStatus { + return original.PossibleRelationshipStatusValues() +} +func PossibleReplicationScheduleValues() []ReplicationSchedule { + return original.PossibleReplicationScheduleValues() +} func PossibleServiceLevelValues() []ServiceLevel { return original.PossibleServiceLevelValues() } diff --git a/profiles/latest/netapp/mgmt/netapp/netappapi/models.go b/profiles/latest/netapp/mgmt/netapp/netappapi/models.go index 4d8be867cf43..058cbc7760aa 100644 --- a/profiles/latest/netapp/mgmt/netapp/netappapi/models.go +++ b/profiles/latest/netapp/mgmt/netapp/netappapi/models.go @@ -19,7 +19,7 @@ package netappapi -import original "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-08-01/netapp/netappapi" +import original "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-10-01/netapp/netappapi" type AccountsClientAPI = original.AccountsClientAPI type MountTargetsClientAPI = original.MountTargetsClientAPI diff --git a/profiles/latest/resourcehealth/mgmt/resourcehealth/models.go b/profiles/latest/resourcehealth/mgmt/resourcehealth/models.go index 86cb0ae6c878..2ae980a511ad 100644 --- a/profiles/latest/resourcehealth/mgmt/resourcehealth/models.go +++ b/profiles/latest/resourcehealth/mgmt/resourcehealth/models.go @@ -44,6 +44,22 @@ const ( Transient ReasonChronicityTypes = original.Transient ) +type SeverityValues = original.SeverityValues + +const ( + Error SeverityValues = original.Error + Information SeverityValues = original.Information + Warning SeverityValues = original.Warning +) + +type StageValues = original.StageValues + +const ( + Active StageValues = original.Active + Archived StageValues = original.Archived + Resolve StageValues = original.Resolve +) + type AvailabilityStatus = original.AvailabilityStatus type AvailabilityStatusListResult = original.AvailabilityStatusListResult type AvailabilityStatusListResultIterator = original.AvailabilityStatusListResultIterator @@ -51,18 +67,32 @@ type AvailabilityStatusListResultPage = original.AvailabilityStatusListResultPag type AvailabilityStatusProperties = original.AvailabilityStatusProperties type AvailabilityStatusPropertiesRecentlyResolvedState = original.AvailabilityStatusPropertiesRecentlyResolvedState type AvailabilityStatusesClient = original.AvailabilityStatusesClient +type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient type ChildAvailabilityStatusesClient = original.ChildAvailabilityStatusesClient type ChildResourcesClient = original.ChildResourcesClient +type EmergingIssue = original.EmergingIssue +type EmergingIssueImpact = original.EmergingIssueImpact +type EmergingIssueListResult = original.EmergingIssueListResult +type EmergingIssueListResultIterator = original.EmergingIssueListResultIterator +type EmergingIssueListResultPage = original.EmergingIssueListResultPage +type EmergingIssuesClient = original.EmergingIssuesClient +type EmergingIssuesGetResult = original.EmergingIssuesGetResult type ErrorResponse = original.ErrorResponse +type ImpactedRegion = original.ImpactedRegion type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationsClient = original.OperationsClient +type ProxyResource = original.ProxyResource type RecommendedAction = original.RecommendedAction +type Resource = original.Resource type ServiceImpactingEvent = original.ServiceImpactingEvent type ServiceImpactingEventIncidentProperties = original.ServiceImpactingEventIncidentProperties type ServiceImpactingEventStatus = original.ServiceImpactingEventStatus +type StatusActiveEvent = original.StatusActiveEvent +type StatusBanner = original.StatusBanner +type TrackedResource = original.TrackedResource func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -91,6 +121,18 @@ func NewChildResourcesClient(subscriptionID string) ChildResourcesClient { func NewChildResourcesClientWithBaseURI(baseURI string, subscriptionID string) ChildResourcesClient { return original.NewChildResourcesClientWithBaseURI(baseURI, subscriptionID) } +func NewEmergingIssueListResultIterator(page EmergingIssueListResultPage) EmergingIssueListResultIterator { + return original.NewEmergingIssueListResultIterator(page) +} +func NewEmergingIssueListResultPage(getNextPage func(context.Context, EmergingIssueListResult) (EmergingIssueListResult, error)) EmergingIssueListResultPage { + return original.NewEmergingIssueListResultPage(getNextPage) +} +func NewEmergingIssuesClient(subscriptionID string) EmergingIssuesClient { + return original.NewEmergingIssuesClient(subscriptionID) +} +func NewEmergingIssuesClientWithBaseURI(baseURI string, subscriptionID string) EmergingIssuesClient { + return original.NewEmergingIssuesClientWithBaseURI(baseURI, subscriptionID) +} func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) } @@ -106,6 +148,12 @@ func PossibleAvailabilityStateValuesValues() []AvailabilityStateValues { func PossibleReasonChronicityTypesValues() []ReasonChronicityTypes { return original.PossibleReasonChronicityTypesValues() } +func PossibleSeverityValuesValues() []SeverityValues { + return original.PossibleSeverityValuesValues() +} +func PossibleStageValuesValues() []StageValues { + return original.PossibleStageValuesValues() +} func UserAgent() string { return original.UserAgent() + " profiles/latest" } diff --git a/profiles/latest/resourcehealth/mgmt/resourcehealth/resourcehealthapi/models.go b/profiles/latest/resourcehealth/mgmt/resourcehealth/resourcehealthapi/models.go index 86f8804138fd..e5342f3ac740 100644 --- a/profiles/latest/resourcehealth/mgmt/resourcehealth/resourcehealthapi/models.go +++ b/profiles/latest/resourcehealth/mgmt/resourcehealth/resourcehealthapi/models.go @@ -24,4 +24,5 @@ import original "github.com/Azure/azure-sdk-for-go/services/resourcehealth/mgmt/ type AvailabilityStatusesClientAPI = original.AvailabilityStatusesClientAPI type ChildAvailabilityStatusesClientAPI = original.ChildAvailabilityStatusesClientAPI type ChildResourcesClientAPI = original.ChildResourcesClientAPI +type EmergingIssuesClientAPI = original.EmergingIssuesClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/cognitiveservices/textanalytics/models.go b/profiles/preview/cognitiveservices/textanalytics/models.go index 70f7b6365f7d..a0e7e64a02f2 100644 --- a/profiles/preview/cognitiveservices/textanalytics/models.go +++ b/profiles/preview/cognitiveservices/textanalytics/models.go @@ -42,7 +42,6 @@ type MultiLanguageInput = original.MultiLanguageInput type RequestStatistics = original.RequestStatistics type SentimentBatchResult = original.SentimentBatchResult type SentimentBatchResultItem = original.SentimentBatchResultItem -type SetObject = original.SetObject func New(endpoint string) BaseClient { return original.New(endpoint) diff --git a/profiles/preview/compute/mgmt/compute/models.go b/profiles/preview/compute/mgmt/compute/models.go index 7f529528affb..a5f0bd6a742b 100644 --- a/profiles/preview/compute/mgmt/compute/models.go +++ b/profiles/preview/compute/mgmt/compute/models.go @@ -935,6 +935,7 @@ type SourceVault = original.SourceVault type StorageProfile = original.StorageProfile type SubResource = original.SubResource type SubResourceReadOnly = original.SubResourceReadOnly +type SubResourceWithColocationStatus = original.SubResourceWithColocationStatus type TargetRegion = original.TargetRegion type TerminateNotificationProfile = original.TerminateNotificationProfile type ThrottledRequestsInput = original.ThrottledRequestsInput diff --git a/profiles/preview/containerservice/mgmt/containerservice/models.go b/profiles/preview/containerservice/mgmt/containerservice/models.go index 885404e7858a..9431fc7e867a 100644 --- a/profiles/preview/containerservice/mgmt/containerservice/models.go +++ b/profiles/preview/containerservice/mgmt/containerservice/models.go @@ -39,6 +39,7 @@ const ( type Kind = original.Kind const ( + KindAADIdentityProvider Kind = original.KindAADIdentityProvider KindOpenShiftManagedClusterBaseIdentityProvider Kind = original.KindOpenShiftManagedClusterBaseIdentityProvider ) @@ -358,14 +359,6 @@ type BaseClient = original.BaseClient type BasicOpenShiftManagedClusterBaseIdentityProvider = original.BasicOpenShiftManagedClusterBaseIdentityProvider type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody -type Componentsschemasagentpoolallof1 = original.Componentsschemasagentpoolallof1 -type Componentsschemascontainerserviceallof1 = original.Componentsschemascontainerserviceallof1 -type Componentsschemasmanagedclusteraccessprofileallof1 = original.Componentsschemasmanagedclusteraccessprofileallof1 -type Componentsschemasmanagedclusteragentpoolprofileallof1 = original.Componentsschemasmanagedclusteragentpoolprofileallof1 -type Componentsschemasmanagedclusterallof1 = original.Componentsschemasmanagedclusterallof1 -type Componentsschemasmanagedclusterpropertiespropertiesidentityprofileadditionalproperties = original.Componentsschemasmanagedclusterpropertiespropertiesidentityprofileadditionalproperties -type Componentsschemasopenshiftmanagedclusteraadidentityproviderallof1 = original.Componentsschemasopenshiftmanagedclusteraadidentityproviderallof1 -type Componentsschemasopenshiftmanagedclusterallof1 = original.Componentsschemasopenshiftmanagedclusterallof1 type ContainerService = original.ContainerService type ContainerServicesClient = original.ContainerServicesClient type ContainerServicesCreateOrUpdateFutureType = original.ContainerServicesCreateOrUpdateFutureType @@ -398,6 +391,7 @@ type ManagedClusterLoadBalancerProfileOutboundIPs = original.ManagedClusterLoadB type ManagedClusterPoolUpgradeProfile = original.ManagedClusterPoolUpgradeProfile type ManagedClusterPoolUpgradeProfileUpgradesItem = original.ManagedClusterPoolUpgradeProfileUpgradesItem type ManagedClusterProperties = original.ManagedClusterProperties +type ManagedClusterPropertiesIdentityProfileValue = original.ManagedClusterPropertiesIdentityProfileValue type ManagedClusterServicePrincipalProfile = original.ManagedClusterServicePrincipalProfile type ManagedClusterUpgradeProfile = original.ManagedClusterUpgradeProfile type ManagedClusterUpgradeProfileProperties = original.ManagedClusterUpgradeProfileProperties diff --git a/profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go b/profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go index fa769db5d05e..1ffe67fd69c9 100644 --- a/profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go +++ b/profiles/preview/databoxedge/mgmt/databoxedge/databoxedgeapi/models.go @@ -19,10 +19,11 @@ package databoxedgeapi -import original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge/databoxedgeapi" +import original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-08-01/databoxedge/databoxedgeapi" type AlertsClientAPI = original.AlertsClientAPI type BandwidthSchedulesClientAPI = original.BandwidthSchedulesClientAPI +type ContainersClientAPI = original.ContainersClientAPI type DevicesClientAPI = original.DevicesClientAPI type JobsClientAPI = original.JobsClientAPI type NodesClientAPI = original.NodesClientAPI @@ -31,6 +32,8 @@ type OperationsStatusClientAPI = original.OperationsStatusClientAPI type OrdersClientAPI = original.OrdersClientAPI type RolesClientAPI = original.RolesClientAPI type SharesClientAPI = original.SharesClientAPI +type SkusClientAPI = original.SkusClientAPI type StorageAccountCredentialsClientAPI = original.StorageAccountCredentialsClientAPI +type StorageAccountsClientAPI = original.StorageAccountsClientAPI type TriggersClientAPI = original.TriggersClientAPI type UsersClientAPI = original.UsersClientAPI diff --git a/profiles/preview/databoxedge/mgmt/databoxedge/models.go b/profiles/preview/databoxedge/mgmt/databoxedge/models.go index 873bd0836bb3..94074df96fd5 100644 --- a/profiles/preview/databoxedge/mgmt/databoxedge/models.go +++ b/profiles/preview/databoxedge/mgmt/databoxedge/models.go @@ -22,7 +22,7 @@ package databoxedge import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-07-01/databoxedge" + original "github.com/Azure/azure-sdk-for-go/services/databoxedge/mgmt/2019-08-01/databoxedge" ) const ( @@ -67,6 +67,16 @@ const ( ReadWrite ClientPermissionType = original.ReadWrite ) +type ContainerStatus = original.ContainerStatus + +const ( + NeedsAttention ContainerStatus = original.NeedsAttention + Offline ContainerStatus = original.Offline + OK ContainerStatus = original.OK + Unknown ContainerStatus = original.Unknown + Updating ContainerStatus = original.Updating +) + type DataPolicy = original.DataPolicy const ( @@ -89,13 +99,13 @@ const ( type DeviceStatus = original.DeviceStatus const ( - Disconnected DeviceStatus = original.Disconnected - Maintenance DeviceStatus = original.Maintenance - NeedsAttention DeviceStatus = original.NeedsAttention - Offline DeviceStatus = original.Offline - Online DeviceStatus = original.Online - PartiallyDisconnected DeviceStatus = original.PartiallyDisconnected - ReadyToSetup DeviceStatus = original.ReadyToSetup + DeviceStatusDisconnected DeviceStatus = original.DeviceStatusDisconnected + DeviceStatusMaintenance DeviceStatus = original.DeviceStatusMaintenance + DeviceStatusNeedsAttention DeviceStatus = original.DeviceStatusNeedsAttention + DeviceStatusOffline DeviceStatus = original.DeviceStatusOffline + DeviceStatusOnline DeviceStatus = original.DeviceStatusOnline + DeviceStatusPartiallyDisconnected DeviceStatus = original.DeviceStatusPartiallyDisconnected + DeviceStatusReadyToSetup DeviceStatus = original.DeviceStatusReadyToSetup ) type DeviceType = original.DeviceType @@ -107,10 +117,10 @@ const ( type DownloadPhase = original.DownloadPhase const ( - Downloading DownloadPhase = original.Downloading - Initializing DownloadPhase = original.Initializing - Unknown DownloadPhase = original.Unknown - Verifying DownloadPhase = original.Verifying + DownloadPhaseDownloading DownloadPhase = original.DownloadPhaseDownloading + DownloadPhaseInitializing DownloadPhase = original.DownloadPhaseInitializing + DownloadPhaseUnknown DownloadPhase = original.DownloadPhaseUnknown + DownloadPhaseVerifying DownloadPhase = original.DownloadPhaseVerifying ) type EncryptionAlgorithm = original.EncryptionAlgorithm @@ -144,11 +154,12 @@ const ( type JobType = original.JobType const ( - JobTypeDownloadUpdates JobType = original.JobTypeDownloadUpdates - JobTypeInstallUpdates JobType = original.JobTypeInstallUpdates - JobTypeInvalid JobType = original.JobTypeInvalid - JobTypeRefreshShare JobType = original.JobTypeRefreshShare - JobTypeScanForUpdates JobType = original.JobTypeScanForUpdates + JobTypeDownloadUpdates JobType = original.JobTypeDownloadUpdates + JobTypeInstallUpdates JobType = original.JobTypeInstallUpdates + JobTypeInvalid JobType = original.JobTypeInvalid + JobTypeRefreshContainer JobType = original.JobTypeRefreshContainer + JobTypeRefreshShare JobType = original.JobTypeRefreshShare + JobTypeScanForUpdates JobType = original.JobTypeScanForUpdates ) type Kind = original.Kind @@ -321,8 +332,22 @@ const ( type SkuName = original.SkuName const ( - Edge SkuName = original.Edge - Gateway SkuName = original.Gateway + Edge SkuName = original.Edge + Gateway SkuName = original.Gateway + TEA1Node SkuName = original.TEA1Node + TEA1NodeHeater SkuName = original.TEA1NodeHeater + TEA1NodeUPS SkuName = original.TEA1NodeUPS + TEA1NodeUPSHeater SkuName = original.TEA1NodeUPSHeater + TEA4NodeHeater SkuName = original.TEA4NodeHeater + TEA4NodeUPSHeater SkuName = original.TEA4NodeUPSHeater + TMA SkuName = original.TMA +) + +type SkuRestrictionReasonCode = original.SkuRestrictionReasonCode + +const ( + NotAvailableForSubscription SkuRestrictionReasonCode = original.NotAvailableForSubscription + QuotaID SkuRestrictionReasonCode = original.QuotaID ) type SkuTier = original.SkuTier @@ -331,6 +356,16 @@ const ( Standard SkuTier = original.Standard ) +type StorageAccountStatus = original.StorageAccountStatus + +const ( + StorageAccountStatusNeedsAttention StorageAccountStatus = original.StorageAccountStatusNeedsAttention + StorageAccountStatusOffline StorageAccountStatus = original.StorageAccountStatusOffline + StorageAccountStatusOK StorageAccountStatus = original.StorageAccountStatusOK + StorageAccountStatusUnknown StorageAccountStatus = original.StorageAccountStatusUnknown + StorageAccountStatusUpdating StorageAccountStatus = original.StorageAccountStatusUpdating +) + type TimeGrain = original.TimeGrain const ( @@ -375,6 +410,14 @@ const ( UpdateOperationStageUnknown UpdateOperationStage = original.UpdateOperationStageUnknown ) +type UserType = original.UserType + +const ( + UserTypeARM UserType = original.UserTypeARM + UserTypeLocalManagement UserType = original.UserTypeLocalManagement + UserTypeShare UserType = original.UserTypeShare +) + type ARMBaseModel = original.ARMBaseModel type Address = original.Address type Alert = original.Alert @@ -402,6 +445,15 @@ type ClientAccessRight = original.ClientAccessRight type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody type ContactDetails = original.ContactDetails +type Container = original.Container +type ContainerList = original.ContainerList +type ContainerListIterator = original.ContainerListIterator +type ContainerListPage = original.ContainerListPage +type ContainerProperties = original.ContainerProperties +type ContainersClient = original.ContainersClient +type ContainersCreateOrUpdateFuture = original.ContainersCreateOrUpdateFuture +type ContainersDeleteFuture = original.ContainersDeleteFuture +type ContainersRefreshFuture = original.ContainersRefreshFuture type Device = original.Device type DeviceExtendedInfo = original.DeviceExtendedInfo type DeviceExtendedInfoProperties = original.DeviceExtendedInfoProperties @@ -463,6 +515,7 @@ type PeriodicTimerProperties = original.PeriodicTimerProperties type PeriodicTimerSourceInfo = original.PeriodicTimerSourceInfo type RawCertificateData = original.RawCertificateData type RefreshDetails = original.RefreshDetails +type ResourceTypeSku = original.ResourceTypeSku type Role = original.Role type RoleList = original.RoleList type RoleListIterator = original.RoleListIterator @@ -486,6 +539,13 @@ type SharesCreateOrUpdateFuture = original.SharesCreateOrUpdateFuture type SharesDeleteFuture = original.SharesDeleteFuture type SharesRefreshFuture = original.SharesRefreshFuture type Sku = original.Sku +type SkuCost = original.SkuCost +type SkuInformationList = original.SkuInformationList +type SkuLocationInfo = original.SkuLocationInfo +type SkuRestriction = original.SkuRestriction +type SkuRestrictionInfo = original.SkuRestrictionInfo +type SkusClient = original.SkusClient +type StorageAccount = original.StorageAccount type StorageAccountCredential = original.StorageAccountCredential type StorageAccountCredentialList = original.StorageAccountCredentialList type StorageAccountCredentialListIterator = original.StorageAccountCredentialListIterator @@ -494,6 +554,13 @@ type StorageAccountCredentialProperties = original.StorageAccountCredentialPrope type StorageAccountCredentialsClient = original.StorageAccountCredentialsClient type StorageAccountCredentialsCreateOrUpdateFuture = original.StorageAccountCredentialsCreateOrUpdateFuture type StorageAccountCredentialsDeleteFuture = original.StorageAccountCredentialsDeleteFuture +type StorageAccountList = original.StorageAccountList +type StorageAccountListIterator = original.StorageAccountListIterator +type StorageAccountListPage = original.StorageAccountListPage +type StorageAccountProperties = original.StorageAccountProperties +type StorageAccountsClient = original.StorageAccountsClient +type StorageAccountsCreateOrUpdateFuture = original.StorageAccountsCreateOrUpdateFuture +type StorageAccountsDeleteFuture = original.StorageAccountsDeleteFuture type SymmetricKey = original.SymmetricKey type TrackingInfo = original.TrackingInfo type Trigger = original.Trigger @@ -547,6 +614,18 @@ func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) Bandwidt func NewBandwidthSchedulesListPage(getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage { return original.NewBandwidthSchedulesListPage(getNextPage) } +func NewContainerListIterator(page ContainerListPage) ContainerListIterator { + return original.NewContainerListIterator(page) +} +func NewContainerListPage(getNextPage func(context.Context, ContainerList) (ContainerList, error)) ContainerListPage { + return original.NewContainerListPage(getNextPage) +} +func NewContainersClient(subscriptionID string) ContainersClient { + return original.NewContainersClient(subscriptionID) +} +func NewContainersClientWithBaseURI(baseURI string, subscriptionID string) ContainersClient { + return original.NewContainersClientWithBaseURI(baseURI, subscriptionID) +} func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { return original.NewDeviceListIterator(page) } @@ -625,6 +704,12 @@ func NewSharesClient(subscriptionID string) SharesClient { func NewSharesClientWithBaseURI(baseURI string, subscriptionID string) SharesClient { return original.NewSharesClientWithBaseURI(baseURI, subscriptionID) } +func NewSkusClient(subscriptionID string) SkusClient { + return original.NewSkusClient(subscriptionID) +} +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return original.NewSkusClientWithBaseURI(baseURI, subscriptionID) +} func NewStorageAccountCredentialListIterator(page StorageAccountCredentialListPage) StorageAccountCredentialListIterator { return original.NewStorageAccountCredentialListIterator(page) } @@ -637,6 +722,18 @@ func NewStorageAccountCredentialsClient(subscriptionID string) StorageAccountCre func NewStorageAccountCredentialsClientWithBaseURI(baseURI string, subscriptionID string) StorageAccountCredentialsClient { return original.NewStorageAccountCredentialsClientWithBaseURI(baseURI, subscriptionID) } +func NewStorageAccountListIterator(page StorageAccountListPage) StorageAccountListIterator { + return original.NewStorageAccountListIterator(page) +} +func NewStorageAccountListPage(getNextPage func(context.Context, StorageAccountList) (StorageAccountList, error)) StorageAccountListPage { + return original.NewStorageAccountListPage(getNextPage) +} +func NewStorageAccountsClient(subscriptionID string) StorageAccountsClient { + return original.NewStorageAccountsClient(subscriptionID) +} +func NewStorageAccountsClientWithBaseURI(baseURI string, subscriptionID string) StorageAccountsClient { + return original.NewStorageAccountsClientWithBaseURI(baseURI, subscriptionID) +} func NewTriggerListIterator(page TriggerListPage) TriggerListIterator { return original.NewTriggerListIterator(page) } @@ -679,6 +776,9 @@ func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat { func PossibleClientPermissionTypeValues() []ClientPermissionType { return original.PossibleClientPermissionTypeValues() } +func PossibleContainerStatusValues() []ContainerStatus { + return original.PossibleContainerStatusValues() +} func PossibleDataPolicyValues() []DataPolicy { return original.PossibleDataPolicyValues() } @@ -766,9 +866,15 @@ func PossibleShareStatusValues() []ShareStatus { func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } +func PossibleSkuRestrictionReasonCodeValues() []SkuRestrictionReasonCode { + return original.PossibleSkuRestrictionReasonCodeValues() +} func PossibleSkuTierValues() []SkuTier { return original.PossibleSkuTierValues() } +func PossibleStorageAccountStatusValues() []StorageAccountStatus { + return original.PossibleStorageAccountStatusValues() +} func PossibleTimeGrainValues() []TimeGrain { return original.PossibleTimeGrainValues() } @@ -778,6 +884,9 @@ func PossibleUpdateOperationStageValues() []UpdateOperationStage { func PossibleUpdateOperationValues() []UpdateOperation { return original.PossibleUpdateOperationValues() } +func PossibleUserTypeValues() []UserType { + return original.PossibleUserTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/databricks/mgmt/databricks/models.go b/profiles/preview/databricks/mgmt/databricks/models.go index c62b6371bb17..fbf21a4c51d0 100644 --- a/profiles/preview/databricks/mgmt/databricks/models.go +++ b/profiles/preview/databricks/mgmt/databricks/models.go @@ -29,6 +29,14 @@ const ( DefaultBaseURI = original.DefaultBaseURI ) +type CustomParameterType = original.CustomParameterType + +const ( + Bool CustomParameterType = original.Bool + Object CustomParameterType = original.Object + String CustomParameterType = original.String +) + type ProvisioningState = original.ProvisioningState const ( @@ -59,6 +67,10 @@ type Resource = original.Resource type Sku = original.Sku type TrackedResource = original.TrackedResource type Workspace = original.Workspace +type WorkspaceCustomBooleanParameter = original.WorkspaceCustomBooleanParameter +type WorkspaceCustomObjectParameter = original.WorkspaceCustomObjectParameter +type WorkspaceCustomParameters = original.WorkspaceCustomParameters +type WorkspaceCustomStringParameter = original.WorkspaceCustomStringParameter type WorkspaceListResult = original.WorkspaceListResult type WorkspaceListResultIterator = original.WorkspaceListResultIterator type WorkspaceListResultPage = original.WorkspaceListResultPage @@ -100,6 +112,9 @@ func NewWorkspacesClient(subscriptionID string) WorkspacesClient { func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { return original.NewWorkspacesClientWithBaseURI(baseURI, subscriptionID) } +func PossibleCustomParameterTypeValues() []CustomParameterType { + return original.PossibleCustomParameterTypeValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/preview/datafactory/mgmt/datafactory/models.go b/profiles/preview/datafactory/mgmt/datafactory/models.go index 65c83c157d52..f56f1ff4364a 100644 --- a/profiles/preview/datafactory/mgmt/datafactory/models.go +++ b/profiles/preview/datafactory/mgmt/datafactory/models.go @@ -978,6 +978,23 @@ const ( TypeZipDeflate TypeBasicDatasetCompression = original.TypeZipDeflate ) +type TypeBasicDatasetLocation = original.TypeBasicDatasetLocation + +const ( + TypeAmazonS3Location TypeBasicDatasetLocation = original.TypeAmazonS3Location + TypeAzureBlobFSLocation TypeBasicDatasetLocation = original.TypeAzureBlobFSLocation + TypeAzureBlobStorageLocation TypeBasicDatasetLocation = original.TypeAzureBlobStorageLocation + TypeAzureDataLakeStoreLocation TypeBasicDatasetLocation = original.TypeAzureDataLakeStoreLocation + TypeAzureFileStorageLocation TypeBasicDatasetLocation = original.TypeAzureFileStorageLocation + TypeDatasetLocation TypeBasicDatasetLocation = original.TypeDatasetLocation + TypeFileServerLocation TypeBasicDatasetLocation = original.TypeFileServerLocation + TypeFtpServerLocation TypeBasicDatasetLocation = original.TypeFtpServerLocation + TypeGoogleCloudStorageLocation TypeBasicDatasetLocation = original.TypeGoogleCloudStorageLocation + TypeHdfsLocation TypeBasicDatasetLocation = original.TypeHdfsLocation + TypeHTTPServerLocation TypeBasicDatasetLocation = original.TypeHTTPServerLocation + TypeSftpLocation TypeBasicDatasetLocation = original.TypeSftpLocation +) + type TypeBasicDatasetStorageFormat = original.TypeBasicDatasetStorageFormat const ( @@ -1006,6 +1023,22 @@ const ( TypeFactoryVSTSConfiguration TypeBasicFactoryRepoConfiguration = original.TypeFactoryVSTSConfiguration ) +type TypeBasicFormatReadSettings = original.TypeBasicFormatReadSettings + +const ( + TypeDelimitedTextReadSettings TypeBasicFormatReadSettings = original.TypeDelimitedTextReadSettings + TypeFormatReadSettings TypeBasicFormatReadSettings = original.TypeFormatReadSettings +) + +type TypeBasicFormatWriteSettings = original.TypeBasicFormatWriteSettings + +const ( + TypeAvroWriteSettings TypeBasicFormatWriteSettings = original.TypeAvroWriteSettings + TypeDelimitedTextWriteSettings TypeBasicFormatWriteSettings = original.TypeDelimitedTextWriteSettings + TypeFormatWriteSettings TypeBasicFormatWriteSettings = original.TypeFormatWriteSettings + TypeJSONWriteSettings TypeBasicFormatWriteSettings = original.TypeJSONWriteSettings +) + type TypeBasicIntegrationRuntime = original.TypeBasicIntegrationRuntime const ( @@ -1132,6 +1165,23 @@ const ( TypeSsisObjectMetadata TypeBasicSsisObjectMetadata = original.TypeSsisObjectMetadata ) +type TypeBasicStoreReadSettings = original.TypeBasicStoreReadSettings + +const ( + TypeAmazonS3ReadSettings TypeBasicStoreReadSettings = original.TypeAmazonS3ReadSettings + TypeAzureBlobFSReadSettings TypeBasicStoreReadSettings = original.TypeAzureBlobFSReadSettings + TypeAzureBlobStorageReadSettings TypeBasicStoreReadSettings = original.TypeAzureBlobStorageReadSettings + TypeAzureDataLakeStoreReadSettings TypeBasicStoreReadSettings = original.TypeAzureDataLakeStoreReadSettings + TypeAzureFileStorageReadSettings TypeBasicStoreReadSettings = original.TypeAzureFileStorageReadSettings + TypeFileServerReadSettings TypeBasicStoreReadSettings = original.TypeFileServerReadSettings + TypeFtpReadSettings TypeBasicStoreReadSettings = original.TypeFtpReadSettings + TypeGoogleCloudStorageReadSettings TypeBasicStoreReadSettings = original.TypeGoogleCloudStorageReadSettings + TypeHdfsReadSettings TypeBasicStoreReadSettings = original.TypeHdfsReadSettings + TypeHTTPReadSettings TypeBasicStoreReadSettings = original.TypeHTTPReadSettings + TypeSftpReadSettings TypeBasicStoreReadSettings = original.TypeSftpReadSettings + TypeStoreReadSettings TypeBasicStoreReadSettings = original.TypeStoreReadSettings +) + type TypeBasicStoreWriteSettings = original.TypeBasicStoreWriteSettings const ( @@ -1139,6 +1189,7 @@ const ( TypeAzureBlobStorageWriteSettings TypeBasicStoreWriteSettings = original.TypeAzureBlobStorageWriteSettings TypeAzureDataLakeStoreWriteSettings TypeBasicStoreWriteSettings = original.TypeAzureDataLakeStoreWriteSettings TypeFileServerWriteSettings TypeBasicStoreWriteSettings = original.TypeFileServerWriteSettings + TypeSftpWriteSettings TypeBasicStoreWriteSettings = original.TypeSftpWriteSettings TypeStoreWriteSettings TypeBasicStoreWriteSettings = original.TypeStoreWriteSettings ) @@ -1322,10 +1373,13 @@ type BasicCustomSetupBase = original.BasicCustomSetupBase type BasicDataFlow = original.BasicDataFlow type BasicDataset = original.BasicDataset type BasicDatasetCompression = original.BasicDatasetCompression +type BasicDatasetLocation = original.BasicDatasetLocation type BasicDatasetStorageFormat = original.BasicDatasetStorageFormat type BasicDependencyReference = original.BasicDependencyReference type BasicExecutionActivity = original.BasicExecutionActivity type BasicFactoryRepoConfiguration = original.BasicFactoryRepoConfiguration +type BasicFormatReadSettings = original.BasicFormatReadSettings +type BasicFormatWriteSettings = original.BasicFormatWriteSettings type BasicIntegrationRuntime = original.BasicIntegrationRuntime type BasicIntegrationRuntimeStatus = original.BasicIntegrationRuntimeStatus type BasicLinkedIntegrationRuntimeType = original.BasicLinkedIntegrationRuntimeType @@ -1333,6 +1387,7 @@ type BasicLinkedService = original.BasicLinkedService type BasicMultiplePipelineTrigger = original.BasicMultiplePipelineTrigger type BasicSecretBase = original.BasicSecretBase type BasicSsisObjectMetadata = original.BasicSsisObjectMetadata +type BasicStoreReadSettings = original.BasicStoreReadSettings type BasicStoreWriteSettings = original.BasicStoreWriteSettings type BasicTabularSource = original.BasicTabularSource type BasicTrigger = original.BasicTrigger @@ -1500,6 +1555,7 @@ type EnvironmentVariableSetup = original.EnvironmentVariableSetup type EnvironmentVariableSetupTypeProperties = original.EnvironmentVariableSetupTypeProperties type ExecuteDataFlowActivity = original.ExecuteDataFlowActivity type ExecuteDataFlowActivityTypeProperties = original.ExecuteDataFlowActivityTypeProperties +type ExecuteDataFlowActivityTypePropertiesCompute = original.ExecuteDataFlowActivityTypePropertiesCompute type ExecutePipelineActivity = original.ExecutePipelineActivity type ExecutePipelineActivityTypeProperties = original.ExecutePipelineActivityTypeProperties type ExecuteSSISPackageActivity = original.ExecuteSSISPackageActivity @@ -1937,6 +1993,7 @@ type SftpLocation = original.SftpLocation type SftpReadSettings = original.SftpReadSettings type SftpServerLinkedService = original.SftpServerLinkedService type SftpServerLinkedServiceTypeProperties = original.SftpServerLinkedServiceTypeProperties +type SftpWriteSettings = original.SftpWriteSettings type ShopifyLinkedService = original.ShopifyLinkedService type ShopifyLinkedServiceTypeProperties = original.ShopifyLinkedServiceTypeProperties type ShopifyObjectDataset = original.ShopifyObjectDataset @@ -2446,6 +2503,9 @@ func PossibleTypeBasicDataFlowValues() []TypeBasicDataFlow { func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression { return original.PossibleTypeBasicDatasetCompressionValues() } +func PossibleTypeBasicDatasetLocationValues() []TypeBasicDatasetLocation { + return original.PossibleTypeBasicDatasetLocationValues() +} func PossibleTypeBasicDatasetStorageFormatValues() []TypeBasicDatasetStorageFormat { return original.PossibleTypeBasicDatasetStorageFormatValues() } @@ -2458,6 +2518,12 @@ func PossibleTypeBasicDependencyReferenceValues() []TypeBasicDependencyReference func PossibleTypeBasicFactoryRepoConfigurationValues() []TypeBasicFactoryRepoConfiguration { return original.PossibleTypeBasicFactoryRepoConfigurationValues() } +func PossibleTypeBasicFormatReadSettingsValues() []TypeBasicFormatReadSettings { + return original.PossibleTypeBasicFormatReadSettingsValues() +} +func PossibleTypeBasicFormatWriteSettingsValues() []TypeBasicFormatWriteSettings { + return original.PossibleTypeBasicFormatWriteSettingsValues() +} func PossibleTypeBasicIntegrationRuntimeStatusValues() []TypeBasicIntegrationRuntimeStatus { return original.PossibleTypeBasicIntegrationRuntimeStatusValues() } @@ -2470,6 +2536,9 @@ func PossibleTypeBasicLinkedServiceValues() []TypeBasicLinkedService { func PossibleTypeBasicSsisObjectMetadataValues() []TypeBasicSsisObjectMetadata { return original.PossibleTypeBasicSsisObjectMetadataValues() } +func PossibleTypeBasicStoreReadSettingsValues() []TypeBasicStoreReadSettings { + return original.PossibleTypeBasicStoreReadSettingsValues() +} func PossibleTypeBasicStoreWriteSettingsValues() []TypeBasicStoreWriteSettings { return original.PossibleTypeBasicStoreWriteSettingsValues() } diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index c4a603b4c42c..02636c78618d 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-11-01/machinelearningservices/machinelearningservicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/machinelearningservicesapi" type BaseClientAPI = original.BaseClientAPI type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type QuotasClientAPI = original.QuotasClientAPI type UsagesClientAPI = original.UsagesClientAPI type VirtualMachineSizesClientAPI = original.VirtualMachineSizesClientAPI diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go index 4f28e7ac6a8c..6c2753fa1c81 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-11-01/machinelearningservices" + original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices" ) const ( @@ -88,16 +88,33 @@ const ( Unusable NodeState = original.Unusable ) +type PrivateEndpointConnectionProvisioningState = original.PrivateEndpointConnectionProvisioningState + +const ( + Creating PrivateEndpointConnectionProvisioningState = original.Creating + Deleting PrivateEndpointConnectionProvisioningState = original.Deleting + Failed PrivateEndpointConnectionProvisioningState = original.Failed + Succeeded PrivateEndpointConnectionProvisioningState = original.Succeeded +) + +type PrivateEndpointServiceConnectionStatus = original.PrivateEndpointServiceConnectionStatus + +const ( + Approved PrivateEndpointServiceConnectionStatus = original.Approved + Pending PrivateEndpointServiceConnectionStatus = original.Pending + Rejected PrivateEndpointServiceConnectionStatus = original.Rejected +) + type ProvisioningState = original.ProvisioningState const ( - Canceled ProvisioningState = original.Canceled - Creating ProvisioningState = original.Creating - Deleting ProvisioningState = original.Deleting - Failed ProvisioningState = original.Failed - Succeeded ProvisioningState = original.Succeeded - Unknown ProvisioningState = original.Unknown - Updating ProvisioningState = original.Updating + ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled + ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating + ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded + ProvisioningStateUnknown ProvisioningState = original.ProvisioningStateUnknown + ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating ) type QuotaUnit = original.QuotaUnit @@ -223,6 +240,15 @@ type PaginatedComputeResourcesList = original.PaginatedComputeResourcesList type PaginatedComputeResourcesListIterator = original.PaginatedComputeResourcesListIterator type PaginatedComputeResourcesListPage = original.PaginatedComputeResourcesListPage type Password = original.Password +type PrivateEndpoint = original.PrivateEndpoint +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateLinkResource = original.PrivateLinkResource +type PrivateLinkResourceListResult = original.PrivateLinkResourceListResult +type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState type QuotaBaseProperties = original.QuotaBaseProperties type QuotaUpdateParameters = original.QuotaUpdateParameters type QuotasClient = original.QuotasClient @@ -306,6 +332,18 @@ func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesList func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { return original.NewPaginatedComputeResourcesListPage(getNextPage) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewQuotasClient(subscriptionID string) QuotasClient { return original.NewQuotasClient(subscriptionID) } @@ -369,6 +407,12 @@ func PossibleComputeTypeValues() []ComputeType { func PossibleNodeStateValues() []NodeState { return original.PossibleNodeStateValues() } +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return original.PossiblePrivateEndpointConnectionProvisioningStateValues() +} +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return original.PossiblePrivateEndpointServiceConnectionStatusValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/preview/mediaservices/mgmt/media/models.go b/profiles/preview/mediaservices/mgmt/media/models.go index e9f7cc253e8a..aef85606b618 100644 --- a/profiles/preview/mediaservices/mgmt/media/models.go +++ b/profiles/preview/mediaservices/mgmt/media/models.go @@ -62,6 +62,7 @@ const ( type ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.ContentKeyPolicyFairPlayRentalAndLeaseKeyType const ( + DualExpiry ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.DualExpiry PersistentLimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.PersistentLimited PersistentUnlimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.PersistentUnlimited Undefined ContentKeyPolicyFairPlayRentalAndLeaseKeyType = original.Undefined @@ -122,6 +123,7 @@ type EncoderNamedPreset = original.EncoderNamedPreset const ( AACGoodQualityAudio EncoderNamedPreset = original.AACGoodQualityAudio AdaptiveStreaming EncoderNamedPreset = original.AdaptiveStreaming + ContentAwareEncoding EncoderNamedPreset = original.ContentAwareEncoding ContentAwareEncodingExperimental EncoderNamedPreset = original.ContentAwareEncodingExperimental H264MultipleBitrate1080p EncoderNamedPreset = original.H264MultipleBitrate1080p H264MultipleBitrate720p EncoderNamedPreset = original.H264MultipleBitrate720p @@ -556,6 +558,7 @@ type ContentKeyPolicyCollectionIterator = original.ContentKeyPolicyCollectionIte type ContentKeyPolicyCollectionPage = original.ContentKeyPolicyCollectionPage type ContentKeyPolicyConfiguration = original.ContentKeyPolicyConfiguration type ContentKeyPolicyFairPlayConfiguration = original.ContentKeyPolicyFairPlayConfiguration +type ContentKeyPolicyFairPlayOfflineRentalConfiguration = original.ContentKeyPolicyFairPlayOfflineRentalConfiguration type ContentKeyPolicyOpenRestriction = original.ContentKeyPolicyOpenRestriction type ContentKeyPolicyOption = original.ContentKeyPolicyOption type ContentKeyPolicyPlayReadyConfiguration = original.ContentKeyPolicyPlayReadyConfiguration diff --git a/profiles/preview/netapp/mgmt/netapp/models.go b/profiles/preview/netapp/mgmt/netapp/models.go index a9cacdcde537..59d9ee90a8d5 100644 --- a/profiles/preview/netapp/mgmt/netapp/models.go +++ b/profiles/preview/netapp/mgmt/netapp/models.go @@ -19,7 +19,7 @@ package netapp -import original "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-08-01/netapp" +import original "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-10-01/netapp" const ( DefaultBaseURI = original.DefaultBaseURI @@ -34,6 +34,13 @@ const ( MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckNameResourceTypes = original.MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ) +type EndpointType = original.EndpointType + +const ( + Dst EndpointType = original.Dst + Src EndpointType = original.Src +) + type InAvailabilityReasonType = original.InAvailabilityReasonType const ( @@ -41,6 +48,31 @@ const ( Invalid InAvailabilityReasonType = original.Invalid ) +type MirrorState = original.MirrorState + +const ( + Broken MirrorState = original.Broken + Mirrored MirrorState = original.Mirrored + Uninitialized MirrorState = original.Uninitialized +) + +type RelationshipStatus = original.RelationshipStatus + +const ( + Idle RelationshipStatus = original.Idle + Transferring RelationshipStatus = original.Transferring +) + +type ReplicationSchedule = original.ReplicationSchedule + +const ( + OneZerominutely ReplicationSchedule = original.OneZerominutely + Daily ReplicationSchedule = original.Daily + Hourly ReplicationSchedule = original.Hourly + Monthly ReplicationSchedule = original.Monthly + Weekly ReplicationSchedule = original.Weekly +) + type ServiceLevel = original.ServiceLevel const ( @@ -57,6 +89,7 @@ type AccountsClient = original.AccountsClient type AccountsCreateOrUpdateFuture = original.AccountsCreateOrUpdateFuture type AccountsDeleteFuture = original.AccountsDeleteFuture type ActiveDirectory = original.ActiveDirectory +type AuthorizeRequest = original.AuthorizeRequest type BaseClient = original.BaseClient type CapacityPool = original.CapacityPool type CapacityPoolList = original.CapacityPoolList @@ -79,6 +112,7 @@ type PoolsClient = original.PoolsClient type PoolsCreateOrUpdateFuture = original.PoolsCreateOrUpdateFuture type PoolsDeleteFuture = original.PoolsDeleteFuture type ReplicationObject = original.ReplicationObject +type ReplicationStatus = original.ReplicationStatus type ResourceClient = original.ResourceClient type ResourceNameAvailability = original.ResourceNameAvailability type ResourceNameAvailabilityRequest = original.ResourceNameAvailabilityRequest @@ -153,9 +187,21 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { return original.PossibleCheckNameResourceTypesValues() } +func PossibleEndpointTypeValues() []EndpointType { + return original.PossibleEndpointTypeValues() +} func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { return original.PossibleInAvailabilityReasonTypeValues() } +func PossibleMirrorStateValues() []MirrorState { + return original.PossibleMirrorStateValues() +} +func PossibleRelationshipStatusValues() []RelationshipStatus { + return original.PossibleRelationshipStatusValues() +} +func PossibleReplicationScheduleValues() []ReplicationSchedule { + return original.PossibleReplicationScheduleValues() +} func PossibleServiceLevelValues() []ServiceLevel { return original.PossibleServiceLevelValues() } diff --git a/profiles/preview/netapp/mgmt/netapp/netappapi/models.go b/profiles/preview/netapp/mgmt/netapp/netappapi/models.go index 4d8be867cf43..058cbc7760aa 100644 --- a/profiles/preview/netapp/mgmt/netapp/netappapi/models.go +++ b/profiles/preview/netapp/mgmt/netapp/netappapi/models.go @@ -19,7 +19,7 @@ package netappapi -import original "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-08-01/netapp/netappapi" +import original "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-10-01/netapp/netappapi" type AccountsClientAPI = original.AccountsClientAPI type MountTargetsClientAPI = original.MountTargetsClientAPI diff --git a/profiles/preview/preview/blueprint/mgmt/blueprint/models.go b/profiles/preview/preview/blueprint/mgmt/blueprint/models.go index b408244a9bdd..a90e21d1b063 100644 --- a/profiles/preview/preview/blueprint/mgmt/blueprint/models.go +++ b/profiles/preview/preview/blueprint/mgmt/blueprint/models.go @@ -126,7 +126,6 @@ type Model = original.Model type ParameterDefinition = original.ParameterDefinition type ParameterDefinitionMetadata = original.ParameterDefinitionMetadata type ParameterValue = original.ParameterValue -type ParameterValueBase = original.ParameterValueBase type PolicyAssignmentArtifact = original.PolicyAssignmentArtifact type PolicyAssignmentArtifactProperties = original.PolicyAssignmentArtifactProperties type Properties = original.Properties @@ -146,7 +145,6 @@ type ResourceProviderOperationList = original.ResourceProviderOperationList type ResourceStatusBase = original.ResourceStatusBase type RoleAssignmentArtifact = original.RoleAssignmentArtifact type RoleAssignmentArtifactProperties = original.RoleAssignmentArtifactProperties -type SecretReferenceParameterValue = original.SecretReferenceParameterValue type SecretValueReference = original.SecretValueReference type SharedBlueprintProperties = original.SharedBlueprintProperties type Status = original.Status diff --git a/profiles/preview/preview/cognitiveservices/anomalydetector/models.go b/profiles/preview/preview/cognitiveservices/anomalydetector/models.go index 5eb8fb76e4e3..6d3e0c8355e2 100644 --- a/profiles/preview/preview/cognitiveservices/anomalydetector/models.go +++ b/profiles/preview/preview/cognitiveservices/anomalydetector/models.go @@ -34,6 +34,8 @@ const ( type APIError = original.APIError type BaseClient = original.BaseClient +type ChangePointDetectRequest = original.ChangePointDetectRequest +type ChangePointDetectResponse = original.ChangePointDetectResponse type EntireDetectResponse = original.EntireDetectResponse type LastDetectResponse = original.LastDetectResponse type Point = original.Point diff --git a/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go b/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go index 7e8d7e40812e..aca28c8a0555 100644 --- a/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go +++ b/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go @@ -19,11 +19,8 @@ package containerregistryapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry/containerregistryapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi" -type BuildStepsClientAPI = original.BuildStepsClientAPI -type BuildTasksClientAPI = original.BuildTasksClientAPI -type BuildsClientAPI = original.BuildsClientAPI type OperationsClientAPI = original.OperationsClientAPI type RegistriesClientAPI = original.RegistriesClientAPI type ReplicationsClientAPI = original.ReplicationsClientAPI diff --git a/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go b/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go index e3a0d14f2a62..fc0565aa8f32 100644 --- a/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go +++ b/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go @@ -22,7 +22,7 @@ package containerregistry import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2018-02-01/containerregistry" + original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry" ) const ( @@ -35,48 +35,6 @@ const ( Allow Action = original.Allow ) -type BaseImageDependencyType = original.BaseImageDependencyType - -const ( - BuildTime BaseImageDependencyType = original.BuildTime - RunTime BaseImageDependencyType = original.RunTime -) - -type BaseImageTriggerType = original.BaseImageTriggerType - -const ( - All BaseImageTriggerType = original.All - None BaseImageTriggerType = original.None - Runtime BaseImageTriggerType = original.Runtime -) - -type BuildStatus = original.BuildStatus - -const ( - Canceled BuildStatus = original.Canceled - Error BuildStatus = original.Error - Failed BuildStatus = original.Failed - Queued BuildStatus = original.Queued - Running BuildStatus = original.Running - Started BuildStatus = original.Started - Succeeded BuildStatus = original.Succeeded - Timeout BuildStatus = original.Timeout -) - -type BuildTaskStatus = original.BuildTaskStatus - -const ( - Disabled BuildTaskStatus = original.Disabled - Enabled BuildTaskStatus = original.Enabled -) - -type BuildType = original.BuildType - -const ( - AutoBuild BuildType = original.AutoBuild - QuickBuild BuildType = original.QuickBuild -) - type DefaultAction = original.DefaultAction const ( @@ -84,18 +42,18 @@ const ( DefaultActionDeny DefaultAction = original.DefaultActionDeny ) -type ImportMode = original.ImportMode +type EncryptionStatus = original.EncryptionStatus const ( - Force ImportMode = original.Force - NoForce ImportMode = original.NoForce + Disabled EncryptionStatus = original.Disabled + Enabled EncryptionStatus = original.Enabled ) -type OsType = original.OsType +type ImportMode = original.ImportMode const ( - Linux OsType = original.Linux - Windows OsType = original.Windows + Force ImportMode = original.Force + NoForce ImportMode = original.NoForce ) type PasswordName = original.PasswordName @@ -115,12 +73,12 @@ const ( type ProvisioningState = original.ProvisioningState const ( - ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled - ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating - ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting - ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed - ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded - ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating + Canceled ProvisioningState = original.Canceled + Creating ProvisioningState = original.Creating + Deleting ProvisioningState = original.Deleting + Failed ProvisioningState = original.Failed + Succeeded ProvisioningState = original.Succeeded + Updating ProvisioningState = original.Updating ) type RegistryUsageUnit = original.RegistryUsageUnit @@ -130,6 +88,15 @@ const ( Count RegistryUsageUnit = original.Count ) +type ResourceIdentityType = original.ResourceIdentityType + +const ( + None ResourceIdentityType = original.None + SystemAssigned ResourceIdentityType = original.SystemAssigned + SystemAssignedUserAssigned ResourceIdentityType = original.SystemAssignedUserAssigned + UserAssigned ResourceIdentityType = original.UserAssigned +) + type SkuName = original.SkuName const ( @@ -148,48 +115,12 @@ const ( SkuTierStandard SkuTier = original.SkuTierStandard ) -type SourceControlType = original.SourceControlType - -const ( - Github SourceControlType = original.Github - VisualStudioTeamService SourceControlType = original.VisualStudioTeamService -) - -type TokenType = original.TokenType - -const ( - OAuth TokenType = original.OAuth - PAT TokenType = original.PAT -) - type TrustPolicyType = original.TrustPolicyType const ( Notary TrustPolicyType = original.Notary ) -type Type = original.Type - -const ( - TypeBuildStepProperties Type = original.TypeBuildStepProperties - TypeDocker Type = original.TypeDocker -) - -type TypeBasicBuildStepPropertiesUpdateParameters = original.TypeBasicBuildStepPropertiesUpdateParameters - -const ( - TypeBasicBuildStepPropertiesUpdateParametersTypeBuildStepPropertiesUpdateParameters TypeBasicBuildStepPropertiesUpdateParameters = original.TypeBasicBuildStepPropertiesUpdateParametersTypeBuildStepPropertiesUpdateParameters - TypeBasicBuildStepPropertiesUpdateParametersTypeDocker TypeBasicBuildStepPropertiesUpdateParameters = original.TypeBasicBuildStepPropertiesUpdateParametersTypeDocker -) - -type TypeBasicQueueBuildRequest = original.TypeBasicQueueBuildRequest - -const ( - TypeBuildTask TypeBasicQueueBuildRequest = original.TypeBuildTask - TypeQueueBuildRequest TypeBasicQueueBuildRequest = original.TypeQueueBuildRequest - TypeQuickBuild TypeBasicQueueBuildRequest = original.TypeQuickBuild -) - type WebhookAction = original.WebhookAction const ( @@ -209,52 +140,8 @@ const ( type Actor = original.Actor type BaseClient = original.BaseClient -type BaseImageDependency = original.BaseImageDependency -type BasicBuildStepProperties = original.BasicBuildStepProperties -type BasicBuildStepPropertiesUpdateParameters = original.BasicBuildStepPropertiesUpdateParameters -type BasicQueueBuildRequest = original.BasicQueueBuildRequest -type Build = original.Build -type BuildArgument = original.BuildArgument -type BuildArgumentList = original.BuildArgumentList -type BuildArgumentListIterator = original.BuildArgumentListIterator -type BuildArgumentListPage = original.BuildArgumentListPage -type BuildFilter = original.BuildFilter -type BuildGetLogResult = original.BuildGetLogResult -type BuildListResult = original.BuildListResult -type BuildListResultIterator = original.BuildListResultIterator -type BuildListResultPage = original.BuildListResultPage -type BuildProperties = original.BuildProperties -type BuildStep = original.BuildStep -type BuildStepList = original.BuildStepList -type BuildStepListIterator = original.BuildStepListIterator -type BuildStepListPage = original.BuildStepListPage -type BuildStepProperties = original.BuildStepProperties -type BuildStepPropertiesUpdateParameters = original.BuildStepPropertiesUpdateParameters -type BuildStepUpdateParameters = original.BuildStepUpdateParameters -type BuildStepsClient = original.BuildStepsClient -type BuildStepsCreateFuture = original.BuildStepsCreateFuture -type BuildStepsDeleteFuture = original.BuildStepsDeleteFuture -type BuildStepsUpdateFuture = original.BuildStepsUpdateFuture -type BuildTask = original.BuildTask -type BuildTaskBuildRequest = original.BuildTaskBuildRequest -type BuildTaskFilter = original.BuildTaskFilter -type BuildTaskListResult = original.BuildTaskListResult -type BuildTaskListResultIterator = original.BuildTaskListResultIterator -type BuildTaskListResultPage = original.BuildTaskListResultPage -type BuildTaskProperties = original.BuildTaskProperties -type BuildTaskPropertiesUpdateParameters = original.BuildTaskPropertiesUpdateParameters -type BuildTaskUpdateParameters = original.BuildTaskUpdateParameters -type BuildTasksClient = original.BuildTasksClient -type BuildTasksCreateFuture = original.BuildTasksCreateFuture -type BuildTasksDeleteFuture = original.BuildTasksDeleteFuture -type BuildTasksUpdateFuture = original.BuildTasksUpdateFuture -type BuildUpdateParameters = original.BuildUpdateParameters -type BuildsCancelFuture = original.BuildsCancelFuture -type BuildsClient = original.BuildsClient -type BuildsUpdateFuture = original.BuildsUpdateFuture type CallbackConfig = original.CallbackConfig -type DockerBuildStep = original.DockerBuildStep -type DockerBuildStepUpdateParameters = original.DockerBuildStepUpdateParameters +type EncryptionProperty = original.EncryptionProperty type Event = original.Event type EventContent = original.EventContent type EventInfo = original.EventInfo @@ -263,13 +150,12 @@ type EventListResultIterator = original.EventListResultIterator type EventListResultPage = original.EventListResultPage type EventRequestMessage = original.EventRequestMessage type EventResponseMessage = original.EventResponseMessage -type GitCommitTrigger = original.GitCommitTrigger type IPRule = original.IPRule -type ImageDescriptor = original.ImageDescriptor -type ImageUpdateTrigger = original.ImageUpdateTrigger +type IdentityProperties = original.IdentityProperties type ImportImageParameters = original.ImportImageParameters type ImportSource = original.ImportSource type ImportSourceCredentials = original.ImportSourceCredentials +type KeyVaultProperties = original.KeyVaultProperties type NetworkRuleSet = original.NetworkRuleSet type OperationDefinition = original.OperationDefinition type OperationDisplayDefinition = original.OperationDisplayDefinition @@ -280,19 +166,14 @@ type OperationMetricSpecificationDefinition = original.OperationMetricSpecificat type OperationPropertiesDefinition = original.OperationPropertiesDefinition type OperationServiceSpecificationDefinition = original.OperationServiceSpecificationDefinition type OperationsClient = original.OperationsClient -type PlatformProperties = original.PlatformProperties -type ProxyResource = original.ProxyResource +type Policies = original.Policies type QuarantinePolicy = original.QuarantinePolicy -type QueueBuildRequest = original.QueueBuildRequest -type QuickBuildRequest = original.QuickBuildRequest type RegenerateCredentialParameters = original.RegenerateCredentialParameters type RegistriesClient = original.RegistriesClient type RegistriesCreateFuture = original.RegistriesCreateFuture type RegistriesDeleteFuture = original.RegistriesDeleteFuture type RegistriesImportImageFuture = original.RegistriesImportImageFuture -type RegistriesQueueBuildFuture = original.RegistriesQueueBuildFuture type RegistriesUpdateFuture = original.RegistriesUpdateFuture -type RegistriesUpdatePoliciesFuture = original.RegistriesUpdatePoliciesFuture type Registry = original.Registry type RegistryListCredentialsResult = original.RegistryListCredentialsResult type RegistryListResult = original.RegistryListResult @@ -301,7 +182,6 @@ type RegistryListResultPage = original.RegistryListResultPage type RegistryNameCheckRequest = original.RegistryNameCheckRequest type RegistryNameStatus = original.RegistryNameStatus type RegistryPassword = original.RegistryPassword -type RegistryPolicies = original.RegistryPolicies type RegistryProperties = original.RegistryProperties type RegistryPropertiesUpdateParameters = original.RegistryPropertiesUpdateParameters type RegistryUpdateParameters = original.RegistryUpdateParameters @@ -319,16 +199,14 @@ type ReplicationsDeleteFuture = original.ReplicationsDeleteFuture type ReplicationsUpdateFuture = original.ReplicationsUpdateFuture type Request = original.Request type Resource = original.Resource +type RetentionPolicy = original.RetentionPolicy type Sku = original.Sku type Source = original.Source -type SourceControlAuthInfo = original.SourceControlAuthInfo -type SourceRepositoryProperties = original.SourceRepositoryProperties -type SourceRepositoryUpdateParameters = original.SourceRepositoryUpdateParameters -type SourceUploadDefinition = original.SourceUploadDefinition type Status = original.Status type StorageAccountProperties = original.StorageAccountProperties type Target = original.Target type TrustPolicy = original.TrustPolicy +type UserIdentityProperties = original.UserIdentityProperties type VirtualNetworkRule = original.VirtualNetworkRule type Webhook = original.Webhook type WebhookCreateParameters = original.WebhookCreateParameters @@ -347,48 +225,6 @@ type WebhooksUpdateFuture = original.WebhooksUpdateFuture func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewBuildArgumentListIterator(page BuildArgumentListPage) BuildArgumentListIterator { - return original.NewBuildArgumentListIterator(page) -} -func NewBuildArgumentListPage(getNextPage func(context.Context, BuildArgumentList) (BuildArgumentList, error)) BuildArgumentListPage { - return original.NewBuildArgumentListPage(getNextPage) -} -func NewBuildListResultIterator(page BuildListResultPage) BuildListResultIterator { - return original.NewBuildListResultIterator(page) -} -func NewBuildListResultPage(getNextPage func(context.Context, BuildListResult) (BuildListResult, error)) BuildListResultPage { - return original.NewBuildListResultPage(getNextPage) -} -func NewBuildStepListIterator(page BuildStepListPage) BuildStepListIterator { - return original.NewBuildStepListIterator(page) -} -func NewBuildStepListPage(getNextPage func(context.Context, BuildStepList) (BuildStepList, error)) BuildStepListPage { - return original.NewBuildStepListPage(getNextPage) -} -func NewBuildStepsClient(subscriptionID string) BuildStepsClient { - return original.NewBuildStepsClient(subscriptionID) -} -func NewBuildStepsClientWithBaseURI(baseURI string, subscriptionID string) BuildStepsClient { - return original.NewBuildStepsClientWithBaseURI(baseURI, subscriptionID) -} -func NewBuildTaskListResultIterator(page BuildTaskListResultPage) BuildTaskListResultIterator { - return original.NewBuildTaskListResultIterator(page) -} -func NewBuildTaskListResultPage(getNextPage func(context.Context, BuildTaskListResult) (BuildTaskListResult, error)) BuildTaskListResultPage { - return original.NewBuildTaskListResultPage(getNextPage) -} -func NewBuildTasksClient(subscriptionID string) BuildTasksClient { - return original.NewBuildTasksClient(subscriptionID) -} -func NewBuildTasksClientWithBaseURI(baseURI string, subscriptionID string) BuildTasksClient { - return original.NewBuildTasksClientWithBaseURI(baseURI, subscriptionID) -} -func NewBuildsClient(subscriptionID string) BuildsClient { - return original.NewBuildsClient(subscriptionID) -} -func NewBuildsClientWithBaseURI(baseURI string, subscriptionID string) BuildsClient { - return original.NewBuildsClientWithBaseURI(baseURI, subscriptionID) -} func NewEventListResultIterator(page EventListResultPage) EventListResultIterator { return original.NewEventListResultIterator(page) } @@ -449,30 +285,15 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleActionValues() []Action { return original.PossibleActionValues() } -func PossibleBaseImageDependencyTypeValues() []BaseImageDependencyType { - return original.PossibleBaseImageDependencyTypeValues() -} -func PossibleBaseImageTriggerTypeValues() []BaseImageTriggerType { - return original.PossibleBaseImageTriggerTypeValues() -} -func PossibleBuildStatusValues() []BuildStatus { - return original.PossibleBuildStatusValues() -} -func PossibleBuildTaskStatusValues() []BuildTaskStatus { - return original.PossibleBuildTaskStatusValues() -} -func PossibleBuildTypeValues() []BuildType { - return original.PossibleBuildTypeValues() -} func PossibleDefaultActionValues() []DefaultAction { return original.PossibleDefaultActionValues() } +func PossibleEncryptionStatusValues() []EncryptionStatus { + return original.PossibleEncryptionStatusValues() +} func PossibleImportModeValues() []ImportMode { return original.PossibleImportModeValues() } -func PossibleOsTypeValues() []OsType { - return original.PossibleOsTypeValues() -} func PossiblePasswordNameValues() []PasswordName { return original.PossiblePasswordNameValues() } @@ -485,30 +306,18 @@ func PossibleProvisioningStateValues() []ProvisioningState { func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { return original.PossibleRegistryUsageUnitValues() } +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return original.PossibleResourceIdentityTypeValues() +} func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } func PossibleSkuTierValues() []SkuTier { return original.PossibleSkuTierValues() } -func PossibleSourceControlTypeValues() []SourceControlType { - return original.PossibleSourceControlTypeValues() -} -func PossibleTokenTypeValues() []TokenType { - return original.PossibleTokenTypeValues() -} func PossibleTrustPolicyTypeValues() []TrustPolicyType { return original.PossibleTrustPolicyTypeValues() } -func PossibleTypeBasicBuildStepPropertiesUpdateParametersValues() []TypeBasicBuildStepPropertiesUpdateParameters { - return original.PossibleTypeBasicBuildStepPropertiesUpdateParametersValues() -} -func PossibleTypeBasicQueueBuildRequestValues() []TypeBasicQueueBuildRequest { - return original.PossibleTypeBasicQueueBuildRequestValues() -} -func PossibleTypeValues() []Type { - return original.PossibleTypeValues() -} func PossibleWebhookActionValues() []WebhookAction { return original.PossibleWebhookActionValues() } diff --git a/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go b/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go index 88db56d34baf..aed1e9714cb3 100644 --- a/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go +++ b/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go @@ -123,6 +123,7 @@ type BillingMeters = original.BillingMeters type BillingResources = original.BillingResources type BillingResponseListResult = original.BillingResponseListResult type CapabilitiesResult = original.CapabilitiesResult +type ClientGroupInfo = original.ClientGroupInfo type Cluster = original.Cluster type ClusterConfigurations = original.ClusterConfigurations type ClusterCreateParametersExtended = original.ClusterCreateParametersExtended @@ -166,6 +167,7 @@ type ExtensionsDisableMonitoringFuture = original.ExtensionsDisableMonitoringFut type ExtensionsEnableMonitoringFuture = original.ExtensionsEnableMonitoringFuture type GatewaySettings = original.GatewaySettings type HardwareProfile = original.HardwareProfile +type KafkaRestProperties = original.KafkaRestProperties type LinuxOperatingSystemProfile = original.LinuxOperatingSystemProfile type LocalizedName = original.LocalizedName type LocationsClient = original.LocationsClient diff --git a/profiles/preview/preview/personalizer/personalizer/models.go b/profiles/preview/preview/personalizer/personalizer/models.go index 978203a5b0fb..d02f4c2ae9cd 100644 --- a/profiles/preview/preview/personalizer/personalizer/models.go +++ b/profiles/preview/preview/personalizer/personalizer/models.go @@ -24,34 +24,95 @@ import original "github.com/Azure/azure-sdk-for-go/services/preview/personalizer type ErrorCode = original.ErrorCode const ( - BadRequest ErrorCode = original.BadRequest - InternalServerError ErrorCode = original.InternalServerError - ResourceNotFound ErrorCode = original.ResourceNotFound + BadRequest ErrorCode = original.BadRequest + EvaluationNotFound ErrorCode = original.EvaluationNotFound + FrontEndNotFound ErrorCode = original.FrontEndNotFound + InternalServerError ErrorCode = original.InternalServerError + InvalidContainer ErrorCode = original.InvalidContainer + InvalidEvaluationContract ErrorCode = original.InvalidEvaluationContract + InvalidEventIDToActivate ErrorCode = original.InvalidEventIDToActivate + InvalidExportLogsRequest ErrorCode = original.InvalidExportLogsRequest + InvalidPolicyConfiguration ErrorCode = original.InvalidPolicyConfiguration + InvalidPolicyContract ErrorCode = original.InvalidPolicyContract + InvalidRankRequest ErrorCode = original.InvalidRankRequest + InvalidRewardRequest ErrorCode = original.InvalidRewardRequest + InvalidServiceConfiguration ErrorCode = original.InvalidServiceConfiguration + LogsPropertiesNotFound ErrorCode = original.LogsPropertiesNotFound + ModelResetFailed ErrorCode = original.ModelResetFailed + RankNullResponse ErrorCode = original.RankNullResponse + ResourceNotFound ErrorCode = original.ResourceNotFound + UpdateConfigurationFailed ErrorCode = original.UpdateConfigurationFailed +) + +type EvaluationJobStatus = original.EvaluationJobStatus + +const ( + Completed EvaluationJobStatus = original.Completed + Failed EvaluationJobStatus = original.Failed + NotSubmitted EvaluationJobStatus = original.NotSubmitted + Pending EvaluationJobStatus = original.Pending ) type BaseClient = original.BaseClient +type ContainerStatus = original.ContainerStatus +type DateRange = original.DateRange type Error = original.Error type ErrorResponse = original.ErrorResponse +type Evaluation = original.Evaluation +type EvaluationContract = original.EvaluationContract +type EvaluationsClient = original.EvaluationsClient type EventsClient = original.EventsClient type InternalError = original.InternalError +type ListEvaluation = original.ListEvaluation +type LogClient = original.LogClient +type LogsProperties = original.LogsProperties +type LogsPropertiesDateRange = original.LogsPropertiesDateRange +type ModelClient = original.ModelClient +type ModelProperties = original.ModelProperties +type PolicyClient = original.PolicyClient +type PolicyContract = original.PolicyContract +type PolicyResult = original.PolicyResult +type PolicyResultSummary = original.PolicyResultSummary +type PolicyResultTotalSummary = original.PolicyResultTotalSummary type RankRequest = original.RankRequest type RankResponse = original.RankResponse type RankableAction = original.RankableAction type RankedAction = original.RankedAction +type ReadCloser = original.ReadCloser type RewardRequest = original.RewardRequest +type ServiceConfiguration = original.ServiceConfiguration +type ServiceConfigurationClient = original.ServiceConfigurationClient func New(endpoint string) BaseClient { return original.New(endpoint) } +func NewEvaluationsClient(endpoint string) EvaluationsClient { + return original.NewEvaluationsClient(endpoint) +} func NewEventsClient(endpoint string) EventsClient { return original.NewEventsClient(endpoint) } +func NewLogClient(endpoint string) LogClient { + return original.NewLogClient(endpoint) +} +func NewModelClient(endpoint string) ModelClient { + return original.NewModelClient(endpoint) +} +func NewPolicyClient(endpoint string) PolicyClient { + return original.NewPolicyClient(endpoint) +} +func NewServiceConfigurationClient(endpoint string) ServiceConfigurationClient { + return original.NewServiceConfigurationClient(endpoint) +} func NewWithoutDefaults(endpoint string) BaseClient { return original.NewWithoutDefaults(endpoint) } func PossibleErrorCodeValues() []ErrorCode { return original.PossibleErrorCodeValues() } +func PossibleEvaluationJobStatusValues() []EvaluationJobStatus { + return original.PossibleEvaluationJobStatusValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/preview/personalizer/personalizer/personalizerapi/models.go b/profiles/preview/preview/personalizer/personalizer/personalizerapi/models.go index 3d683cdbc206..2ecebd9977a4 100644 --- a/profiles/preview/preview/personalizer/personalizer/personalizerapi/models.go +++ b/profiles/preview/preview/personalizer/personalizer/personalizerapi/models.go @@ -22,4 +22,9 @@ package personalizerapi import original "github.com/Azure/azure-sdk-for-go/services/preview/personalizer/v1.0/personalizer/personalizerapi" type BaseClientAPI = original.BaseClientAPI +type EvaluationsClientAPI = original.EvaluationsClientAPI type EventsClientAPI = original.EventsClientAPI +type LogClientAPI = original.LogClientAPI +type ModelClientAPI = original.ModelClientAPI +type PolicyClientAPI = original.PolicyClientAPI +type ServiceConfigurationClientAPI = original.ServiceConfigurationClientAPI diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go index f8eccc38ad1f..25b06ebd6436 100644 --- a/profiles/preview/preview/security/mgmt/security/models.go +++ b/profiles/preview/preview/security/mgmt/security/models.go @@ -45,6 +45,15 @@ const ( Remove Action = original.Remove ) +type ActionType = original.ActionType + +const ( + ActionTypeAutomationAction ActionType = original.ActionTypeAutomationAction + ActionTypeEventHub ActionType = original.ActionTypeEventHub + ActionTypeLogicApp ActionType = original.ActionTypeLogicApp + ActionTypeWorkspace ActionType = original.ActionTypeWorkspace +) + type AlertNotifications = original.AlertNotifications const ( @@ -68,6 +77,14 @@ const ( AssessedResourceTypeSQLServerVulnerability AssessedResourceType = original.AssessedResourceTypeSQLServerVulnerability ) +type AssessmentType = original.AssessmentType + +const ( + BuiltIn AssessmentType = original.BuiltIn + CustomerManaged AssessmentType = original.CustomerManaged + CustomPolicy AssessmentType = original.CustomPolicy +) + type AutoProvision = original.AutoProvision const ( @@ -75,6 +92,16 @@ const ( AutoProvisionOn AutoProvision = original.AutoProvisionOn ) +type Category = original.Category + +const ( + Compute Category = original.Compute + Data Category = original.Data + IdentityAndAccess Category = original.IdentityAndAccess + IoT Category = original.IoT + Networking Category = original.Networking +) + type ConfigurationStatus = original.ConfigurationStatus const ( @@ -134,6 +161,13 @@ const ( EnforcementMode1None EnforcementMode1 = original.EnforcementMode1None ) +type EventSource = original.EventSource + +const ( + Alerts EventSource = original.Alerts + Assessments EventSource = original.Assessments +) + type Exe = original.Exe const ( @@ -184,6 +218,14 @@ const ( FileTypeUnknown FileType = original.FileTypeUnknown ) +type ImplementationEffort = original.ImplementationEffort + +const ( + High ImplementationEffort = original.High + Low ImplementationEffort = original.Low + Moderate ImplementationEffort = original.Moderate +) + type Issue = original.Issue const ( @@ -212,6 +254,20 @@ const ( MsiNone Msi = original.MsiNone ) +type Operator = original.Operator + +const ( + Contains Operator = original.Contains + EndsWith Operator = original.EndsWith + Equals Operator = original.Equals + GreaterThan Operator = original.GreaterThan + GreaterThanOrEqualTo Operator = original.GreaterThanOrEqualTo + LesserThan Operator = original.LesserThan + LesserThanOrEqualTo Operator = original.LesserThanOrEqualTo + NotEquals Operator = original.NotEquals + StartsWith Operator = original.StartsWith +) + type PricingTier = original.PricingTier const ( @@ -219,6 +275,15 @@ const ( Standard PricingTier = original.Standard ) +type PropertyType = original.PropertyType + +const ( + Boolean PropertyType = original.Boolean + Integer PropertyType = original.Integer + Number PropertyType = original.Number + String PropertyType = original.String +) + type Protocol = original.Protocol const ( @@ -293,10 +358,10 @@ const ( type ReportedSeverity = original.ReportedSeverity const ( - High ReportedSeverity = original.High - Informational ReportedSeverity = original.Informational - Low ReportedSeverity = original.Low - Medium ReportedSeverity = original.Medium + ReportedSeverityHigh ReportedSeverity = original.ReportedSeverityHigh + ReportedSeverityInformational ReportedSeverity = original.ReportedSeverityInformational + ReportedSeverityLow ReportedSeverity = original.ReportedSeverityLow + ReportedSeverityMedium ReportedSeverity = original.ReportedSeverityMedium ) type ResourceStatus = original.ResourceStatus @@ -388,6 +453,19 @@ const ( SubAssessmentStatusCodeUnhealthy SubAssessmentStatusCode = original.SubAssessmentStatusCodeUnhealthy ) +type Threats = original.Threats + +const ( + AccountBreach Threats = original.AccountBreach + DataExfiltration Threats = original.DataExfiltration + DataSpillage Threats = original.DataSpillage + DenialOfService Threats = original.DenialOfService + ElevationOfPrivilege Threats = original.ElevationOfPrivilege + MaliciousInsider Threats = original.MaliciousInsider + MissingCoverage Threats = original.MissingCoverage + ThreatResistance Threats = original.ThreatResistance +) + type Type = original.Type const ( @@ -406,11 +484,19 @@ const ( UnmaskedIPLoggingStatusEnabled UnmaskedIPLoggingStatus = original.UnmaskedIPLoggingStatusEnabled ) +type UserImpact = original.UserImpact + +const ( + UserImpactHigh UserImpact = original.UserImpactHigh + UserImpactLow UserImpact = original.UserImpactLow + UserImpactModerate UserImpact = original.UserImpactModerate +) + type ValueType = original.ValueType const ( - IPCidr ValueType = original.IPCidr - String ValueType = original.String + ValueTypeIPCidr ValueType = original.ValueTypeIPCidr + ValueTypeString ValueType = original.ValueTypeString ) type AadConnectivityState1 = original.AadConnectivityState1 @@ -445,6 +531,13 @@ type AscLocation = original.AscLocation type AscLocationList = original.AscLocationList type AscLocationListIterator = original.AscLocationListIterator type AscLocationListPage = original.AscLocationListPage +type AssessmentMetadata = original.AssessmentMetadata +type AssessmentMetadataList = original.AssessmentMetadataList +type AssessmentMetadataListIterator = original.AssessmentMetadataListIterator +type AssessmentMetadataListPage = original.AssessmentMetadataListPage +type AssessmentMetadataProperties = original.AssessmentMetadataProperties +type AssessmentsMetadataClient = original.AssessmentsMetadataClient +type AssessmentsMetadataSubscriptionClient = original.AssessmentsMetadataSubscriptionClient type AtaExternalSecuritySolution = original.AtaExternalSecuritySolution type AtaSolutionProperties = original.AtaSolutionProperties type AutoProvisioningSetting = original.AutoProvisioningSetting @@ -453,10 +546,26 @@ type AutoProvisioningSettingListIterator = original.AutoProvisioningSettingListI type AutoProvisioningSettingListPage = original.AutoProvisioningSettingListPage type AutoProvisioningSettingProperties = original.AutoProvisioningSettingProperties type AutoProvisioningSettingsClient = original.AutoProvisioningSettingsClient +type Automation = original.Automation +type AutomationAction = original.AutomationAction +type AutomationActionEventHub = original.AutomationActionEventHub +type AutomationActionLogicApp = original.AutomationActionLogicApp +type AutomationActionWorkspace = original.AutomationActionWorkspace +type AutomationList = original.AutomationList +type AutomationListIterator = original.AutomationListIterator +type AutomationListPage = original.AutomationListPage +type AutomationProperties = original.AutomationProperties +type AutomationRuleSet = original.AutomationRuleSet +type AutomationScope = original.AutomationScope +type AutomationSource = original.AutomationSource +type AutomationTriggeringRule = original.AutomationTriggeringRule +type AutomationValidationStatus = original.AutomationValidationStatus +type AutomationsClient = original.AutomationsClient type AwsResourceDetails = original.AwsResourceDetails type AzureResourceDetails = original.AzureResourceDetails type BaseClient = original.BaseClient type BasicAdditionalData = original.BasicAdditionalData +type BasicAutomationAction = original.BasicAutomationAction type BasicExternalSecuritySolution = original.BasicExternalSecuritySolution type BasicResourceDetails = original.BasicResourceDetails type CVE = original.CVE @@ -700,6 +809,24 @@ func NewAscLocationListIterator(page AscLocationListPage) AscLocationListIterato func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) (AscLocationList, error)) AscLocationListPage { return original.NewAscLocationListPage(getNextPage) } +func NewAssessmentMetadataListIterator(page AssessmentMetadataListPage) AssessmentMetadataListIterator { + return original.NewAssessmentMetadataListIterator(page) +} +func NewAssessmentMetadataListPage(getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { + return original.NewAssessmentMetadataListPage(getNextPage) +} +func NewAssessmentsMetadataClient(subscriptionID string, ascLocation string) AssessmentsMetadataClient { + return original.NewAssessmentsMetadataClient(subscriptionID, ascLocation) +} +func NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataClient { + return original.NewAssessmentsMetadataClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} +func NewAssessmentsMetadataSubscriptionClient(subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { + return original.NewAssessmentsMetadataSubscriptionClient(subscriptionID, ascLocation) +} +func NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { + return original.NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} func NewAutoProvisioningSettingListIterator(page AutoProvisioningSettingListPage) AutoProvisioningSettingListIterator { return original.NewAutoProvisioningSettingListIterator(page) } @@ -712,6 +839,18 @@ func NewAutoProvisioningSettingsClient(subscriptionID string, ascLocation string func NewAutoProvisioningSettingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutoProvisioningSettingsClient { return original.NewAutoProvisioningSettingsClientWithBaseURI(baseURI, subscriptionID, ascLocation) } +func NewAutomationListIterator(page AutomationListPage) AutomationListIterator { + return original.NewAutomationListIterator(page) +} +func NewAutomationListPage(getNextPage func(context.Context, AutomationList) (AutomationList, error)) AutomationListPage { + return original.NewAutomationListPage(getNextPage) +} +func NewAutomationsClient(subscriptionID string, ascLocation string) AutomationsClient { + return original.NewAutomationsClient(subscriptionID, ascLocation) +} +func NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutomationsClient { + return original.NewAutomationsClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} func NewComplianceListIterator(page ComplianceListPage) ComplianceListIterator { return original.NewComplianceListIterator(page) } @@ -982,6 +1121,9 @@ func NewWorkspaceSettingsClientWithBaseURI(baseURI string, subscriptionID string func PossibleAadConnectivityStateValues() []AadConnectivityState { return original.PossibleAadConnectivityStateValues() } +func PossibleActionTypeValues() []ActionType { + return original.PossibleActionTypeValues() +} func PossibleActionValues() []Action { return original.PossibleActionValues() } @@ -994,9 +1136,15 @@ func PossibleAlertsToAdminsValues() []AlertsToAdmins { func PossibleAssessedResourceTypeValues() []AssessedResourceType { return original.PossibleAssessedResourceTypeValues() } +func PossibleAssessmentTypeValues() []AssessmentType { + return original.PossibleAssessmentTypeValues() +} func PossibleAutoProvisionValues() []AutoProvision { return original.PossibleAutoProvisionValues() } +func PossibleCategoryValues() []Category { + return original.PossibleCategoryValues() +} func PossibleConfigurationStatus1Values() []ConfigurationStatus1 { return original.PossibleConfigurationStatus1Values() } @@ -1018,6 +1166,9 @@ func PossibleEnforcementMode1Values() []EnforcementMode1 { func PossibleEnforcementModeValues() []EnforcementMode { return original.PossibleEnforcementModeValues() } +func PossibleEventSourceValues() []EventSource { + return original.PossibleEventSourceValues() +} func PossibleExeValues() []Exe { return original.PossibleExeValues() } @@ -1036,6 +1187,9 @@ func PossibleFamilyValues() []Family { func PossibleFileTypeValues() []FileType { return original.PossibleFileTypeValues() } +func PossibleImplementationEffortValues() []ImplementationEffort { + return original.PossibleImplementationEffortValues() +} func PossibleIssueValues() []Issue { return original.PossibleIssueValues() } @@ -1045,9 +1199,15 @@ func PossibleKindEnumValues() []KindEnum { func PossibleMsiValues() []Msi { return original.PossibleMsiValues() } +func PossibleOperatorValues() []Operator { + return original.PossibleOperatorValues() +} func PossiblePricingTierValues() []PricingTier { return original.PossiblePricingTierValues() } +func PossiblePropertyTypeValues() []PropertyType { + return original.PossiblePropertyTypeValues() +} func PossibleProtocolValues() []Protocol { return original.PossibleProtocolValues() } @@ -1105,12 +1265,18 @@ func PossibleStatusValues() []Status { func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { return original.PossibleSubAssessmentStatusCodeValues() } +func PossibleThreatsValues() []Threats { + return original.PossibleThreatsValues() +} func PossibleTypeValues() []Type { return original.PossibleTypeValues() } func PossibleUnmaskedIPLoggingStatusValues() []UnmaskedIPLoggingStatus { return original.PossibleUnmaskedIPLoggingStatusValues() } +func PossibleUserImpactValues() []UserImpact { + return original.PossibleUserImpactValues() +} func PossibleValueTypeValues() []ValueType { return original.PossibleValueTypeValues() } diff --git a/profiles/preview/preview/security/mgmt/security/securityapi/models.go b/profiles/preview/preview/security/mgmt/security/securityapi/models.go index 6291ca8035f2..5ad5aa4f97d0 100644 --- a/profiles/preview/preview/security/mgmt/security/securityapi/models.go +++ b/profiles/preview/preview/security/mgmt/security/securityapi/models.go @@ -25,7 +25,10 @@ type AdaptiveApplicationControlsClientAPI = original.AdaptiveApplicationControls type AdvancedThreatProtectionClientAPI = original.AdvancedThreatProtectionClientAPI type AlertsClientAPI = original.AlertsClientAPI type AllowedConnectionsClientAPI = original.AllowedConnectionsClientAPI +type AssessmentsMetadataClientAPI = original.AssessmentsMetadataClientAPI +type AssessmentsMetadataSubscriptionClientAPI = original.AssessmentsMetadataSubscriptionClientAPI type AutoProvisioningSettingsClientAPI = original.AutoProvisioningSettingsClientAPI +type AutomationsClientAPI = original.AutomationsClientAPI type ComplianceResultsClientAPI = original.ComplianceResultsClientAPI type CompliancesClientAPI = original.CompliancesClientAPI type ContactsClientAPI = original.ContactsClientAPI diff --git a/profiles/preview/preview/servicebus/mgmt/servicebus/models.go b/profiles/preview/preview/servicebus/mgmt/servicebus/models.go index ba5c4c1cf080..ed1967fdac05 100644 --- a/profiles/preview/preview/servicebus/mgmt/servicebus/models.go +++ b/profiles/preview/preview/servicebus/mgmt/servicebus/models.go @@ -43,6 +43,18 @@ const ( Reject IPAction = original.Reject ) +type IdentityType = original.IdentityType + +const ( + SystemAssigned IdentityType = original.SystemAssigned +) + +type KeySource = original.KeySource + +const ( + MicrosoftKeyVault KeySource = original.MicrosoftKeyVault +) + type NetworkRuleIPAction = original.NetworkRuleIPAction const ( @@ -66,12 +78,15 @@ const ( ) type BaseClient = original.BaseClient +type Encryption = original.Encryption type ErrorResponse = original.ErrorResponse type IPFilterRule = original.IPFilterRule type IPFilterRuleListResult = original.IPFilterRuleListResult type IPFilterRuleListResultIterator = original.IPFilterRuleListResultIterator type IPFilterRuleListResultPage = original.IPFilterRuleListResultPage type IPFilterRuleProperties = original.IPFilterRuleProperties +type Identity = original.Identity +type KeyVaultProperties = original.KeyVaultProperties type NWRuleSetIPRules = original.NWRuleSetIPRules type NWRuleSetVirtualNetworkRules = original.NWRuleSetVirtualNetworkRules type NamespacesClient = original.NamespacesClient @@ -150,6 +165,12 @@ func PossibleDefaultActionValues() []DefaultAction { func PossibleIPActionValues() []IPAction { return original.PossibleIPActionValues() } +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleKeySourceValues() []KeySource { + return original.PossibleKeySourceValues() +} func PossibleNetworkRuleIPActionValues() []NetworkRuleIPAction { return original.PossibleNetworkRuleIPActionValues() } diff --git a/profiles/preview/preview/windowsesu/windowsesu/models.go b/profiles/preview/preview/windowsesu/windowsesu/models.go new file mode 100644 index 000000000000..6e6128e5f542 --- /dev/null +++ b/profiles/preview/preview/windowsesu/windowsesu/models.go @@ -0,0 +1,123 @@ +// +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 windowsesu + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/preview/windowsesu/2019-09-16-preview/windowsesu" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type OsType = original.OsType + +const ( + Windows7 OsType = original.Windows7 + WindowsServer2008 OsType = original.WindowsServer2008 + WindowsServer2008R2 OsType = original.WindowsServer2008R2 +) + +type ProvisioningState = original.ProvisioningState + +const ( + Accepted ProvisioningState = original.Accepted + Canceled ProvisioningState = original.Canceled + Failed ProvisioningState = original.Failed + Provisioning ProvisioningState = original.Provisioning + Succeeded ProvisioningState = original.Succeeded +) + +type SupportType = original.SupportType + +const ( + PremiumAssurance SupportType = original.PremiumAssurance + SupplementalServicing SupportType = original.SupplementalServicing +) + +type AzureEntityResource = original.AzureEntityResource +type BaseClient = original.BaseClient +type ErrorDefinition = original.ErrorDefinition +type ErrorResponse = original.ErrorResponse +type MultipleActivationKey = original.MultipleActivationKey +type MultipleActivationKeyList = original.MultipleActivationKeyList +type MultipleActivationKeyListIterator = original.MultipleActivationKeyListIterator +type MultipleActivationKeyListPage = original.MultipleActivationKeyListPage +type MultipleActivationKeyProperties = original.MultipleActivationKeyProperties +type MultipleActivationKeyUpdate = original.MultipleActivationKeyUpdate +type MultipleActivationKeysClient = original.MultipleActivationKeysClient +type MultipleActivationKeysCreateFuture = original.MultipleActivationKeysCreateFuture +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationList = original.OperationList +type OperationListIterator = original.OperationListIterator +type OperationListPage = original.OperationListPage +type OperationsClient = original.OperationsClient +type ProxyResource = original.ProxyResource +type Resource = original.Resource +type TrackedResource = original.TrackedResource + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewMultipleActivationKeyListIterator(page MultipleActivationKeyListPage) MultipleActivationKeyListIterator { + return original.NewMultipleActivationKeyListIterator(page) +} +func NewMultipleActivationKeyListPage(getNextPage func(context.Context, MultipleActivationKeyList) (MultipleActivationKeyList, error)) MultipleActivationKeyListPage { + return original.NewMultipleActivationKeyListPage(getNextPage) +} +func NewMultipleActivationKeysClient(subscriptionID string) MultipleActivationKeysClient { + return original.NewMultipleActivationKeysClient(subscriptionID) +} +func NewMultipleActivationKeysClientWithBaseURI(baseURI string, subscriptionID string) MultipleActivationKeysClient { + return original.NewMultipleActivationKeysClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationListIterator(page OperationListPage) OperationListIterator { + return original.NewOperationListIterator(page) +} +func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { + return original.NewOperationListPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleOsTypeValues() []OsType { + return original.PossibleOsTypeValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleSupportTypeValues() []SupportType { + return original.PossibleSupportTypeValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/preview/windowsesu/windowsesu/windowsesuapi/models.go b/profiles/preview/preview/windowsesu/windowsesu/windowsesuapi/models.go new file mode 100644 index 000000000000..80555b35e6be --- /dev/null +++ b/profiles/preview/preview/windowsesu/windowsesu/windowsesuapi/models.go @@ -0,0 +1,25 @@ +// +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 windowsesuapi + +import original "github.com/Azure/azure-sdk-for-go/services/preview/windowsesu/2019-09-16-preview/windowsesu/windowsesuapi" + +type MultipleActivationKeysClientAPI = original.MultipleActivationKeysClientAPI +type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/resourcehealth/mgmt/resourcehealth/models.go b/profiles/preview/resourcehealth/mgmt/resourcehealth/models.go index f37a7ff78cb2..e7057f631911 100644 --- a/profiles/preview/resourcehealth/mgmt/resourcehealth/models.go +++ b/profiles/preview/resourcehealth/mgmt/resourcehealth/models.go @@ -44,6 +44,22 @@ const ( Transient ReasonChronicityTypes = original.Transient ) +type SeverityValues = original.SeverityValues + +const ( + Error SeverityValues = original.Error + Information SeverityValues = original.Information + Warning SeverityValues = original.Warning +) + +type StageValues = original.StageValues + +const ( + Active StageValues = original.Active + Archived StageValues = original.Archived + Resolve StageValues = original.Resolve +) + type AvailabilityStatus = original.AvailabilityStatus type AvailabilityStatusListResult = original.AvailabilityStatusListResult type AvailabilityStatusListResultIterator = original.AvailabilityStatusListResultIterator @@ -51,18 +67,32 @@ type AvailabilityStatusListResultPage = original.AvailabilityStatusListResultPag type AvailabilityStatusProperties = original.AvailabilityStatusProperties type AvailabilityStatusPropertiesRecentlyResolvedState = original.AvailabilityStatusPropertiesRecentlyResolvedState type AvailabilityStatusesClient = original.AvailabilityStatusesClient +type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient type ChildAvailabilityStatusesClient = original.ChildAvailabilityStatusesClient type ChildResourcesClient = original.ChildResourcesClient +type EmergingIssue = original.EmergingIssue +type EmergingIssueImpact = original.EmergingIssueImpact +type EmergingIssueListResult = original.EmergingIssueListResult +type EmergingIssueListResultIterator = original.EmergingIssueListResultIterator +type EmergingIssueListResultPage = original.EmergingIssueListResultPage +type EmergingIssuesClient = original.EmergingIssuesClient +type EmergingIssuesGetResult = original.EmergingIssuesGetResult type ErrorResponse = original.ErrorResponse +type ImpactedRegion = original.ImpactedRegion type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationsClient = original.OperationsClient +type ProxyResource = original.ProxyResource type RecommendedAction = original.RecommendedAction +type Resource = original.Resource type ServiceImpactingEvent = original.ServiceImpactingEvent type ServiceImpactingEventIncidentProperties = original.ServiceImpactingEventIncidentProperties type ServiceImpactingEventStatus = original.ServiceImpactingEventStatus +type StatusActiveEvent = original.StatusActiveEvent +type StatusBanner = original.StatusBanner +type TrackedResource = original.TrackedResource func New(subscriptionID string) BaseClient { return original.New(subscriptionID) @@ -91,6 +121,18 @@ func NewChildResourcesClient(subscriptionID string) ChildResourcesClient { func NewChildResourcesClientWithBaseURI(baseURI string, subscriptionID string) ChildResourcesClient { return original.NewChildResourcesClientWithBaseURI(baseURI, subscriptionID) } +func NewEmergingIssueListResultIterator(page EmergingIssueListResultPage) EmergingIssueListResultIterator { + return original.NewEmergingIssueListResultIterator(page) +} +func NewEmergingIssueListResultPage(getNextPage func(context.Context, EmergingIssueListResult) (EmergingIssueListResult, error)) EmergingIssueListResultPage { + return original.NewEmergingIssueListResultPage(getNextPage) +} +func NewEmergingIssuesClient(subscriptionID string) EmergingIssuesClient { + return original.NewEmergingIssuesClient(subscriptionID) +} +func NewEmergingIssuesClientWithBaseURI(baseURI string, subscriptionID string) EmergingIssuesClient { + return original.NewEmergingIssuesClientWithBaseURI(baseURI, subscriptionID) +} func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) } @@ -106,6 +148,12 @@ func PossibleAvailabilityStateValuesValues() []AvailabilityStateValues { func PossibleReasonChronicityTypesValues() []ReasonChronicityTypes { return original.PossibleReasonChronicityTypesValues() } +func PossibleSeverityValuesValues() []SeverityValues { + return original.PossibleSeverityValuesValues() +} +func PossibleStageValuesValues() []StageValues { + return original.PossibleStageValuesValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/resourcehealth/mgmt/resourcehealth/resourcehealthapi/models.go b/profiles/preview/resourcehealth/mgmt/resourcehealth/resourcehealthapi/models.go index 86f8804138fd..e5342f3ac740 100644 --- a/profiles/preview/resourcehealth/mgmt/resourcehealth/resourcehealthapi/models.go +++ b/profiles/preview/resourcehealth/mgmt/resourcehealth/resourcehealthapi/models.go @@ -24,4 +24,5 @@ import original "github.com/Azure/azure-sdk-for-go/services/resourcehealth/mgmt/ type AvailabilityStatusesClientAPI = original.AvailabilityStatusesClientAPI type ChildAvailabilityStatusesClientAPI = original.ChildAvailabilityStatusesClientAPI type ChildResourcesClientAPI = original.ChildResourcesClientAPI +type EmergingIssuesClientAPI = original.EmergingIssuesClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/services/appinsights/mgmt/2015-05-01/insights/models.go b/services/appinsights/mgmt/2015-05-01/insights/models.go index 3c63e3253c28..4080fa8c52df 100644 --- a/services/appinsights/mgmt/2015-05-01/insights/models.go +++ b/services/appinsights/mgmt/2015-05-01/insights/models.go @@ -875,6 +875,14 @@ type ApplicationInsightsComponentProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` // SamplingPercentage - Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. SamplingPercentage *float64 `json:"SamplingPercentage,omitempty"` + // ConnectionString - READ-ONLY; Application Insights component connection string. + ConnectionString *string `json:"ConnectionString,omitempty"` + // RetentionInDays - Retention period in days. + RetentionInDays *int32 `json:"RetentionInDays,omitempty"` + // DisableIPMasking - Disable IP masking. + DisableIPMasking *bool `json:"DisableIpMasking,omitempty"` + // ImmediatePurgeDataOn30Days - Purge data immediately after 30 days. + ImmediatePurgeDataOn30Days *bool `json:"ImmediatePurgeDataOn30Days,omitempty"` } // ApplicationInsightsComponentQuotaStatus an Application Insights component daily data volume cap status diff --git a/services/authorization/mgmt/2015-07-01/authorization/authorizationapi/interfaces.go b/services/authorization/mgmt/2015-07-01/authorization/authorizationapi/interfaces.go index 8ae0b842b796..8dc96c7e2d74 100644 --- a/services/authorization/mgmt/2015-07-01/authorization/authorizationapi/interfaces.go +++ b/services/authorization/mgmt/2015-07-01/authorization/authorizationapi/interfaces.go @@ -44,8 +44,8 @@ var _ RoleDefinitionsClientAPI = (*authorization.RoleDefinitionsClient)(nil) // ProviderOperationsMetadataClientAPI contains the set of methods on the ProviderOperationsMetadataClient type. type ProviderOperationsMetadataClientAPI interface { - Get(ctx context.Context, resourceProviderNamespace string, expand string) (result authorization.ProviderOperationsMetadata, err error) - List(ctx context.Context, expand string) (result authorization.ProviderOperationsMetadataListResultPage, err error) + Get(ctx context.Context, resourceProviderNamespace string, APIVersion string, expand string) (result authorization.ProviderOperationsMetadata, err error) + List(ctx context.Context, APIVersion string, expand string) (result authorization.ProviderOperationsMetadataListResultPage, err error) } var _ ProviderOperationsMetadataClientAPI = (*authorization.ProviderOperationsMetadataClient)(nil) diff --git a/services/authorization/mgmt/2015-07-01/authorization/provideroperationsmetadata.go b/services/authorization/mgmt/2015-07-01/authorization/provideroperationsmetadata.go index e9db958782a3..c7e814a9dcf2 100644 --- a/services/authorization/mgmt/2015-07-01/authorization/provideroperationsmetadata.go +++ b/services/authorization/mgmt/2015-07-01/authorization/provideroperationsmetadata.go @@ -46,8 +46,9 @@ func NewProviderOperationsMetadataClientWithBaseURI(baseURI string, subscription // Get gets provider operations metadata for the specified resource provider. // Parameters: // resourceProviderNamespace - the namespace of the resource provider. +// APIVersion - the API version to use for the operation. // expand - specifies whether to expand the values. -func (client ProviderOperationsMetadataClient) Get(ctx context.Context, resourceProviderNamespace string, expand string) (result ProviderOperationsMetadata, err error) { +func (client ProviderOperationsMetadataClient) Get(ctx context.Context, resourceProviderNamespace string, APIVersion string, expand string) (result ProviderOperationsMetadata, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationsMetadataClient.Get") defer func() { @@ -58,7 +59,7 @@ func (client ProviderOperationsMetadataClient) Get(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, resourceProviderNamespace, expand) + req, err := client.GetPreparer(ctx, resourceProviderNamespace, APIVersion, expand) if err != nil { err = autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataClient", "Get", nil, "Failure preparing request") return @@ -80,12 +81,11 @@ func (client ProviderOperationsMetadataClient) Get(ctx context.Context, resource } // GetPreparer prepares the Get request. -func (client ProviderOperationsMetadataClient) GetPreparer(ctx context.Context, resourceProviderNamespace string, expand string) (*http.Request, error) { +func (client ProviderOperationsMetadataClient) GetPreparer(ctx context.Context, resourceProviderNamespace string, APIVersion string, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace), } - const APIVersion = "2015-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -125,8 +125,9 @@ func (client ProviderOperationsMetadataClient) GetResponder(resp *http.Response) // List gets provider operations metadata for all resource providers. // Parameters: +// APIVersion - the API version to use for this operation. // expand - specifies whether to expand the values. -func (client ProviderOperationsMetadataClient) List(ctx context.Context, expand string) (result ProviderOperationsMetadataListResultPage, err error) { +func (client ProviderOperationsMetadataClient) List(ctx context.Context, APIVersion string, expand string) (result ProviderOperationsMetadataListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationsMetadataClient.List") defer func() { @@ -138,7 +139,7 @@ func (client ProviderOperationsMetadataClient) List(ctx context.Context, expand }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, expand) + req, err := client.ListPreparer(ctx, APIVersion, expand) if err != nil { err = autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataClient", "List", nil, "Failure preparing request") return @@ -160,8 +161,7 @@ func (client ProviderOperationsMetadataClient) List(ctx context.Context, expand } // ListPreparer prepares the List request. -func (client ProviderOperationsMetadataClient) ListPreparer(ctx context.Context, expand string) (*http.Request, error) { - const APIVersion = "2015-07-01" +func (client ProviderOperationsMetadataClient) ListPreparer(ctx context.Context, APIVersion string, expand string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -221,7 +221,7 @@ func (client ProviderOperationsMetadataClient) listNextResults(ctx context.Conte } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProviderOperationsMetadataClient) ListComplete(ctx context.Context, expand string) (result ProviderOperationsMetadataListResultIterator, err error) { +func (client ProviderOperationsMetadataClient) ListComplete(ctx context.Context, APIVersion string, expand string) (result ProviderOperationsMetadataListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationsMetadataClient.List") defer func() { @@ -232,6 +232,6 @@ func (client ProviderOperationsMetadataClient) ListComplete(ctx context.Context, tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, expand) + result.page, err = client.List(ctx, APIVersion, expand) return } diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go index 96aa03010e9f..37a1f4c7a320 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go @@ -142,7 +142,7 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result Accoun err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -227,7 +227,7 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -974,7 +974,7 @@ func (client AccountsClient) UpdateResponder(resp *http.Response) (result Accoun err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/services/cognitiveservices/v2.1/textanalytics/client.go b/services/cognitiveservices/v2.1/textanalytics/client.go index bc46766f255b..558ec236c6de 100644 --- a/services/cognitiveservices/v2.1/textanalytics/client.go +++ b/services/cognitiveservices/v2.1/textanalytics/client.go @@ -305,7 +305,7 @@ func (client BaseClient) KeyPhrasesResponder(resp *http.Response) (result KeyPhr // Parameters: // showStats - (optional) if set to true, response will contain input and document level statistics. // multiLanguageBatchInput - collection of documents to analyze. -func (client BaseClient) Sentiment(ctx context.Context, showStats *bool, multiLanguageBatchInput *MultiLanguageBatchInput) (result SetObject, err error) { +func (client BaseClient) Sentiment(ctx context.Context, showStats *bool, multiLanguageBatchInput *MultiLanguageBatchInput) (result SentimentBatchResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Sentiment") defer func() { @@ -370,12 +370,12 @@ func (client BaseClient) SentimentSender(req *http.Request) (*http.Response, err // SentimentResponder handles the response to the Sentiment request. The method always // closes the http.Response Body. -func (client BaseClient) SentimentResponder(resp *http.Response) (result SetObject, err error) { +func (client BaseClient) SentimentResponder(resp *http.Response) (result SentimentBatchResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusInternalServerError), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/cognitiveservices/v2.1/textanalytics/models.go b/services/cognitiveservices/v2.1/textanalytics/models.go index af6d990d06a0..f592fa356c93 100644 --- a/services/cognitiveservices/v2.1/textanalytics/models.go +++ b/services/cognitiveservices/v2.1/textanalytics/models.go @@ -203,6 +203,7 @@ type RequestStatistics struct { // SentimentBatchResult ... type SentimentBatchResult struct { + autorest.Response `json:"-"` // Documents - READ-ONLY; Response by document Documents *[]SentimentBatchResultItem `json:"documents,omitempty"` // Errors - READ-ONLY; Errors and Warnings by document @@ -220,9 +221,3 @@ type SentimentBatchResultItem struct { // Statistics - (Optional) if showStats=true was specified in the request this field will contain information about the document payload. Statistics *DocumentStatistics `json:"statistics,omitempty"` } - -// SetObject ... -type SetObject struct { - autorest.Response `json:"-"` - Value interface{} `json:"value,omitempty"` -} diff --git a/services/cognitiveservices/v2.1/textanalytics/textanalyticsapi/interfaces.go b/services/cognitiveservices/v2.1/textanalytics/textanalyticsapi/interfaces.go index c76a3d7fddca..dd48e4923ca2 100644 --- a/services/cognitiveservices/v2.1/textanalytics/textanalyticsapi/interfaces.go +++ b/services/cognitiveservices/v2.1/textanalytics/textanalyticsapi/interfaces.go @@ -27,7 +27,7 @@ type BaseClientAPI interface { DetectLanguage(ctx context.Context, showStats *bool, languageBatchInput *textanalytics.LanguageBatchInput) (result textanalytics.LanguageBatchResult, err error) Entities(ctx context.Context, showStats *bool, multiLanguageBatchInput *textanalytics.MultiLanguageBatchInput) (result textanalytics.EntitiesBatchResult, err error) KeyPhrases(ctx context.Context, showStats *bool, multiLanguageBatchInput *textanalytics.MultiLanguageBatchInput) (result textanalytics.KeyPhraseBatchResult, err error) - Sentiment(ctx context.Context, showStats *bool, multiLanguageBatchInput *textanalytics.MultiLanguageBatchInput) (result textanalytics.SetObject, err error) + Sentiment(ctx context.Context, showStats *bool, multiLanguageBatchInput *textanalytics.MultiLanguageBatchInput) (result textanalytics.SentimentBatchResult, err error) } var _ BaseClientAPI = (*textanalytics.BaseClient)(nil) diff --git a/services/compute/mgmt/2018-10-01/compute/models.go b/services/compute/mgmt/2018-10-01/compute/models.go index 6ada29eeddfd..0e862e7381c1 100644 --- a/services/compute/mgmt/2018-10-01/compute/models.go +++ b/services/compute/mgmt/2018-10-01/compute/models.go @@ -1249,10 +1249,8 @@ type AutomaticOSUpgradeProperties struct { type AutomaticRepairsPolicy struct { // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. Enabled *bool `json:"enabled,omitempty"` - // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The default value is 5 minutes (PT5M). + // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. GracePeriod *string `json:"gracePeriod,omitempty"` - // MaxInstanceRepairsPercent - The percentage (capacity of scaleset) of virtual machines that will be simultaneously repaired. The default value is 20%. - MaxInstanceRepairsPercent *int32 `json:"maxInstanceRepairsPercent,omitempty"` } // AvailabilitySet specifies information about the availability set that the virtual machine should be diff --git a/services/compute/mgmt/2019-03-01/compute/models.go b/services/compute/mgmt/2019-03-01/compute/models.go index 33312daac1fe..8d0ab02d7d25 100644 --- a/services/compute/mgmt/2019-03-01/compute/models.go +++ b/services/compute/mgmt/2019-03-01/compute/models.go @@ -850,13 +850,13 @@ func PossibleStorageAccountTypeValues() []StorageAccountType { type StorageAccountTypes string const ( - // StorageAccountTypesPremiumLRS Premium_LRS for StorageAccountType. + // StorageAccountTypesPremiumLRS ... StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - // StorageAccountTypesStandardLRS Standard_LRS for StorageAccountType. + // StorageAccountTypesStandardLRS ... StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - // StorageAccountTypesStandardSSDLRS StandardSSD_LRS for StorageAccountType. + // StorageAccountTypesStandardSSDLRS ... StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - // StorageAccountTypesUltraSSDLRS UltraSSD_LRS for StorageAccountType. + // StorageAccountTypesUltraSSDLRS ... StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" ) @@ -1402,10 +1402,8 @@ type AutomaticOSUpgradeProperties struct { type AutomaticRepairsPolicy struct { // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. Enabled *bool `json:"enabled,omitempty"` - // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The default value is 5 minutes (PT5M). + // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. GracePeriod *string `json:"gracePeriod,omitempty"` - // MaxInstanceRepairsPercent - The percentage (capacity of scaleset) of virtual machines that will be simultaneously repaired. The default value is 20%. - MaxInstanceRepairsPercent *int32 `json:"maxInstanceRepairsPercent,omitempty"` } // AvailabilitySet specifies information about the availability set that the virtual machine should be diff --git a/services/compute/mgmt/2019-07-01/compute/models.go b/services/compute/mgmt/2019-07-01/compute/models.go index ea09b2c85993..95ab62fecde3 100644 --- a/services/compute/mgmt/2019-07-01/compute/models.go +++ b/services/compute/mgmt/2019-07-01/compute/models.go @@ -518,9 +518,9 @@ func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationR type OperatingSystemStateTypes string const ( - // Generalized ... + // Generalized Generalized image. Needs to be provisioned during deployment time. Generalized OperatingSystemStateTypes = "Generalized" - // Specialized ... + // Specialized Specialized image. Contains already provisioned OS Disk. Specialized OperatingSystemStateTypes = "Specialized" ) @@ -1431,10 +1431,8 @@ type AutomaticOSUpgradeProperties struct { type AutomaticRepairsPolicy struct { // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. Enabled *bool `json:"enabled,omitempty"` - // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The default value is 5 minutes (PT5M). + // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. GracePeriod *string `json:"gracePeriod,omitempty"` - // MaxInstanceRepairsPercent - The percentage (capacity of scaleset) of virtual machines that will be simultaneously repaired. The default value is 20%. - MaxInstanceRepairsPercent *int32 `json:"maxInstanceRepairsPercent,omitempty"` } // AvailabilitySet specifies information about the availability set that the virtual machine should be @@ -2263,7 +2261,7 @@ type ContainerServiceWindowsProfile struct { type CreationData struct { // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' CreateOption DiskCreateOption `json:"createOption,omitempty"` - // StorageAccountID - If createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription + // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. StorageAccountID *string `json:"storageAccountId,omitempty"` // ImageReference - Disk source information. ImageReference *ImageDiskReference `json:"imageReference,omitempty"` @@ -4128,6 +4126,8 @@ type DiskUpdateProperties struct { DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` + // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` } // Encryption encryption at rest settings for disk or snapshot @@ -7499,15 +7499,16 @@ type OSDiskImage struct { OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` } -// OSProfile specifies the operating system settings for the virtual machine. +// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot +// be changed once VM is provisioned. type OSProfile struct { // ComputerName - Specifies the host OS name of the virtual machine.

This name cannot be updated after the VM is created.

**Max-length (Windows):** 15 characters

**Max-length (Linux):** 64 characters.

For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). ComputerName *string `json:"computerName,omitempty"` - // AdminUsername - Specifies the name of the administrator account.

**Windows-only restriction:** Cannot end in "."

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length (Linux):** 1 character

**Max-length (Linux):** 64 characters

**Max-length (Windows):** 20 characters

  • For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + // AdminUsername - Specifies the name of the administrator account.

    This property cannot be updated after the VM is created.

    **Windows-only restriction:** Cannot end in "."

    **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 character

    **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 characters

  • For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) AdminUsername *string `json:"adminUsername,omitempty"` // AdminPassword - Specifies the password of the administrator account.

    **Minimum-length (Windows):** 8 characters

    **Minimum-length (Linux):** 6 characters

    **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 characters

    **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
    Has lower characters
    Has upper characters
    Has a digit
    Has a special character (Regex match [\W_])

    **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) AdminPassword *string `json:"adminPassword,omitempty"` - // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

    For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) + // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

    **Note: Do not pass any secrets or passwords in customData property**

    This property cannot be updated after the VM is created.

    customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/)

    For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) CustomData *string `json:"customData,omitempty"` // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` @@ -7517,7 +7518,7 @@ type OSProfile struct { Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine.

    This may only be set to False when no extensions are present on the virtual machine. AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` - // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required from the virtual machine. + // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` } @@ -7790,11 +7791,13 @@ type ProximityPlacementGroupProperties struct { // ProximityPlacementGroupType - Specifies the type of the proximity placement group.

    Possible values are:

    **Standard** : Co-locate resources within an Azure region or Availability Zone.

    **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. - VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` + VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. - VirtualMachineScaleSets *[]SubResource `json:"virtualMachineScaleSets,omitempty"` + VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. - AvailabilitySets *[]SubResource `json:"availabilitySets,omitempty"` + AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` + // ColocationStatus - Describes colocation status of the Proximity Placement Group. + ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` } // ProximityPlacementGroupUpdate specifies information about the proximity placement group. @@ -9067,6 +9070,8 @@ type SnapshotUpdateProperties struct { DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` + // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` } // SourceVault the vault id is an Azure Resource Manager Resource id in the form @@ -9113,6 +9118,14 @@ type SubResourceReadOnly struct { ID *string `json:"id,omitempty"` } +// SubResourceWithColocationStatus ... +type SubResourceWithColocationStatus struct { + // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. + ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + // TargetRegion describes the target region information. type TargetRegion struct { // Name - The name of the region. @@ -10263,7 +10276,7 @@ type VirtualMachineProperties struct { StorageProfile *StorageProfile `json:"storageProfile,omitempty"` // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings for the virtual machine. + // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. OsProfile *OSProfile `json:"osProfile,omitempty"` // NetworkProfile - Specifies the network interfaces of the virtual machine. NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` @@ -10277,7 +10290,7 @@ type VirtualMachineProperties struct { ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` // Priority - Specifies the priority for the virtual machine.

    Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine. Only supported value is 'Deallocate'.

    Minimum api-version: 2019-03-01. Possible values include: 'Deallocate', 'Delete' + // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

    For Azure Spot virtual machines, the only supported value is 'Deallocate' and the minimum api-version is 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine.

    Minimum api-version: 2019-03-01. BillingProfile *BillingProfile `json:"billingProfile,omitempty"` @@ -13201,7 +13214,7 @@ type VirtualMachineScaleSetVMProfile struct { LicenseType *string `json:"licenseType,omitempty"` // Priority - Specifies the priority for the virtual machines in the scale set.

    Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for virtual machines in a Azure Spot scale set.

    Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' + // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

    For Azure Spot virtual machines, the only supported value is 'Deallocate' and the minimum api-version is 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

    Minimum api-version: 2019-03-01. BillingProfile *BillingProfile `json:"billingProfile,omitempty"` @@ -14040,7 +14053,7 @@ type WindowsConfiguration struct { ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` // EnableAutomaticUpdates - Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true.

    For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` - // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time" + // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time".

    Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). TimeZone *string `json:"timeZone,omitempty"` // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` @@ -14056,7 +14069,7 @@ type WinRMConfiguration struct { // WinRMListener describes Protocol and thumbprint of Windows Remote Management listener type WinRMListener struct { - // Protocol - Specifies the protocol of listener.

    Possible values are:
    **http**

    **https**. Possible values include: 'HTTP', 'HTTPS' + // Protocol - Specifies the protocol of WinRM listener.

    Possible values are:
    **http**

    **https**. Possible values include: 'HTTP', 'HTTPS' Protocol ProtocolTypes `json:"protocol,omitempty"` // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

    {
    "data":"",
    "dataType":"pfx",
    "password":""
    } CertificateURL *string `json:"certificateUrl,omitempty"` diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachines.go b/services/compute/mgmt/2019-07-01/compute/virtualmachines.go index 3d25da43d3ea..40f47fff86a9 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachines.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachines.go @@ -207,7 +207,8 @@ func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Re return } -// CreateOrUpdate the operation to create or update a virtual machine. +// CreateOrUpdate the operation to create or update a virtual machine. Please note some properties can be set only +// during virtual machine creation. // Parameters: // resourceGroupName - the name of the resource group. // VMName - the name of the virtual machine. @@ -463,7 +464,10 @@ func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result } // Generalize sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine -// before performing this operation +// before performing this operation.
    For Windows, please refer to [Create a managed image of a generalized VM in +// Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).
    For Linux, please +// refer to [How to create an image of a virtual machine or +// VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). // Parameters: // resourceGroupName - the name of the resource group. // VMName - the name of the virtual machine. diff --git a/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go b/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go index 3189aacd5eec..3926308d98f6 100644 --- a/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go +++ b/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go @@ -104,9 +104,6 @@ func (client AgentPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resou "api-version": APIVersion, } - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), diff --git a/services/containerservice/mgmt/2019-11-01/containerservice/client.go b/services/containerservice/mgmt/2019-11-01/containerservice/client.go index db34d09b45b0..09a36def717c 100644 --- a/services/containerservice/mgmt/2019-11-01/containerservice/client.go +++ b/services/containerservice/mgmt/2019-11-01/containerservice/client.go @@ -1,4 +1,4 @@ -// Package containerservice implements the Azure ARM Containerservice service API version 2019-04-30. +// Package containerservice implements the Azure ARM Containerservice service API version . // // The Container Service Client. package containerservice diff --git a/services/containerservice/mgmt/2019-11-01/containerservice/containerservices.go b/services/containerservice/mgmt/2019-11-01/containerservice/containerservices.go index bfa575493222..1bd2a37eec45 100644 --- a/services/containerservice/mgmt/2019-11-01/containerservice/containerservices.go +++ b/services/containerservice/mgmt/2019-11-01/containerservice/containerservices.go @@ -60,34 +60,35 @@ func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resour } if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Properties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.OrchestratorProfile", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Properties.CustomProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.Properties.ServicePrincipalProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.VaultID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.SecretName", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - {Target: "parameters.Properties.MasterProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Properties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.Properties.WindowsProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.Properties.LinuxProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Properties.LinuxProfile.SSH", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "parameters.Properties.DiagnosticsProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.OrchestratorProfile", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.CustomProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.VaultID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.SecretName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.Properties.MasterProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.Properties.LinuxProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.Properties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.Properties.DiagnosticsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { return result, validation.NewError("containerservice.ContainerServicesClient", "CreateOrUpdate", err.Error()) } @@ -119,9 +120,6 @@ func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context "api-version": APIVersion, } - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), diff --git a/services/containerservice/mgmt/2019-11-01/containerservice/managedclusters.go b/services/containerservice/mgmt/2019-11-01/containerservice/managedclusters.go index a17bc0eb8534..3fefb76debbd 100644 --- a/services/containerservice/mgmt/2019-11-01/containerservice/managedclusters.go +++ b/services/containerservice/mgmt/2019-11-01/containerservice/managedclusters.go @@ -66,19 +66,29 @@ func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resource {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ManagedClusterProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, }}, - {Target: "parameters.ManagedClusterProperties.WindowsProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ManagedClusterProperties.NetworkProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile", Name: validation.Null, Rule: false, + {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Pattern, Rule: `^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, @@ -94,12 +104,12 @@ func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resource {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMinimum, Rule: int64(4), Chain: nil}, }}, }}, - }}, - {Target: "parameters.ManagedClusterProperties.AadProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.AadProfile.ClientAppID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ManagedClusterProperties.AadProfile.ServerAppID", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { + }}, + {Target: "parameters.ManagedClusterProperties.AadProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.AadProfile.ClientAppID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagedClusterProperties.AadProfile.ServerAppID", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { return result, validation.NewError("containerservice.ManagedClustersClient", "CreateOrUpdate", err.Error()) } @@ -131,9 +141,6 @@ func (client ManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, "api-version": APIVersion, } - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), diff --git a/services/containerservice/mgmt/2019-11-01/containerservice/models.go b/services/containerservice/mgmt/2019-11-01/containerservice/models.go index ae8d9d693735..c1623455b6d2 100644 --- a/services/containerservice/mgmt/2019-11-01/containerservice/models.go +++ b/services/containerservice/mgmt/2019-11-01/containerservice/models.go @@ -49,13 +49,15 @@ func PossibleAgentPoolTypeValues() []AgentPoolType { type Kind string const ( + // KindAADIdentityProvider ... + KindAADIdentityProvider Kind = "AADIdentityProvider" // KindOpenShiftManagedClusterBaseIdentityProvider ... KindOpenShiftManagedClusterBaseIdentityProvider Kind = "OpenShiftManagedClusterBaseIdentityProvider" ) // PossibleKindValues returns an array of possible values for the Kind const type. func PossibleKindValues() []Kind { - return []Kind{KindOpenShiftManagedClusterBaseIdentityProvider} + return []Kind{KindAADIdentityProvider, KindOpenShiftManagedClusterBaseIdentityProvider} } // LoadBalancerSku enumerates the values for load balancer sku. @@ -674,14 +676,14 @@ type AccessProfile struct { // AgentPool agent Pool. type AgentPool struct { autorest.Response `json:"-"` + // ManagedClusterAgentPoolProfileProperties - Properties of an agent pool. + *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type Type *string `json:"type,omitempty"` - // ManagedClusterAgentPoolProfileProperties - Properties of an agent pool. - *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for AgentPool. @@ -702,6 +704,15 @@ func (ap *AgentPool) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties + err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties) + if err != nil { + return err + } + ap.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties + } case "id": if v != nil { var ID string @@ -729,15 +740,6 @@ func (ap *AgentPool) UnmarshalJSON(body []byte) error { } ap.Type = &typeVar } - case "properties": - if v != nil { - var managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties - err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties) - if err != nil { - return err - } - ap.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties - } } } @@ -1164,260 +1166,11 @@ type CloudErrorBody struct { Details *[]CloudErrorBody `json:"details,omitempty"` } -// Componentsschemasagentpoolallof1 ... -type Componentsschemasagentpoolallof1 struct { - // ManagedClusterAgentPoolProfileProperties - Properties of an agent pool. - *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Componentsschemasagentpoolallof1. -func (c Componentsschemasagentpoolallof1) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ManagedClusterAgentPoolProfileProperties != nil { - objectMap["properties"] = c.ManagedClusterAgentPoolProfileProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Componentsschemasagentpoolallof1 struct. -func (c *Componentsschemasagentpoolallof1) 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 managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties - err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties) - if err != nil { - return err - } - c.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties - } - } - } - - return nil -} - -// Componentsschemascontainerserviceallof1 ... -type Componentsschemascontainerserviceallof1 struct { - // Properties - Properties of the container service. - *Properties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Componentsschemascontainerserviceallof1. -func (c Componentsschemascontainerserviceallof1) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.Properties != nil { - objectMap["properties"] = c.Properties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Componentsschemascontainerserviceallof1 struct. -func (c *Componentsschemascontainerserviceallof1) 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 - } - c.Properties = &properties - } - } - } - - return nil -} - -// Componentsschemasmanagedclusteraccessprofileallof1 ... -type Componentsschemasmanagedclusteraccessprofileallof1 struct { - // AccessProfile - AccessProfile of a managed cluster. - *AccessProfile `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Componentsschemasmanagedclusteraccessprofileallof1. -func (c Componentsschemasmanagedclusteraccessprofileallof1) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.AccessProfile != nil { - objectMap["properties"] = c.AccessProfile - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Componentsschemasmanagedclusteraccessprofileallof1 struct. -func (c *Componentsschemasmanagedclusteraccessprofileallof1) 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 accessProfile AccessProfile - err = json.Unmarshal(*v, &accessProfile) - if err != nil { - return err - } - c.AccessProfile = &accessProfile - } - } - } - - return nil -} - -// Componentsschemasmanagedclusteragentpoolprofileallof1 ... -type Componentsschemasmanagedclusteragentpoolprofileallof1 struct { - // Name - Unique name of the agent pool profile in the context of the subscription and resource group. - Name *string `json:"name,omitempty"` -} - -// Componentsschemasmanagedclusterallof1 ... -type Componentsschemasmanagedclusterallof1 struct { - // ManagedClusterProperties - Properties of a managed cluster. - *ManagedClusterProperties `json:"properties,omitempty"` - // Identity - The identity of the managed cluster, if configured. - Identity *ManagedClusterIdentity `json:"identity,omitempty"` -} - -// MarshalJSON is the custom marshaler for Componentsschemasmanagedclusterallof1. -func (c Componentsschemasmanagedclusterallof1) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ManagedClusterProperties != nil { - objectMap["properties"] = c.ManagedClusterProperties - } - if c.Identity != nil { - objectMap["identity"] = c.Identity - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Componentsschemasmanagedclusterallof1 struct. -func (c *Componentsschemasmanagedclusterallof1) 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 managedClusterProperties ManagedClusterProperties - err = json.Unmarshal(*v, &managedClusterProperties) - if err != nil { - return err - } - c.ManagedClusterProperties = &managedClusterProperties - } - case "identity": - if v != nil { - var identity ManagedClusterIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - c.Identity = &identity - } - } - } - - return nil -} - -// Componentsschemasmanagedclusterpropertiespropertiesidentityprofileadditionalproperties ... -type Componentsschemasmanagedclusterpropertiespropertiesidentityprofileadditionalproperties struct { - // ResourceID - The resource id of the user assigned identity. - ResourceID *string `json:"resourceId,omitempty"` - // ClientID - The client id of the user assigned identity. - ClientID *string `json:"clientId,omitempty"` - // ObjectID - The object id of the user assigned identity. - ObjectID *string `json:"objectId,omitempty"` -} - -// Componentsschemasopenshiftmanagedclusteraadidentityproviderallof1 ... -type Componentsschemasopenshiftmanagedclusteraadidentityproviderallof1 struct { - // ClientID - The clientId password associated with the provider. - ClientID *string `json:"clientId,omitempty"` - // Secret - The secret password associated with the provider. - Secret *string `json:"secret,omitempty"` - // TenantID - The tenantId associated with the provider. - TenantID *string `json:"tenantId,omitempty"` - // CustomerAdminGroupID - The groupId to be granted cluster admin role. - CustomerAdminGroupID *string `json:"customerAdminGroupId,omitempty"` -} - -// Componentsschemasopenshiftmanagedclusterallof1 ... -type Componentsschemasopenshiftmanagedclusterallof1 struct { - // Plan - Define the resource plan as required by ARM for billing purposes - Plan *PurchasePlan `json:"plan,omitempty"` - // OpenShiftManagedClusterProperties - Properties of a OpenShift managed cluster. - *OpenShiftManagedClusterProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Componentsschemasopenshiftmanagedclusterallof1. -func (c Componentsschemasopenshiftmanagedclusterallof1) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.Plan != nil { - objectMap["plan"] = c.Plan - } - if c.OpenShiftManagedClusterProperties != nil { - objectMap["properties"] = c.OpenShiftManagedClusterProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Componentsschemasopenshiftmanagedclusterallof1 struct. -func (c *Componentsschemasopenshiftmanagedclusterallof1) 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 "plan": - if v != nil { - var plan PurchasePlan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - c.Plan = &plan - } - case "properties": - if v != nil { - var openShiftManagedClusterProperties OpenShiftManagedClusterProperties - err = json.Unmarshal(*v, &openShiftManagedClusterProperties) - if err != nil { - return err - } - c.OpenShiftManagedClusterProperties = &openShiftManagedClusterProperties - } - } - } - - return nil -} - // ContainerService container service. type ContainerService struct { autorest.Response `json:"-"` + // Properties - Properties of the container service. + *Properties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -1428,22 +1181,20 @@ type ContainerService struct { Location *string `json:"location,omitempty"` // Tags - Resource tags Tags map[string]*string `json:"tags"` - // Properties - Properties of the container service. - *Properties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for ContainerService. func (cs ContainerService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if cs.Properties != nil { + objectMap["properties"] = cs.Properties + } if cs.Location != nil { objectMap["location"] = cs.Location } if cs.Tags != nil { objectMap["tags"] = cs.Tags } - if cs.Properties != nil { - objectMap["properties"] = cs.Properties - } return json.Marshal(objectMap) } @@ -1456,6 +1207,15 @@ func (cs *ContainerService) UnmarshalJSON(body []byte) error { } 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 + } + cs.Properties = &properties + } case "id": if v != nil { var ID string @@ -1501,15 +1261,6 @@ func (cs *ContainerService) UnmarshalJSON(body []byte) error { } cs.Tags = tags } - case "properties": - if v != nil { - var properties Properties - err = json.Unmarshal(*v, &properties) - if err != nil { - return err - } - cs.Properties = &properties - } } } @@ -1762,6 +1513,10 @@ func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult // ManagedCluster managed cluster. type ManagedCluster struct { autorest.Response `json:"-"` + // ManagedClusterProperties - Properties of a managed cluster. + *ManagedClusterProperties `json:"properties,omitempty"` + // Identity - The identity of the managed cluster, if configured. + Identity *ManagedClusterIdentity `json:"identity,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -1772,27 +1527,23 @@ type ManagedCluster struct { Location *string `json:"location,omitempty"` // Tags - Resource tags Tags map[string]*string `json:"tags"` - // ManagedClusterProperties - Properties of a managed cluster. - *ManagedClusterProperties `json:"properties,omitempty"` - // Identity - The identity of the managed cluster, if configured. - Identity *ManagedClusterIdentity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for ManagedCluster. func (mc ManagedCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if mc.Location != nil { - objectMap["location"] = mc.Location - } - if mc.Tags != nil { - objectMap["tags"] = mc.Tags - } if mc.ManagedClusterProperties != nil { objectMap["properties"] = mc.ManagedClusterProperties } if mc.Identity != nil { objectMap["identity"] = mc.Identity } + if mc.Location != nil { + objectMap["location"] = mc.Location + } + if mc.Tags != nil { + objectMap["tags"] = mc.Tags + } return json.Marshal(objectMap) } @@ -1805,6 +1556,24 @@ func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var managedClusterProperties ManagedClusterProperties + err = json.Unmarshal(*v, &managedClusterProperties) + if err != nil { + return err + } + mc.ManagedClusterProperties = &managedClusterProperties + } + case "identity": + if v != nil { + var identity ManagedClusterIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mc.Identity = &identity + } case "id": if v != nil { var ID string @@ -1850,24 +1619,6 @@ func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { } mc.Tags = tags } - case "properties": - if v != nil { - var managedClusterProperties ManagedClusterProperties - err = json.Unmarshal(*v, &managedClusterProperties) - if err != nil { - return err - } - mc.ManagedClusterProperties = &managedClusterProperties - } - case "identity": - if v != nil { - var identity ManagedClusterIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - mc.Identity = &identity - } } } @@ -1889,6 +1640,8 @@ type ManagedClusterAADProfile struct { // ManagedClusterAccessProfile managed cluster Access Profile. type ManagedClusterAccessProfile struct { autorest.Response `json:"-"` + // AccessProfile - AccessProfile of a managed cluster. + *AccessProfile `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -1899,22 +1652,20 @@ type ManagedClusterAccessProfile struct { Location *string `json:"location,omitempty"` // Tags - Resource tags Tags map[string]*string `json:"tags"` - // AccessProfile - AccessProfile of a managed cluster. - *AccessProfile `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if mcap.AccessProfile != nil { + objectMap["properties"] = mcap.AccessProfile + } if mcap.Location != nil { objectMap["location"] = mcap.Location } if mcap.Tags != nil { objectMap["tags"] = mcap.Tags } - if mcap.AccessProfile != nil { - objectMap["properties"] = mcap.AccessProfile - } return json.Marshal(objectMap) } @@ -1927,6 +1678,15 @@ func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + var accessProfile AccessProfile + err = json.Unmarshal(*v, &accessProfile) + if err != nil { + return err + } + mcap.AccessProfile = &accessProfile + } case "id": if v != nil { var ID string @@ -1972,15 +1732,6 @@ func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { } mcap.Tags = tags } - case "properties": - if v != nil { - var accessProfile AccessProfile - err = json.Unmarshal(*v, &accessProfile) - if err != nil { - return err - } - mcap.AccessProfile = &accessProfile - } } } @@ -2021,6 +1772,8 @@ type ManagedClusterAddonProfileIdentity struct { // ManagedClusterAgentPoolProfile profile for the container service agent pool. type ManagedClusterAgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. Count *int32 `json:"count,omitempty"` // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' @@ -2059,13 +1812,14 @@ type ManagedClusterAgentPoolProfile struct { NodeLabels map[string]*string `json:"nodeLabels"` // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. NodeTaints *[]string `json:"nodeTaints,omitempty"` - // Name - Unique name of the agent pool profile in the context of the subscription and resource group. - Name *string `json:"name,omitempty"` } // MarshalJSON is the custom marshaler for ManagedClusterAgentPoolProfile. func (mcapp ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if mcapp.Name != nil { + objectMap["name"] = mcapp.Name + } if mcapp.Count != nil { objectMap["count"] = mcapp.Count } @@ -2120,9 +1874,6 @@ func (mcapp ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { if mcapp.NodeTaints != nil { objectMap["nodeTaints"] = mcapp.NodeTaints } - if mcapp.Name != nil { - objectMap["name"] = mcapp.Name - } return json.Marshal(objectMap) } @@ -2486,7 +2237,7 @@ type ManagedClusterProperties struct { // APIServerAccessProfile - Access profile for managed cluster API server. APIServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` // IdentityProfile - Identities associated with the cluster. - IdentityProfile map[string]*Componentsschemasmanagedclusterpropertiespropertiesidentityprofileadditionalproperties `json:"identityProfile"` + IdentityProfile map[string]*ManagedClusterPropertiesIdentityProfileValue `json:"identityProfile"` } // MarshalJSON is the custom marshaler for ManagedClusterProperties. @@ -2537,6 +2288,16 @@ func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ManagedClusterPropertiesIdentityProfileValue ... +type ManagedClusterPropertiesIdentityProfileValue struct { + // ResourceID - The resource id of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client id of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object id of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + // ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ManagedClustersCreateOrUpdateFuture struct { @@ -2840,6 +2601,10 @@ type NetworkProfileType struct { // OpenShiftManagedCluster openShift Managed cluster. type OpenShiftManagedCluster struct { autorest.Response `json:"-"` + // Plan - Define the resource plan as required by ARM for billing purposes + Plan *PurchasePlan `json:"plan,omitempty"` + // OpenShiftManagedClusterProperties - Properties of a OpenShift managed cluster. + *OpenShiftManagedClusterProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -2850,27 +2615,23 @@ type OpenShiftManagedCluster struct { Location *string `json:"location,omitempty"` // Tags - Resource tags Tags map[string]*string `json:"tags"` - // Plan - Define the resource plan as required by ARM for billing purposes - Plan *PurchasePlan `json:"plan,omitempty"` - // OpenShiftManagedClusterProperties - Properties of a OpenShift managed cluster. - *OpenShiftManagedClusterProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for OpenShiftManagedCluster. func (osmc OpenShiftManagedCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if osmc.Location != nil { - objectMap["location"] = osmc.Location - } - if osmc.Tags != nil { - objectMap["tags"] = osmc.Tags - } if osmc.Plan != nil { objectMap["plan"] = osmc.Plan } if osmc.OpenShiftManagedClusterProperties != nil { objectMap["properties"] = osmc.OpenShiftManagedClusterProperties } + if osmc.Location != nil { + objectMap["location"] = osmc.Location + } + if osmc.Tags != nil { + objectMap["tags"] = osmc.Tags + } return json.Marshal(objectMap) } @@ -2883,6 +2644,24 @@ func (osmc *OpenShiftManagedCluster) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "plan": + if v != nil { + var plan PurchasePlan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + osmc.Plan = &plan + } + case "properties": + if v != nil { + var openShiftManagedClusterProperties OpenShiftManagedClusterProperties + err = json.Unmarshal(*v, &openShiftManagedClusterProperties) + if err != nil { + return err + } + osmc.OpenShiftManagedClusterProperties = &openShiftManagedClusterProperties + } case "id": if v != nil { var ID string @@ -2928,24 +2707,6 @@ func (osmc *OpenShiftManagedCluster) UnmarshalJSON(body []byte) error { } osmc.Tags = tags } - case "plan": - if v != nil { - var plan PurchasePlan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - osmc.Plan = &plan - } - case "properties": - if v != nil { - var openShiftManagedClusterProperties OpenShiftManagedClusterProperties - err = json.Unmarshal(*v, &openShiftManagedClusterProperties) - if err != nil { - return err - } - osmc.OpenShiftManagedClusterProperties = &openShiftManagedClusterProperties - } } } @@ -2954,8 +2715,6 @@ func (osmc *OpenShiftManagedCluster) UnmarshalJSON(body []byte) error { // OpenShiftManagedClusterAADIdentityProvider defines the Identity provider for MS AAD. type OpenShiftManagedClusterAADIdentityProvider struct { - // Kind - The kind of the provider. - Kind *string `json:"kind,omitempty"` // ClientID - The clientId password associated with the provider. ClientID *string `json:"clientId,omitempty"` // Secret - The secret password associated with the provider. @@ -2964,6 +2723,45 @@ type OpenShiftManagedClusterAADIdentityProvider struct { TenantID *string `json:"tenantId,omitempty"` // CustomerAdminGroupID - The groupId to be granted cluster admin role. CustomerAdminGroupID *string `json:"customerAdminGroupId,omitempty"` + // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) MarshalJSON() ([]byte, error) { + osmcaip.Kind = KindAADIdentityProvider + objectMap := make(map[string]interface{}) + if osmcaip.ClientID != nil { + objectMap["clientId"] = osmcaip.ClientID + } + if osmcaip.Secret != nil { + objectMap["secret"] = osmcaip.Secret + } + if osmcaip.TenantID != nil { + objectMap["tenantId"] = osmcaip.TenantID + } + if osmcaip.CustomerAdminGroupID != nil { + objectMap["customerAdminGroupId"] = osmcaip.CustomerAdminGroupID + } + if osmcaip.Kind != "" { + objectMap["kind"] = osmcaip.Kind + } + return json.Marshal(objectMap) +} + +// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { + return &osmcaip, true +} + +// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { + return nil, false +} + +// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcaip, true } // OpenShiftManagedClusterAgentPoolProfile defines the configuration of the OpenShift cluster VMs. @@ -2991,12 +2789,13 @@ type OpenShiftManagedClusterAuthProfile struct { // BasicOpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. type BasicOpenShiftManagedClusterBaseIdentityProvider interface { + AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) } // OpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. type OpenShiftManagedClusterBaseIdentityProvider struct { - // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider' + // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' Kind Kind `json:"kind,omitempty"` } @@ -3008,6 +2807,10 @@ func unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(body []byte) (Bas } switch m["kind"] { + case string(KindAADIdentityProvider): + var osmcaip OpenShiftManagedClusterAADIdentityProvider + err := json.Unmarshal(body, &osmcaip) + return osmcaip, err default: var osmcbip OpenShiftManagedClusterBaseIdentityProvider err := json.Unmarshal(body, &osmcbip) @@ -3043,6 +2846,11 @@ func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) MarshalJSON() ([]byte return json.Marshal(objectMap) } +// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { + return nil, false +} + // AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { return &osmcbip, true diff --git a/services/containerservice/mgmt/2019-11-01/containerservice/openshiftmanagedclusters.go b/services/containerservice/mgmt/2019-11-01/containerservice/openshiftmanagedclusters.go index b12e26dd604d..ac574f3c4121 100644 --- a/services/containerservice/mgmt/2019-11-01/containerservice/openshiftmanagedclusters.go +++ b/services/containerservice/mgmt/2019-11-01/containerservice/openshiftmanagedclusters.go @@ -62,12 +62,11 @@ func (client OpenShiftManagedClustersClient) CreateOrUpdate(ctx context.Context, {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.OpenShiftManagedClusterProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.OpenShiftVersion", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile.Count", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.OpenShiftVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile.Count", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", err.Error()) } @@ -99,9 +98,6 @@ func (client OpenShiftManagedClustersClient) CreateOrUpdatePreparer(ctx context. "api-version": APIVersion, } - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), diff --git a/services/containerservice/mgmt/2019-11-01/containerservice/version.go b/services/containerservice/mgmt/2019-11-01/containerservice/version.go index 7301ff9c2062..89b5e786c909 100644 --- a/services/containerservice/mgmt/2019-11-01/containerservice/version.go +++ b/services/containerservice/mgmt/2019-11-01/containerservice/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " containerservice/2019-04-30" + return "Azure-SDK-For-Go/" + version.Number + " containerservice/2019-11-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/alerts.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/alerts.go new file mode 100644 index 000000000000..4b01b0dcd67b --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/alerts.go @@ -0,0 +1,235 @@ +package databoxedge + +// 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" +) + +// AlertsClient is the client for the Alerts methods of the Databoxedge service. +type AlertsClient struct { + BaseClient +} + +// NewAlertsClient creates an instance of the AlertsClient client. +func NewAlertsClient(subscriptionID string) AlertsClient { + return NewAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAlertsClientWithBaseURI creates an instance of the AlertsClient client. +func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string) AlertsClient { + return AlertsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// name - the alert name. +// resourceGroupName - the resource group name. +func (client AlertsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result Alert, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AlertsClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}", 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 AlertsClient) 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 AlertsClient) GetResponder(resp *http.Response) (result Alert, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice gets all the alerts for a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client AlertsClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result AlertListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.al, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client AlertsClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client AlertsClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client AlertsClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result AlertList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client AlertsClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { + req, err := lastResults.alertListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.AlertsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result AlertListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/bandwidthschedules.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/bandwidthschedules.go new file mode 100644 index 000000000000..70d871e40fd9 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/bandwidthschedules.go @@ -0,0 +1,407 @@ +package databoxedge + +// 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" +) + +// BandwidthSchedulesClient is the client for the BandwidthSchedules methods of the Databoxedge service. +type BandwidthSchedulesClient struct { + BaseClient +} + +// NewBandwidthSchedulesClient creates an instance of the BandwidthSchedulesClient client. +func NewBandwidthSchedulesClient(subscriptionID string) BandwidthSchedulesClient { + return NewBandwidthSchedulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBandwidthSchedulesClientWithBaseURI creates an instance of the BandwidthSchedulesClient client. +func NewBandwidthSchedulesClientWithBaseURI(baseURI string, subscriptionID string) BandwidthSchedulesClient { + return BandwidthSchedulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a bandwidth schedule. +// Parameters: +// deviceName - the device name. +// name - the bandwidth schedule name which needs to be added/updated. +// parameters - the bandwidth schedule to be added or updated. +// resourceGroupName - the resource group name. +func (client BandwidthSchedulesClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, parameters BandwidthSchedule, resourceGroupName string) (result BandwidthSchedulesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.BandwidthScheduleProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.BandwidthScheduleProperties.Start", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.BandwidthScheduleProperties.Stop", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.BandwidthScheduleProperties.RateInMbps", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.BandwidthScheduleProperties.Days", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, parameters, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client BandwidthSchedulesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, parameters BandwidthSchedule, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", 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 BandwidthSchedulesClient) CreateOrUpdateSender(req *http.Request) (future BandwidthSchedulesCreateOrUpdateFuture, 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 BandwidthSchedulesClient) CreateOrUpdateResponder(resp *http.Response) (result BandwidthSchedule, 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 deletes the specified bandwidth schedule. +// Parameters: +// deviceName - the device name. +// name - the bandwidth schedule name. +// resourceGroupName - the resource group name. +func (client BandwidthSchedulesClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result BandwidthSchedulesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client BandwidthSchedulesClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", 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 BandwidthSchedulesClient) DeleteSender(req *http.Request) (future BandwidthSchedulesDeleteFuture, 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 BandwidthSchedulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified bandwidth schedule. +// Parameters: +// deviceName - the device name. +// name - the bandwidth schedule name. +// resourceGroupName - the resource group name. +func (client BandwidthSchedulesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result BandwidthSchedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client BandwidthSchedulesClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", 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 BandwidthSchedulesClient) 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 BandwidthSchedulesClient) GetResponder(resp *http.Response) (result BandwidthSchedule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result BandwidthSchedulesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.bsl.Response.Response != nil { + sc = result.bsl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.bsl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.bsl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result BandwidthSchedulesList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client BandwidthSchedulesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults BandwidthSchedulesList) (result BandwidthSchedulesList, err error) { + req, err := lastResults.bandwidthSchedulesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client BandwidthSchedulesClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result BandwidthSchedulesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/client.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/client.go new file mode 100644 index 000000000000..fbba95136b41 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/client.go @@ -0,0 +1,51 @@ +// Package databoxedge implements the Azure ARM Databoxedge service API version 2019-08-01. +// +// +package databoxedge + +// 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 Databoxedge + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Databoxedge. +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/databoxedge/mgmt/2019-08-01/databoxedge/containers.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/containers.go new file mode 100644 index 000000000000..2df7b0d2dcf6 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/containers.go @@ -0,0 +1,490 @@ +package databoxedge + +// 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" +) + +// ContainersClient is the client for the Containers methods of the Databoxedge service. +type ContainersClient struct { + BaseClient +} + +// NewContainersClient creates an instance of the ContainersClient client. +func NewContainersClient(subscriptionID string) ContainersClient { + return NewContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainersClientWithBaseURI creates an instance of the ContainersClient client. +func NewContainersClientWithBaseURI(baseURI string, subscriptionID string) ContainersClient { + return ContainersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// deviceName - the device name. +// storageAccountName - the Storage Account Name +// containerName - the container name. +// containerParameter - the container properties. +// resourceGroupName - the resource group name. +func (client ContainersClient) CreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, containerName string, containerParameter Container, resourceGroupName string) (result ContainersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: containerParameter, + Constraints: []validation.Constraint{{Target: "containerParameter.ContainerProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databoxedge.ContainersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, storageAccountName, containerName, containerParameter, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContainersClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, storageAccountName string, containerName string, containerParameter Container, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageAccountName": autorest.Encode("path", storageAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", pathParameters), + autorest.WithJSON(containerParameter), + 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 ContainersClient) CreateOrUpdateSender(req *http.Request) (future ContainersCreateOrUpdateFuture, 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 ContainersClient) CreateOrUpdateResponder(resp *http.Response) (result Container, 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 deletes the container on the Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// storageAccountName - the Storage Account Name +// containerName - the container name. +// resourceGroupName - the resource group name. +func (client ContainersClient) Delete(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (result ContainersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, storageAccountName, containerName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ContainersClient) DeletePreparer(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageAccountName": autorest.Encode("path", storageAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", 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 ContainersClient) DeleteSender(req *http.Request) (future ContainersDeleteFuture, 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 ContainersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// storageAccountName - the Storage Account Name +// containerName - the container Name +// resourceGroupName - the resource group name. +func (client ContainersClient) Get(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (result Container, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.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, deviceName, storageAccountName, containerName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContainersClient) GetPreparer(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageAccountName": autorest.Encode("path", storageAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", 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 ContainersClient) 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 ContainersClient) GetResponder(resp *http.Response) (result Container, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByStorageAccount sends the list by storage account request. +// Parameters: +// deviceName - the device name. +// storageAccountName - the storage Account name. +// resourceGroupName - the resource group name. +func (client ContainersClient) ListByStorageAccount(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (result ContainerListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.ListByStorageAccount") + defer func() { + sc := -1 + if result.cl.Response.Response != nil { + sc = result.cl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByStorageAccountNextResults + req, err := client.ListByStorageAccountPreparer(ctx, deviceName, storageAccountName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "ListByStorageAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByStorageAccountSender(req) + if err != nil { + result.cl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "ListByStorageAccount", resp, "Failure sending request") + return + } + + result.cl, err = client.ListByStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "ListByStorageAccount", resp, "Failure responding to request") + } + + return +} + +// ListByStorageAccountPreparer prepares the ListByStorageAccount request. +func (client ContainersClient) ListByStorageAccountPreparer(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageAccountName": autorest.Encode("path", storageAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByStorageAccountSender sends the ListByStorageAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ContainersClient) ListByStorageAccountSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByStorageAccountResponder handles the response to the ListByStorageAccount request. The method always +// closes the http.Response Body. +func (client ContainersClient) ListByStorageAccountResponder(resp *http.Response) (result ContainerList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByStorageAccountNextResults retrieves the next set of results, if any. +func (client ContainersClient) listByStorageAccountNextResults(ctx context.Context, lastResults ContainerList) (result ContainerList, err error) { + req, err := lastResults.containerListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "listByStorageAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByStorageAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "listByStorageAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByStorageAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "listByStorageAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByStorageAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainersClient) ListByStorageAccountComplete(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (result ContainerListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.ListByStorageAccount") + 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.ListByStorageAccount(ctx, deviceName, storageAccountName, resourceGroupName) + return +} + +// Refresh sends the refresh request. +// Parameters: +// deviceName - the device name. +// storageAccountName - the Storage Account Name +// containerName - the container name. +// resourceGroupName - the resource group name. +func (client ContainersClient) Refresh(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (result ContainersRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.Refresh") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx, deviceName, storageAccountName, containerName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client ContainersClient) RefreshPreparer(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerName": autorest.Encode("path", containerName), + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageAccountName": autorest.Encode("path", storageAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client ContainersClient) RefreshSender(req *http.Request) (future ContainersRefreshFuture, 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 +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client ContainersClient) RefreshResponder(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 +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/databoxedgeapi/interfaces.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/databoxedgeapi/interfaces.go new file mode 100644 index 000000000000..bc07b99271ff --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/databoxedgeapi/interfaces.go @@ -0,0 +1,178 @@ +package databoxedgeapi + +// 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/databoxedge/mgmt/2019-08-01/databoxedge" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result databoxedge.OperationsListPage, err error) +} + +var _ OperationsClientAPI = (*databoxedge.OperationsClient)(nil) + +// DevicesClientAPI contains the set of methods on the DevicesClient type. +type DevicesClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, dataBoxEdgeDevice databoxedge.Device, resourceGroupName string) (result databoxedge.DevicesCreateOrUpdateFuture, err error) + CreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, securitySettings databoxedge.SecuritySettings, resourceGroupName string) (result databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture, err error) + Delete(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesDeleteFuture, err error) + DownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesDownloadUpdatesFuture, err error) + Get(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.Device, err error) + GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DeviceExtendedInfo, err error) + GetNetworkSettings(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.NetworkSettings, err error) + GetUpdateSummary(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.UpdateSummary, err error) + InstallUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesInstallUpdatesFuture, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string) (result databoxedge.DeviceListPage, err error) + ListBySubscription(ctx context.Context, expand string) (result databoxedge.DeviceListPage, err error) + ScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.DevicesScanForUpdatesFuture, err error) + Update(ctx context.Context, deviceName string, parameters databoxedge.DevicePatch, resourceGroupName string) (result databoxedge.Device, err error) + UploadCertificate(ctx context.Context, deviceName string, parameters databoxedge.UploadCertificateRequest, resourceGroupName string) (result databoxedge.UploadCertificateResponse, err error) +} + +var _ DevicesClientAPI = (*databoxedge.DevicesClient)(nil) + +// AlertsClientAPI contains the set of methods on the AlertsClient type. +type AlertsClientAPI interface { + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Alert, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.AlertListPage, err error) +} + +var _ AlertsClientAPI = (*databoxedge.AlertsClient)(nil) + +// BandwidthSchedulesClientAPI contains the set of methods on the BandwidthSchedulesClient type. +type BandwidthSchedulesClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, parameters databoxedge.BandwidthSchedule, resourceGroupName string) (result databoxedge.BandwidthSchedulesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.BandwidthSchedulesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.BandwidthSchedule, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.BandwidthSchedulesListPage, err error) +} + +var _ BandwidthSchedulesClientAPI = (*databoxedge.BandwidthSchedulesClient)(nil) + +// JobsClientAPI contains the set of methods on the JobsClient type. +type JobsClientAPI interface { + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Job, err error) +} + +var _ JobsClientAPI = (*databoxedge.JobsClient)(nil) + +// NodesClientAPI contains the set of methods on the NodesClient type. +type NodesClientAPI interface { + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.NodeList, err error) +} + +var _ NodesClientAPI = (*databoxedge.NodesClient)(nil) + +// OperationsStatusClientAPI contains the set of methods on the OperationsStatusClient type. +type OperationsStatusClientAPI interface { + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Job, err error) +} + +var _ OperationsStatusClientAPI = (*databoxedge.OperationsStatusClient)(nil) + +// OrdersClientAPI contains the set of methods on the OrdersClient type. +type OrdersClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, order databoxedge.Order, resourceGroupName string) (result databoxedge.OrdersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.OrdersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.Order, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.OrderListPage, err error) +} + +var _ OrdersClientAPI = (*databoxedge.OrdersClient)(nil) + +// RolesClientAPI contains the set of methods on the RolesClient type. +type RolesClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, role databoxedge.BasicRole, resourceGroupName string) (result databoxedge.RolesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.RolesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.RoleModel, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.RoleListPage, err error) +} + +var _ RolesClientAPI = (*databoxedge.RolesClient)(nil) + +// SharesClientAPI contains the set of methods on the SharesClient type. +type SharesClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, share databoxedge.Share, resourceGroupName string) (result databoxedge.SharesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.SharesDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.Share, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.ShareListPage, err error) + Refresh(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.SharesRefreshFuture, err error) +} + +var _ SharesClientAPI = (*databoxedge.SharesClient)(nil) + +// StorageAccountCredentialsClientAPI contains the set of methods on the StorageAccountCredentialsClient type. +type StorageAccountCredentialsClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, storageAccountCredential databoxedge.StorageAccountCredential, resourceGroupName string) (result databoxedge.StorageAccountCredentialsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.StorageAccountCredentialsDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.StorageAccountCredential, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.StorageAccountCredentialListPage, err error) +} + +var _ StorageAccountCredentialsClientAPI = (*databoxedge.StorageAccountCredentialsClient)(nil) + +// StorageAccountsClientAPI contains the set of methods on the StorageAccountsClient type. +type StorageAccountsClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, storageAccount databoxedge.StorageAccount, resourceGroupName string) (result databoxedge.StorageAccountsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (result databoxedge.StorageAccountsDeleteFuture, err error) + Get(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (result databoxedge.StorageAccount, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result databoxedge.StorageAccountListPage, err error) +} + +var _ StorageAccountsClientAPI = (*databoxedge.StorageAccountsClient)(nil) + +// ContainersClientAPI contains the set of methods on the ContainersClient type. +type ContainersClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, containerName string, containerParameter databoxedge.Container, resourceGroupName string) (result databoxedge.ContainersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (result databoxedge.ContainersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (result databoxedge.Container, err error) + ListByStorageAccount(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (result databoxedge.ContainerListPage, err error) + Refresh(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string) (result databoxedge.ContainersRefreshFuture, err error) +} + +var _ ContainersClientAPI = (*databoxedge.ContainersClient)(nil) + +// TriggersClientAPI contains the set of methods on the TriggersClient type. +type TriggersClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, trigger databoxedge.BasicTrigger, resourceGroupName string) (result databoxedge.TriggersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.TriggersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.TriggerModel, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string, filter string) (result databoxedge.TriggerListPage, err error) +} + +var _ TriggersClientAPI = (*databoxedge.TriggersClient)(nil) + +// UsersClientAPI contains the set of methods on the UsersClient type. +type UsersClientAPI interface { + CreateOrUpdate(ctx context.Context, deviceName string, name string, userParameter databoxedge.User, resourceGroupName string) (result databoxedge.UsersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.UsersDeleteFuture, err error) + Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result databoxedge.User, err error) + ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string, filter string) (result databoxedge.UserListPage, err error) +} + +var _ UsersClientAPI = (*databoxedge.UsersClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + List(ctx context.Context, filter string) (result databoxedge.SkuInformationList, err error) +} + +var _ SkusClientAPI = (*databoxedge.SkusClient)(nil) diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/devices.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/devices.go new file mode 100644 index 000000000000..bb9bb9f5c3a5 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/devices.go @@ -0,0 +1,1229 @@ +package databoxedge + +// 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" +) + +// DevicesClient is the client for the Devices methods of the Databoxedge service. +type DevicesClient struct { + BaseClient +} + +// NewDevicesClient creates an instance of the DevicesClient client. +func NewDevicesClient(subscriptionID string) DevicesClient { + return NewDevicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDevicesClientWithBaseURI creates an instance of the DevicesClient client. +func NewDevicesClientWithBaseURI(baseURI string, subscriptionID string) DevicesClient { + return DevicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a Data Box Edge/Data Box Gateway resource. +// Parameters: +// deviceName - the device name. +// dataBoxEdgeDevice - the resource object. +// resourceGroupName - the resource group name. +func (client DevicesClient) CreateOrUpdate(ctx context.Context, deviceName string, dataBoxEdgeDevice Device, resourceGroupName string) (result DevicesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: dataBoxEdgeDevice, + Constraints: []validation.Constraint{{Target: "dataBoxEdgeDevice.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databoxedge.DevicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, dataBoxEdgeDevice, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DevicesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, dataBoxEdgeDevice Device, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", pathParameters), + autorest.WithJSON(dataBoxEdgeDevice), + 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 DevicesClient) CreateOrUpdateSender(req *http.Request) (future DevicesCreateOrUpdateFuture, 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 DevicesClient) CreateOrUpdateResponder(resp *http.Response) (result Device, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateSecuritySettings updates the security settings on a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// securitySettings - the security settings. +// resourceGroupName - the resource group name. +func (client DevicesClient) CreateOrUpdateSecuritySettings(ctx context.Context, deviceName string, securitySettings SecuritySettings, resourceGroupName string) (result DevicesCreateOrUpdateSecuritySettingsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.CreateOrUpdateSecuritySettings") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: securitySettings, + Constraints: []validation.Constraint{{Target: "securitySettings.SecuritySettingsProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "securitySettings.SecuritySettingsProperties.DeviceAdminPassword", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "securitySettings.SecuritySettingsProperties.DeviceAdminPassword.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", err.Error()) + } + + req, err := client.CreateOrUpdateSecuritySettingsPreparer(ctx, deviceName, securitySettings, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSecuritySettingsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "CreateOrUpdateSecuritySettings", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateSecuritySettingsPreparer prepares the CreateOrUpdateSecuritySettings request. +func (client DevicesClient) CreateOrUpdateSecuritySettingsPreparer(ctx context.Context, deviceName string, securitySettings SecuritySettings, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update", pathParameters), + autorest.WithJSON(securitySettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSecuritySettingsSender sends the CreateOrUpdateSecuritySettings request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) CreateOrUpdateSecuritySettingsSender(req *http.Request) (future DevicesCreateOrUpdateSecuritySettingsFuture, 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 +} + +// CreateOrUpdateSecuritySettingsResponder handles the response to the CreateOrUpdateSecuritySettings request. The method always +// closes the http.Response Body. +func (client DevicesClient) CreateOrUpdateSecuritySettingsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete deletes the Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) Delete(ctx context.Context, deviceName string, resourceGroupName string) (result DevicesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DevicesClient) DeletePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", 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 DevicesClient) DeleteSender(req *http.Request) (future DevicesDeleteFuture, 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 DevicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DownloadUpdates sends the download updates request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) DownloadUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result DevicesDownloadUpdatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.DownloadUpdates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DownloadUpdatesPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "DownloadUpdates", nil, "Failure preparing request") + return + } + + result, err = client.DownloadUpdatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "DownloadUpdates", result.Response(), "Failure sending request") + return + } + + return +} + +// DownloadUpdatesPreparer prepares the DownloadUpdates request. +func (client DevicesClient) DownloadUpdatesPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DownloadUpdatesSender sends the DownloadUpdates request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) DownloadUpdatesSender(req *http.Request) (future DevicesDownloadUpdatesFuture, 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 +} + +// DownloadUpdatesResponder handles the response to the DownloadUpdates request. The method always +// closes the http.Response Body. +func (client DevicesClient) DownloadUpdatesResponder(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 the properties of the Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) Get(ctx context.Context, deviceName string, resourceGroupName string) (result Device, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DevicesClient) GetPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", 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 DevicesClient) 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 DevicesClient) GetResponder(resp *http.Response) (result Device, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetExtendedInformation gets additional information for the specified Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) GetExtendedInformation(ctx context.Context, deviceName string, resourceGroupName string) (result DeviceExtendedInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.GetExtendedInformation") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetExtendedInformationPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", nil, "Failure preparing request") + return + } + + resp, err := client.GetExtendedInformationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", resp, "Failure sending request") + return + } + + result, err = client.GetExtendedInformationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetExtendedInformation", resp, "Failure responding to request") + } + + return +} + +// GetExtendedInformationPreparer prepares the GetExtendedInformation request. +func (client DevicesClient) GetExtendedInformationPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetExtendedInformationSender sends the GetExtendedInformation request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) GetExtendedInformationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetExtendedInformationResponder handles the response to the GetExtendedInformation request. The method always +// closes the http.Response Body. +func (client DevicesClient) GetExtendedInformationResponder(resp *http.Response) (result DeviceExtendedInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkSettings gets the network settings of the specified Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) GetNetworkSettings(ctx context.Context, deviceName string, resourceGroupName string) (result NetworkSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.GetNetworkSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetNetworkSettingsPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetNetworkSettings", resp, "Failure responding to request") + } + + return +} + +// GetNetworkSettingsPreparer prepares the GetNetworkSettings request. +func (client DevicesClient) GetNetworkSettingsPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkSettingsSender sends the GetNetworkSettings request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) GetNetworkSettingsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetNetworkSettingsResponder handles the response to the GetNetworkSettings request. The method always +// closes the http.Response Body. +func (client DevicesClient) GetNetworkSettingsResponder(resp *http.Response) (result NetworkSettings, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpdateSummary sends the get update summary request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) GetUpdateSummary(ctx context.Context, deviceName string, resourceGroupName string) (result UpdateSummary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.GetUpdateSummary") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetUpdateSummaryPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpdateSummarySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", resp, "Failure sending request") + return + } + + result, err = client.GetUpdateSummaryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "GetUpdateSummary", resp, "Failure responding to request") + } + + return +} + +// GetUpdateSummaryPreparer prepares the GetUpdateSummary request. +func (client DevicesClient) GetUpdateSummaryPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpdateSummarySender sends the GetUpdateSummary request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) GetUpdateSummarySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetUpdateSummaryResponder handles the response to the GetUpdateSummary request. The method always +// closes the http.Response Body. +func (client DevicesClient) GetUpdateSummaryResponder(resp *http.Response) (result UpdateSummary, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// InstallUpdates sends the install updates request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) InstallUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result DevicesInstallUpdatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.InstallUpdates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.InstallUpdatesPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "InstallUpdates", nil, "Failure preparing request") + return + } + + result, err = client.InstallUpdatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "InstallUpdates", result.Response(), "Failure sending request") + return + } + + return +} + +// InstallUpdatesPreparer prepares the InstallUpdates request. +func (client DevicesClient) InstallUpdatesPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InstallUpdatesSender sends the InstallUpdates request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) InstallUpdatesSender(req *http.Request) (future DevicesInstallUpdatesFuture, 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 +} + +// InstallUpdatesResponder handles the response to the InstallUpdates request. The method always +// closes the http.Response Body. +func (client DevicesClient) InstallUpdatesResponder(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 +} + +// ListByResourceGroup gets all the Data Box Edge/Data Box Gateway devices in a resource group. +// Parameters: +// resourceGroupName - the resource group name. +// expand - specify $expand=details to populate additional fields related to the resource or Specify +// $skipToken= to populate the next page in the list. +func (client DevicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string) (result DeviceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.dl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DevicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", 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 DevicesClient) 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 DevicesClient) ListByResourceGroupResponder(resp *http.Response) (result DeviceList, 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 DevicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { + req, err := lastResults.deviceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "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, "databoxedge.DevicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DevicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand string) (result DeviceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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, expand) + return +} + +// ListBySubscription gets all the Data Box Edge/Data Box Gateway devices in a subscription. +// Parameters: +// expand - specify $expand=details to populate additional fields related to the resource or Specify +// $skipToken= to populate the next page in the list. +func (client DevicesClient) ListBySubscription(ctx context.Context, expand string) (result DeviceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ListBySubscription") + defer func() { + sc := -1 + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.dl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client DevicesClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", 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 DevicesClient) 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 DevicesClient) ListBySubscriptionResponder(resp *http.Response) (result DeviceList, 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 DevicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { + req, err := lastResults.deviceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "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, "databoxedge.DevicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client DevicesClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result DeviceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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, expand) + return +} + +// ScanForUpdates sends the scan for updates request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client DevicesClient) ScanForUpdates(ctx context.Context, deviceName string, resourceGroupName string) (result DevicesScanForUpdatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.ScanForUpdates") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ScanForUpdatesPreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ScanForUpdates", nil, "Failure preparing request") + return + } + + result, err = client.ScanForUpdatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "ScanForUpdates", result.Response(), "Failure sending request") + return + } + + return +} + +// ScanForUpdatesPreparer prepares the ScanForUpdates request. +func (client DevicesClient) ScanForUpdatesPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ScanForUpdatesSender sends the ScanForUpdates request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) ScanForUpdatesSender(req *http.Request) (future DevicesScanForUpdatesFuture, 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 +} + +// ScanForUpdatesResponder handles the response to the ScanForUpdates request. The method always +// closes the http.Response Body. +func (client DevicesClient) ScanForUpdatesResponder(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 +} + +// Update modifies a Data Box Edge/Data Box Gateway resource. +// Parameters: +// deviceName - the device name. +// parameters - the resource parameters. +// resourceGroupName - the resource group name. +func (client DevicesClient) Update(ctx context.Context, deviceName string, parameters DevicePatch, resourceGroupName string) (result Device, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.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, deviceName, parameters, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DevicesClient) UpdatePreparer(ctx context.Context, deviceName string, parameters DevicePatch, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", 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 DevicesClient) 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 DevicesClient) UpdateResponder(resp *http.Response) (result Device, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UploadCertificate uploads registration certificate for the device. +// Parameters: +// deviceName - the device name. +// parameters - the upload certificate request. +// resourceGroupName - the resource group name. +func (client DevicesClient) UploadCertificate(ctx context.Context, deviceName string, parameters UploadCertificateRequest, resourceGroupName string) (result UploadCertificateResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesClient.UploadCertificate") + 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.RawCertificateData", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.RawCertificateData.Certificate", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("databoxedge.DevicesClient", "UploadCertificate", err.Error()) + } + + req, err := client.UploadCertificatePreparer(ctx, deviceName, parameters, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.UploadCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", resp, "Failure sending request") + return + } + + result, err = client.UploadCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesClient", "UploadCertificate", resp, "Failure responding to request") + } + + return +} + +// UploadCertificatePreparer prepares the UploadCertificate request. +func (client DevicesClient) UploadCertificatePreparer(ctx context.Context, deviceName string, parameters UploadCertificateRequest, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UploadCertificateSender sends the UploadCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesClient) UploadCertificateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// UploadCertificateResponder handles the response to the UploadCertificate request. The method always +// closes the http.Response Body. +func (client DevicesClient) UploadCertificateResponder(resp *http.Response) (result UploadCertificateResponse, 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/databoxedge/mgmt/2019-08-01/databoxedge/jobs.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/jobs.go new file mode 100644 index 000000000000..17c9baaf5437 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/jobs.go @@ -0,0 +1,120 @@ +package databoxedge + +// 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" +) + +// JobsClient is the client for the Jobs methods of the Databoxedge service. +type JobsClient struct { + BaseClient +} + +// NewJobsClient creates an instance of the JobsClient client. +func NewJobsClient(subscriptionID string) JobsClient { + return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobsClientWithBaseURI creates an instance of the JobsClient client. +func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { + return JobsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// name - the job name. +// resourceGroupName - the resource group name. +func (client JobsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobsClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.JobsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobsClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}", 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 JobsClient) 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 JobsClient) GetResponder(resp *http.Response) (result Job, 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/databoxedge/mgmt/2019-08-01/databoxedge/models.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/models.go new file mode 100644 index 000000000000..0398b30539c4 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/models.go @@ -0,0 +1,5978 @@ +package databoxedge + +// 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/databoxedge/mgmt/2019-08-01/databoxedge" + +// AccountType enumerates the values for account type. +type AccountType string + +const ( + // BlobStorage ... + BlobStorage AccountType = "BlobStorage" + // GeneralPurposeStorage ... + GeneralPurposeStorage AccountType = "GeneralPurposeStorage" +) + +// PossibleAccountTypeValues returns an array of possible values for the AccountType const type. +func PossibleAccountTypeValues() []AccountType { + return []AccountType{BlobStorage, GeneralPurposeStorage} +} + +// AlertSeverity enumerates the values for alert severity. +type AlertSeverity string + +const ( + // Critical ... + Critical AlertSeverity = "Critical" + // Informational ... + Informational AlertSeverity = "Informational" + // Warning ... + Warning AlertSeverity = "Warning" +) + +// PossibleAlertSeverityValues returns an array of possible values for the AlertSeverity const type. +func PossibleAlertSeverityValues() []AlertSeverity { + return []AlertSeverity{Critical, Informational, Warning} +} + +// AuthenticationType enumerates the values for authentication type. +type AuthenticationType string + +const ( + // AzureActiveDirectory ... + AzureActiveDirectory AuthenticationType = "AzureActiveDirectory" + // Invalid ... + Invalid AuthenticationType = "Invalid" +) + +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() []AuthenticationType { + return []AuthenticationType{AzureActiveDirectory, Invalid} +} + +// AzureContainerDataFormat enumerates the values for azure container data format. +type AzureContainerDataFormat string + +const ( + // AzureFile ... + AzureFile AzureContainerDataFormat = "AzureFile" + // BlockBlob ... + BlockBlob AzureContainerDataFormat = "BlockBlob" + // PageBlob ... + PageBlob AzureContainerDataFormat = "PageBlob" +) + +// PossibleAzureContainerDataFormatValues returns an array of possible values for the AzureContainerDataFormat const type. +func PossibleAzureContainerDataFormatValues() []AzureContainerDataFormat { + return []AzureContainerDataFormat{AzureFile, BlockBlob, PageBlob} +} + +// ClientPermissionType enumerates the values for client permission type. +type ClientPermissionType string + +const ( + // NoAccess ... + NoAccess ClientPermissionType = "NoAccess" + // ReadOnly ... + ReadOnly ClientPermissionType = "ReadOnly" + // ReadWrite ... + ReadWrite ClientPermissionType = "ReadWrite" +) + +// PossibleClientPermissionTypeValues returns an array of possible values for the ClientPermissionType const type. +func PossibleClientPermissionTypeValues() []ClientPermissionType { + return []ClientPermissionType{NoAccess, ReadOnly, ReadWrite} +} + +// ContainerStatus enumerates the values for container status. +type ContainerStatus string + +const ( + // NeedsAttention ... + NeedsAttention ContainerStatus = "NeedsAttention" + // Offline ... + Offline ContainerStatus = "Offline" + // OK ... + OK ContainerStatus = "OK" + // Unknown ... + Unknown ContainerStatus = "Unknown" + // Updating ... + Updating ContainerStatus = "Updating" +) + +// PossibleContainerStatusValues returns an array of possible values for the ContainerStatus const type. +func PossibleContainerStatusValues() []ContainerStatus { + return []ContainerStatus{NeedsAttention, Offline, OK, Unknown, Updating} +} + +// DataPolicy enumerates the values for data policy. +type DataPolicy string + +const ( + // Cloud ... + Cloud DataPolicy = "Cloud" + // Local ... + Local DataPolicy = "Local" +) + +// PossibleDataPolicyValues returns an array of possible values for the DataPolicy const type. +func PossibleDataPolicyValues() []DataPolicy { + return []DataPolicy{Cloud, Local} +} + +// DayOfWeek enumerates the values for day of week. +type DayOfWeek string + +const ( + // Friday ... + Friday DayOfWeek = "Friday" + // Monday ... + Monday DayOfWeek = "Monday" + // Saturday ... + Saturday DayOfWeek = "Saturday" + // Sunday ... + Sunday DayOfWeek = "Sunday" + // Thursday ... + Thursday DayOfWeek = "Thursday" + // Tuesday ... + Tuesday DayOfWeek = "Tuesday" + // Wednesday ... + Wednesday DayOfWeek = "Wednesday" +) + +// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday} +} + +// DeviceStatus enumerates the values for device status. +type DeviceStatus string + +const ( + // DeviceStatusDisconnected ... + DeviceStatusDisconnected DeviceStatus = "Disconnected" + // DeviceStatusMaintenance ... + DeviceStatusMaintenance DeviceStatus = "Maintenance" + // DeviceStatusNeedsAttention ... + DeviceStatusNeedsAttention DeviceStatus = "NeedsAttention" + // DeviceStatusOffline ... + DeviceStatusOffline DeviceStatus = "Offline" + // DeviceStatusOnline ... + DeviceStatusOnline DeviceStatus = "Online" + // DeviceStatusPartiallyDisconnected ... + DeviceStatusPartiallyDisconnected DeviceStatus = "PartiallyDisconnected" + // DeviceStatusReadyToSetup ... + DeviceStatusReadyToSetup DeviceStatus = "ReadyToSetup" +) + +// PossibleDeviceStatusValues returns an array of possible values for the DeviceStatus const type. +func PossibleDeviceStatusValues() []DeviceStatus { + return []DeviceStatus{DeviceStatusDisconnected, DeviceStatusMaintenance, DeviceStatusNeedsAttention, DeviceStatusOffline, DeviceStatusOnline, DeviceStatusPartiallyDisconnected, DeviceStatusReadyToSetup} +} + +// DeviceType enumerates the values for device type. +type DeviceType string + +const ( + // DataBoxEdgeDevice ... + DataBoxEdgeDevice DeviceType = "DataBoxEdgeDevice" +) + +// PossibleDeviceTypeValues returns an array of possible values for the DeviceType const type. +func PossibleDeviceTypeValues() []DeviceType { + return []DeviceType{DataBoxEdgeDevice} +} + +// DownloadPhase enumerates the values for download phase. +type DownloadPhase string + +const ( + // DownloadPhaseDownloading ... + DownloadPhaseDownloading DownloadPhase = "Downloading" + // DownloadPhaseInitializing ... + DownloadPhaseInitializing DownloadPhase = "Initializing" + // DownloadPhaseUnknown ... + DownloadPhaseUnknown DownloadPhase = "Unknown" + // DownloadPhaseVerifying ... + DownloadPhaseVerifying DownloadPhase = "Verifying" +) + +// PossibleDownloadPhaseValues returns an array of possible values for the DownloadPhase const type. +func PossibleDownloadPhaseValues() []DownloadPhase { + return []DownloadPhase{DownloadPhaseDownloading, DownloadPhaseInitializing, DownloadPhaseUnknown, DownloadPhaseVerifying} +} + +// EncryptionAlgorithm enumerates the values for encryption algorithm. +type EncryptionAlgorithm string + +const ( + // AES256 ... + AES256 EncryptionAlgorithm = "AES256" + // None ... + None EncryptionAlgorithm = "None" + // RSAESPKCS1V15 ... + RSAESPKCS1V15 EncryptionAlgorithm = "RSAES_PKCS1_v_1_5" +) + +// PossibleEncryptionAlgorithmValues returns an array of possible values for the EncryptionAlgorithm const type. +func PossibleEncryptionAlgorithmValues() []EncryptionAlgorithm { + return []EncryptionAlgorithm{AES256, None, RSAESPKCS1V15} +} + +// InstallRebootBehavior enumerates the values for install reboot behavior. +type InstallRebootBehavior string + +const ( + // NeverReboots ... + NeverReboots InstallRebootBehavior = "NeverReboots" + // RequestReboot ... + RequestReboot InstallRebootBehavior = "RequestReboot" + // RequiresReboot ... + RequiresReboot InstallRebootBehavior = "RequiresReboot" +) + +// PossibleInstallRebootBehaviorValues returns an array of possible values for the InstallRebootBehavior const type. +func PossibleInstallRebootBehaviorValues() []InstallRebootBehavior { + return []InstallRebootBehavior{NeverReboots, RequestReboot, RequiresReboot} +} + +// JobStatus enumerates the values for job status. +type JobStatus string + +const ( + // JobStatusCanceled ... + JobStatusCanceled JobStatus = "Canceled" + // JobStatusFailed ... + JobStatusFailed JobStatus = "Failed" + // JobStatusInvalid ... + JobStatusInvalid JobStatus = "Invalid" + // JobStatusPaused ... + JobStatusPaused JobStatus = "Paused" + // JobStatusRunning ... + JobStatusRunning JobStatus = "Running" + // JobStatusScheduled ... + JobStatusScheduled JobStatus = "Scheduled" + // JobStatusSucceeded ... + JobStatusSucceeded JobStatus = "Succeeded" +) + +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusCanceled, JobStatusFailed, JobStatusInvalid, JobStatusPaused, JobStatusRunning, JobStatusScheduled, JobStatusSucceeded} +} + +// JobType enumerates the values for job type. +type JobType string + +const ( + // JobTypeDownloadUpdates ... + JobTypeDownloadUpdates JobType = "DownloadUpdates" + // JobTypeInstallUpdates ... + JobTypeInstallUpdates JobType = "InstallUpdates" + // JobTypeInvalid ... + JobTypeInvalid JobType = "Invalid" + // JobTypeRefreshContainer ... + JobTypeRefreshContainer JobType = "RefreshContainer" + // JobTypeRefreshShare ... + JobTypeRefreshShare JobType = "RefreshShare" + // JobTypeScanForUpdates ... + JobTypeScanForUpdates JobType = "ScanForUpdates" +) + +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{JobTypeDownloadUpdates, JobTypeInstallUpdates, JobTypeInvalid, JobTypeRefreshContainer, JobTypeRefreshShare, JobTypeScanForUpdates} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindIOT ... + KindIOT Kind = "IOT" + // KindRole ... + KindRole Kind = "Role" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindIOT, KindRole} +} + +// KindBasicTrigger enumerates the values for kind basic trigger. +type KindBasicTrigger string + +const ( + // KindFileEvent ... + KindFileEvent KindBasicTrigger = "FileEvent" + // KindPeriodicTimerEvent ... + KindPeriodicTimerEvent KindBasicTrigger = "PeriodicTimerEvent" + // KindTrigger ... + KindTrigger KindBasicTrigger = "Trigger" +) + +// PossibleKindBasicTriggerValues returns an array of possible values for the KindBasicTrigger const type. +func PossibleKindBasicTriggerValues() []KindBasicTrigger { + return []KindBasicTrigger{KindFileEvent, KindPeriodicTimerEvent, KindTrigger} +} + +// MetricAggregationType enumerates the values for metric aggregation type. +type MetricAggregationType string + +const ( + // MetricAggregationTypeAverage ... + MetricAggregationTypeAverage MetricAggregationType = "Average" + // MetricAggregationTypeCount ... + MetricAggregationTypeCount MetricAggregationType = "Count" + // MetricAggregationTypeMaximum ... + MetricAggregationTypeMaximum MetricAggregationType = "Maximum" + // MetricAggregationTypeMinimum ... + MetricAggregationTypeMinimum MetricAggregationType = "Minimum" + // MetricAggregationTypeNone ... + MetricAggregationTypeNone MetricAggregationType = "None" + // MetricAggregationTypeNotSpecified ... + MetricAggregationTypeNotSpecified MetricAggregationType = "NotSpecified" + // MetricAggregationTypeTotal ... + MetricAggregationTypeTotal MetricAggregationType = "Total" +) + +// PossibleMetricAggregationTypeValues returns an array of possible values for the MetricAggregationType const type. +func PossibleMetricAggregationTypeValues() []MetricAggregationType { + return []MetricAggregationType{MetricAggregationTypeAverage, MetricAggregationTypeCount, MetricAggregationTypeMaximum, MetricAggregationTypeMinimum, MetricAggregationTypeNone, MetricAggregationTypeNotSpecified, MetricAggregationTypeTotal} +} + +// MetricCategory enumerates the values for metric category. +type MetricCategory string + +const ( + // Capacity ... + Capacity MetricCategory = "Capacity" + // Transaction ... + Transaction MetricCategory = "Transaction" +) + +// PossibleMetricCategoryValues returns an array of possible values for the MetricCategory const type. +func PossibleMetricCategoryValues() []MetricCategory { + return []MetricCategory{Capacity, Transaction} +} + +// MetricUnit enumerates the values for metric unit. +type MetricUnit string + +const ( + // Bytes ... + Bytes MetricUnit = "Bytes" + // BytesPerSecond ... + BytesPerSecond MetricUnit = "BytesPerSecond" + // Count ... + Count MetricUnit = "Count" + // CountPerSecond ... + CountPerSecond MetricUnit = "CountPerSecond" + // Milliseconds ... + Milliseconds MetricUnit = "Milliseconds" + // NotSpecified ... + NotSpecified MetricUnit = "NotSpecified" + // Percent ... + Percent MetricUnit = "Percent" + // Seconds ... + Seconds MetricUnit = "Seconds" +) + +// PossibleMetricUnitValues returns an array of possible values for the MetricUnit const type. +func PossibleMetricUnitValues() []MetricUnit { + return []MetricUnit{Bytes, BytesPerSecond, Count, CountPerSecond, Milliseconds, NotSpecified, Percent, Seconds} +} + +// MonitoringStatus enumerates the values for monitoring status. +type MonitoringStatus string + +const ( + // Disabled ... + Disabled MonitoringStatus = "Disabled" + // Enabled ... + Enabled MonitoringStatus = "Enabled" +) + +// PossibleMonitoringStatusValues returns an array of possible values for the MonitoringStatus const type. +func PossibleMonitoringStatusValues() []MonitoringStatus { + return []MonitoringStatus{Disabled, Enabled} +} + +// NetworkAdapterDHCPStatus enumerates the values for network adapter dhcp status. +type NetworkAdapterDHCPStatus string + +const ( + // NetworkAdapterDHCPStatusDisabled ... + NetworkAdapterDHCPStatusDisabled NetworkAdapterDHCPStatus = "Disabled" + // NetworkAdapterDHCPStatusEnabled ... + NetworkAdapterDHCPStatusEnabled NetworkAdapterDHCPStatus = "Enabled" +) + +// PossibleNetworkAdapterDHCPStatusValues returns an array of possible values for the NetworkAdapterDHCPStatus const type. +func PossibleNetworkAdapterDHCPStatusValues() []NetworkAdapterDHCPStatus { + return []NetworkAdapterDHCPStatus{NetworkAdapterDHCPStatusDisabled, NetworkAdapterDHCPStatusEnabled} +} + +// NetworkAdapterRDMAStatus enumerates the values for network adapter rdma status. +type NetworkAdapterRDMAStatus string + +const ( + // Capable ... + Capable NetworkAdapterRDMAStatus = "Capable" + // Incapable ... + Incapable NetworkAdapterRDMAStatus = "Incapable" +) + +// PossibleNetworkAdapterRDMAStatusValues returns an array of possible values for the NetworkAdapterRDMAStatus const type. +func PossibleNetworkAdapterRDMAStatusValues() []NetworkAdapterRDMAStatus { + return []NetworkAdapterRDMAStatus{Capable, Incapable} +} + +// NetworkAdapterStatus enumerates the values for network adapter status. +type NetworkAdapterStatus string + +const ( + // Active ... + Active NetworkAdapterStatus = "Active" + // Inactive ... + Inactive NetworkAdapterStatus = "Inactive" +) + +// PossibleNetworkAdapterStatusValues returns an array of possible values for the NetworkAdapterStatus const type. +func PossibleNetworkAdapterStatusValues() []NetworkAdapterStatus { + return []NetworkAdapterStatus{Active, Inactive} +} + +// NetworkGroup enumerates the values for network group. +type NetworkGroup string + +const ( + // NetworkGroupNone ... + NetworkGroupNone NetworkGroup = "None" + // NetworkGroupNonRDMA ... + NetworkGroupNonRDMA NetworkGroup = "NonRDMA" + // NetworkGroupRDMA ... + NetworkGroupRDMA NetworkGroup = "RDMA" +) + +// PossibleNetworkGroupValues returns an array of possible values for the NetworkGroup const type. +func PossibleNetworkGroupValues() []NetworkGroup { + return []NetworkGroup{NetworkGroupNone, NetworkGroupNonRDMA, NetworkGroupRDMA} +} + +// NodeStatus enumerates the values for node status. +type NodeStatus string + +const ( + // NodeStatusDown ... + NodeStatusDown NodeStatus = "Down" + // NodeStatusRebooting ... + NodeStatusRebooting NodeStatus = "Rebooting" + // NodeStatusShuttingDown ... + NodeStatusShuttingDown NodeStatus = "ShuttingDown" + // NodeStatusUnknown ... + NodeStatusUnknown NodeStatus = "Unknown" + // NodeStatusUp ... + NodeStatusUp NodeStatus = "Up" +) + +// PossibleNodeStatusValues returns an array of possible values for the NodeStatus const type. +func PossibleNodeStatusValues() []NodeStatus { + return []NodeStatus{NodeStatusDown, NodeStatusRebooting, NodeStatusShuttingDown, NodeStatusUnknown, NodeStatusUp} +} + +// OrderState enumerates the values for order state. +type OrderState string + +const ( + // Arriving ... + Arriving OrderState = "Arriving" + // AwaitingFulfilment ... + AwaitingFulfilment OrderState = "AwaitingFulfilment" + // AwaitingPreparation ... + AwaitingPreparation OrderState = "AwaitingPreparation" + // AwaitingReturnShipment ... + AwaitingReturnShipment OrderState = "AwaitingReturnShipment" + // AwaitingShipment ... + AwaitingShipment OrderState = "AwaitingShipment" + // CollectedAtMicrosoft ... + CollectedAtMicrosoft OrderState = "CollectedAtMicrosoft" + // Declined ... + Declined OrderState = "Declined" + // Delivered ... + Delivered OrderState = "Delivered" + // LostDevice ... + LostDevice OrderState = "LostDevice" + // ReplacementRequested ... + ReplacementRequested OrderState = "ReplacementRequested" + // ReturnInitiated ... + ReturnInitiated OrderState = "ReturnInitiated" + // Shipped ... + Shipped OrderState = "Shipped" + // ShippedBack ... + ShippedBack OrderState = "ShippedBack" + // Untracked ... + Untracked OrderState = "Untracked" +) + +// PossibleOrderStateValues returns an array of possible values for the OrderState const type. +func PossibleOrderStateValues() []OrderState { + return []OrderState{Arriving, AwaitingFulfilment, AwaitingPreparation, AwaitingReturnShipment, AwaitingShipment, CollectedAtMicrosoft, Declined, Delivered, LostDevice, ReplacementRequested, ReturnInitiated, Shipped, ShippedBack, Untracked} +} + +// PlatformType enumerates the values for platform type. +type PlatformType string + +const ( + // Linux ... + Linux PlatformType = "Linux" + // Windows ... + Windows PlatformType = "Windows" +) + +// PossiblePlatformTypeValues returns an array of possible values for the PlatformType const type. +func PossiblePlatformTypeValues() []PlatformType { + return []PlatformType{Linux, Windows} +} + +// RoleStatus enumerates the values for role status. +type RoleStatus string + +const ( + // RoleStatusDisabled ... + RoleStatusDisabled RoleStatus = "Disabled" + // RoleStatusEnabled ... + RoleStatusEnabled RoleStatus = "Enabled" +) + +// PossibleRoleStatusValues returns an array of possible values for the RoleStatus const type. +func PossibleRoleStatusValues() []RoleStatus { + return []RoleStatus{RoleStatusDisabled, RoleStatusEnabled} +} + +// RoleTypes enumerates the values for role types. +type RoleTypes string + +const ( + // ASA ... + ASA RoleTypes = "ASA" + // Cognitive ... + Cognitive RoleTypes = "Cognitive" + // Functions ... + Functions RoleTypes = "Functions" + // IOT ... + IOT RoleTypes = "IOT" +) + +// PossibleRoleTypesValues returns an array of possible values for the RoleTypes const type. +func PossibleRoleTypesValues() []RoleTypes { + return []RoleTypes{ASA, Cognitive, Functions, IOT} +} + +// ShareAccessProtocol enumerates the values for share access protocol. +type ShareAccessProtocol string + +const ( + // NFS ... + NFS ShareAccessProtocol = "NFS" + // SMB ... + SMB ShareAccessProtocol = "SMB" +) + +// PossibleShareAccessProtocolValues returns an array of possible values for the ShareAccessProtocol const type. +func PossibleShareAccessProtocolValues() []ShareAccessProtocol { + return []ShareAccessProtocol{NFS, SMB} +} + +// ShareAccessType enumerates the values for share access type. +type ShareAccessType string + +const ( + // Change ... + Change ShareAccessType = "Change" + // Custom ... + Custom ShareAccessType = "Custom" + // Read ... + Read ShareAccessType = "Read" +) + +// PossibleShareAccessTypeValues returns an array of possible values for the ShareAccessType const type. +func PossibleShareAccessTypeValues() []ShareAccessType { + return []ShareAccessType{Change, Custom, Read} +} + +// ShareStatus enumerates the values for share status. +type ShareStatus string + +const ( + // ShareStatusNeedsAttention ... + ShareStatusNeedsAttention ShareStatus = "NeedsAttention" + // ShareStatusOffline ... + ShareStatusOffline ShareStatus = "Offline" + // ShareStatusOK ... + ShareStatusOK ShareStatus = "OK" + // ShareStatusUnknown ... + ShareStatusUnknown ShareStatus = "Unknown" + // ShareStatusUpdating ... + ShareStatusUpdating ShareStatus = "Updating" +) + +// PossibleShareStatusValues returns an array of possible values for the ShareStatus const type. +func PossibleShareStatusValues() []ShareStatus { + return []ShareStatus{ShareStatusNeedsAttention, ShareStatusOffline, ShareStatusOK, ShareStatusUnknown, ShareStatusUpdating} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Edge ... + Edge SkuName = "Edge" + // Gateway ... + Gateway SkuName = "Gateway" + // TEA1Node ... + TEA1Node SkuName = "TEA_1Node" + // TEA1NodeHeater ... + TEA1NodeHeater SkuName = "TEA_1Node_Heater" + // TEA1NodeUPS ... + TEA1NodeUPS SkuName = "TEA_1Node_UPS" + // TEA1NodeUPSHeater ... + TEA1NodeUPSHeater SkuName = "TEA_1Node_UPS_Heater" + // TEA4NodeHeater ... + TEA4NodeHeater SkuName = "TEA_4Node_Heater" + // TEA4NodeUPSHeater ... + TEA4NodeUPSHeater SkuName = "TEA_4Node_UPS_Heater" + // TMA ... + TMA SkuName = "TMA" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Edge, Gateway, TEA1Node, TEA1NodeHeater, TEA1NodeUPS, TEA1NodeUPSHeater, TEA4NodeHeater, TEA4NodeUPSHeater, TMA} +} + +// SkuRestrictionReasonCode enumerates the values for sku restriction reason code. +type SkuRestrictionReasonCode string + +const ( + // NotAvailableForSubscription ... + NotAvailableForSubscription SkuRestrictionReasonCode = "NotAvailableForSubscription" + // QuotaID ... + QuotaID SkuRestrictionReasonCode = "QuotaId" +) + +// PossibleSkuRestrictionReasonCodeValues returns an array of possible values for the SkuRestrictionReasonCode const type. +func PossibleSkuRestrictionReasonCodeValues() []SkuRestrictionReasonCode { + return []SkuRestrictionReasonCode{NotAvailableForSubscription, QuotaID} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // Standard ... + Standard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Standard} +} + +// SSLStatus enumerates the values for ssl status. +type SSLStatus string + +const ( + // SSLStatusDisabled ... + SSLStatusDisabled SSLStatus = "Disabled" + // SSLStatusEnabled ... + SSLStatusEnabled SSLStatus = "Enabled" +) + +// PossibleSSLStatusValues returns an array of possible values for the SSLStatus const type. +func PossibleSSLStatusValues() []SSLStatus { + return []SSLStatus{SSLStatusDisabled, SSLStatusEnabled} +} + +// StorageAccountStatus enumerates the values for storage account status. +type StorageAccountStatus string + +const ( + // StorageAccountStatusNeedsAttention ... + StorageAccountStatusNeedsAttention StorageAccountStatus = "NeedsAttention" + // StorageAccountStatusOffline ... + StorageAccountStatusOffline StorageAccountStatus = "Offline" + // StorageAccountStatusOK ... + StorageAccountStatusOK StorageAccountStatus = "OK" + // StorageAccountStatusUnknown ... + StorageAccountStatusUnknown StorageAccountStatus = "Unknown" + // StorageAccountStatusUpdating ... + StorageAccountStatusUpdating StorageAccountStatus = "Updating" +) + +// PossibleStorageAccountStatusValues returns an array of possible values for the StorageAccountStatus const type. +func PossibleStorageAccountStatusValues() []StorageAccountStatus { + return []StorageAccountStatus{StorageAccountStatusNeedsAttention, StorageAccountStatusOffline, StorageAccountStatusOK, StorageAccountStatusUnknown, StorageAccountStatusUpdating} +} + +// TimeGrain enumerates the values for time grain. +type TimeGrain string + +const ( + // PT12H ... + PT12H TimeGrain = "PT12H" + // PT15M ... + PT15M TimeGrain = "PT15M" + // PT1D ... + PT1D TimeGrain = "PT1D" + // PT1H ... + PT1H TimeGrain = "PT1H" + // PT1M ... + PT1M TimeGrain = "PT1M" + // PT30M ... + PT30M TimeGrain = "PT30M" + // PT5M ... + PT5M TimeGrain = "PT5M" + // PT6H ... + PT6H TimeGrain = "PT6H" +) + +// PossibleTimeGrainValues returns an array of possible values for the TimeGrain const type. +func PossibleTimeGrainValues() []TimeGrain { + return []TimeGrain{PT12H, PT15M, PT1D, PT1H, PT1M, PT30M, PT5M, PT6H} +} + +// UpdateOperation enumerates the values for update operation. +type UpdateOperation string + +const ( + // UpdateOperationDownload ... + UpdateOperationDownload UpdateOperation = "Download" + // UpdateOperationInstall ... + UpdateOperationInstall UpdateOperation = "Install" + // UpdateOperationNone ... + UpdateOperationNone UpdateOperation = "None" + // UpdateOperationScan ... + UpdateOperationScan UpdateOperation = "Scan" +) + +// PossibleUpdateOperationValues returns an array of possible values for the UpdateOperation const type. +func PossibleUpdateOperationValues() []UpdateOperation { + return []UpdateOperation{UpdateOperationDownload, UpdateOperationInstall, UpdateOperationNone, UpdateOperationScan} +} + +// UpdateOperationStage enumerates the values for update operation stage. +type UpdateOperationStage string + +const ( + // UpdateOperationStageDownloadComplete ... + UpdateOperationStageDownloadComplete UpdateOperationStage = "DownloadComplete" + // UpdateOperationStageDownloadFailed ... + UpdateOperationStageDownloadFailed UpdateOperationStage = "DownloadFailed" + // UpdateOperationStageDownloadStarted ... + UpdateOperationStageDownloadStarted UpdateOperationStage = "DownloadStarted" + // UpdateOperationStageFailure ... + UpdateOperationStageFailure UpdateOperationStage = "Failure" + // UpdateOperationStageInitial ... + UpdateOperationStageInitial UpdateOperationStage = "Initial" + // UpdateOperationStageInstallComplete ... + UpdateOperationStageInstallComplete UpdateOperationStage = "InstallComplete" + // UpdateOperationStageInstallFailed ... + UpdateOperationStageInstallFailed UpdateOperationStage = "InstallFailed" + // UpdateOperationStageInstallStarted ... + UpdateOperationStageInstallStarted UpdateOperationStage = "InstallStarted" + // UpdateOperationStageRebootInitiated ... + UpdateOperationStageRebootInitiated UpdateOperationStage = "RebootInitiated" + // UpdateOperationStageRescanComplete ... + UpdateOperationStageRescanComplete UpdateOperationStage = "RescanComplete" + // UpdateOperationStageRescanFailed ... + UpdateOperationStageRescanFailed UpdateOperationStage = "RescanFailed" + // UpdateOperationStageRescanStarted ... + UpdateOperationStageRescanStarted UpdateOperationStage = "RescanStarted" + // UpdateOperationStageScanComplete ... + UpdateOperationStageScanComplete UpdateOperationStage = "ScanComplete" + // UpdateOperationStageScanFailed ... + UpdateOperationStageScanFailed UpdateOperationStage = "ScanFailed" + // UpdateOperationStageScanStarted ... + UpdateOperationStageScanStarted UpdateOperationStage = "ScanStarted" + // UpdateOperationStageSuccess ... + UpdateOperationStageSuccess UpdateOperationStage = "Success" + // UpdateOperationStageUnknown ... + UpdateOperationStageUnknown UpdateOperationStage = "Unknown" +) + +// PossibleUpdateOperationStageValues returns an array of possible values for the UpdateOperationStage const type. +func PossibleUpdateOperationStageValues() []UpdateOperationStage { + return []UpdateOperationStage{UpdateOperationStageDownloadComplete, UpdateOperationStageDownloadFailed, UpdateOperationStageDownloadStarted, UpdateOperationStageFailure, UpdateOperationStageInitial, UpdateOperationStageInstallComplete, UpdateOperationStageInstallFailed, UpdateOperationStageInstallStarted, UpdateOperationStageRebootInitiated, UpdateOperationStageRescanComplete, UpdateOperationStageRescanFailed, UpdateOperationStageRescanStarted, UpdateOperationStageScanComplete, UpdateOperationStageScanFailed, UpdateOperationStageScanStarted, UpdateOperationStageSuccess, UpdateOperationStageUnknown} +} + +// UserType enumerates the values for user type. +type UserType string + +const ( + // UserTypeARM ... + UserTypeARM UserType = "ARM" + // UserTypeLocalManagement ... + UserTypeLocalManagement UserType = "LocalManagement" + // UserTypeShare ... + UserTypeShare UserType = "Share" +) + +// PossibleUserTypeValues returns an array of possible values for the UserType const type. +func PossibleUserTypeValues() []UserType { + return []UserType{UserTypeARM, UserTypeLocalManagement, UserTypeShare} +} + +// Address the shipping address of the customer. +type Address struct { + // AddressLine1 - The address line1. + AddressLine1 *string `json:"addressLine1,omitempty"` + // AddressLine2 - The address line2. + AddressLine2 *string `json:"addressLine2,omitempty"` + // AddressLine3 - The address line3. + AddressLine3 *string `json:"addressLine3,omitempty"` + // PostalCode - The postal code. + PostalCode *string `json:"postalCode,omitempty"` + // City - The city name. + City *string `json:"city,omitempty"` + // State - The state name. + State *string `json:"state,omitempty"` + // Country - The country name. + Country *string `json:"country,omitempty"` +} + +// Alert alert on the data box edge/gateway device. +type Alert struct { + autorest.Response `json:"-"` + // AlertProperties - READ-ONLY; Properties of alert. + *AlertProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Alert. +func (a Alert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Alert struct. +func (a *Alert) 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 alertProperties AlertProperties + err = json.Unmarshal(*v, &alertProperties) + if err != nil { + return err + } + a.AlertProperties = &alertProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AlertErrorDetails error details for the alert. +type AlertErrorDetails struct { + // ErrorCode - READ-ONLY; Error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - READ-ONLY; Error Message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Occurrences - READ-ONLY; Number of occurrences. + Occurrences *int32 `json:"occurrences,omitempty"` +} + +// AlertList collection of alerts. +type AlertList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The value. + Value *[]Alert `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertListIterator provides access to a complete listing of Alert values. +type AlertListIterator struct { + i int + page AlertListPage +} + +// 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 *AlertListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertListIterator.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 *AlertListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertListIterator) 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 AlertListIterator) Response() AlertList { + 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 AlertListIterator) Value() Alert { + if !iter.page.NotDone() { + return Alert{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertListIterator type. +func NewAlertListIterator(page AlertListPage) AlertListIterator { + return AlertListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AlertList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// alertListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AlertList) alertListPreparer(ctx context.Context) (*http.Request, error) { + if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// AlertListPage contains a page of Alert values. +type AlertListPage struct { + fn func(context.Context, AlertList) (AlertList, error) + al AlertList +} + +// 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 *AlertListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertListPage.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.al) + if err != nil { + return err + } + page.al = 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 *AlertListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertListPage) Response() AlertList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertListPage) Values() []Alert { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AlertListPage type. +func NewAlertListPage(getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage { + return AlertListPage{fn: getNextPage} +} + +// AlertProperties properties of alert. +type AlertProperties struct { + // Title - READ-ONLY; Alert title. + Title *string `json:"title,omitempty"` + // AlertType - READ-ONLY; Alert type. + AlertType *string `json:"alertType,omitempty"` + // AppearedAtDateTime - READ-ONLY; UTC time when the alert appeared. + AppearedAtDateTime *date.Time `json:"appearedAtDateTime,omitempty"` + // Recommendation - READ-ONLY; Alert recommendation. + Recommendation *string `json:"recommendation,omitempty"` + // Severity - READ-ONLY; Severity of the alert. Possible values include: 'Informational', 'Warning', 'Critical' + Severity AlertSeverity `json:"severity,omitempty"` + // ErrorDetails - READ-ONLY; Error details of the alert. + ErrorDetails *AlertErrorDetails `json:"errorDetails,omitempty"` + // DetailedInformation - READ-ONLY; Alert details. + DetailedInformation map[string]*string `json:"detailedInformation"` +} + +// MarshalJSON is the custom marshaler for AlertProperties. +func (ap AlertProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ARMBaseModel represents the base class for all object models. +type ARMBaseModel struct { + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// AsymmetricEncryptedSecret represent the secrets intended for encryption with asymmetric key pair. +type AsymmetricEncryptedSecret struct { + // Value - The value of the secret. + Value *string `json:"value,omitempty"` + // EncryptionCertThumbprint - Thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + EncryptionCertThumbprint *string `json:"encryptionCertThumbprint,omitempty"` + // EncryptionAlgorithm - The algorithm used to encrypt "Value". Possible values include: 'None', 'AES256', 'RSAESPKCS1V15' + EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` +} + +// Authentication authentication mechanism for IoT devices. +type Authentication struct { + // SymmetricKey - Symmetric key for authentication. + SymmetricKey *SymmetricKey `json:"symmetricKey,omitempty"` +} + +// AzureContainerInfo azure container mapping of the endpoint. +type AzureContainerInfo struct { + // StorageAccountCredentialID - ID of the storage account credential used to access storage. + StorageAccountCredentialID *string `json:"storageAccountCredentialId,omitempty"` + // ContainerName - Container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + ContainerName *string `json:"containerName,omitempty"` + // DataFormat - Storage format used for the file represented by the share. Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile' + DataFormat AzureContainerDataFormat `json:"dataFormat,omitempty"` +} + +// BandwidthSchedule the bandwidth schedule details. +type BandwidthSchedule struct { + autorest.Response `json:"-"` + // BandwidthScheduleProperties - The properties of the bandwidth schedule. + *BandwidthScheduleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BandwidthSchedule. +func (bs BandwidthSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bs.BandwidthScheduleProperties != nil { + objectMap["properties"] = bs.BandwidthScheduleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BandwidthSchedule struct. +func (bs *BandwidthSchedule) 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 bandwidthScheduleProperties BandwidthScheduleProperties + err = json.Unmarshal(*v, &bandwidthScheduleProperties) + if err != nil { + return err + } + bs.BandwidthScheduleProperties = &bandwidthScheduleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bs.Type = &typeVar + } + } + } + + return nil +} + +// BandwidthScheduleProperties the properties of the bandwidth schedule. +type BandwidthScheduleProperties struct { + // Start - The start time of the schedule in UTC. + Start *string `json:"start,omitempty"` + // Stop - The stop time of the schedule in UTC. + Stop *string `json:"stop,omitempty"` + // RateInMbps - The bandwidth rate in Mbps. + RateInMbps *int32 `json:"rateInMbps,omitempty"` + // Days - The days of the week when this schedule is applicable. + Days *[]DayOfWeek `json:"days,omitempty"` +} + +// BandwidthSchedulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type BandwidthSchedulesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *BandwidthSchedulesCreateOrUpdateFuture) Result(client BandwidthSchedulesClient) (bs BandwidthSchedule, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.BandwidthSchedulesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if bs.Response.Response, err = future.GetResult(sender); err == nil && bs.Response.Response.StatusCode != http.StatusNoContent { + bs, err = client.CreateOrUpdateResponder(bs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request") + } + } + return +} + +// BandwidthSchedulesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type BandwidthSchedulesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *BandwidthSchedulesDeleteFuture) Result(client BandwidthSchedulesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.BandwidthSchedulesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.BandwidthSchedulesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// BandwidthSchedulesList the collection of bandwidth schedules. +type BandwidthSchedulesList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of bandwidth schedules. + Value *[]BandwidthSchedule `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// BandwidthSchedulesListIterator provides access to a complete listing of BandwidthSchedule values. +type BandwidthSchedulesListIterator struct { + i int + page BandwidthSchedulesListPage +} + +// 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 *BandwidthSchedulesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesListIterator.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 *BandwidthSchedulesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter BandwidthSchedulesListIterator) 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 BandwidthSchedulesListIterator) Response() BandwidthSchedulesList { + 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 BandwidthSchedulesListIterator) Value() BandwidthSchedule { + if !iter.page.NotDone() { + return BandwidthSchedule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the BandwidthSchedulesListIterator type. +func NewBandwidthSchedulesListIterator(page BandwidthSchedulesListPage) BandwidthSchedulesListIterator { + return BandwidthSchedulesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (bsl BandwidthSchedulesList) IsEmpty() bool { + return bsl.Value == nil || len(*bsl.Value) == 0 +} + +// bandwidthSchedulesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (bsl BandwidthSchedulesList) bandwidthSchedulesListPreparer(ctx context.Context) (*http.Request, error) { + if bsl.NextLink == nil || len(to.String(bsl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(bsl.NextLink))) +} + +// BandwidthSchedulesListPage contains a page of BandwidthSchedule values. +type BandwidthSchedulesListPage struct { + fn func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error) + bsl BandwidthSchedulesList +} + +// 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 *BandwidthSchedulesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BandwidthSchedulesListPage.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.bsl) + if err != nil { + return err + } + page.bsl = 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 *BandwidthSchedulesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page BandwidthSchedulesListPage) NotDone() bool { + return !page.bsl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page BandwidthSchedulesListPage) Response() BandwidthSchedulesList { + return page.bsl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page BandwidthSchedulesListPage) Values() []BandwidthSchedule { + if page.bsl.IsEmpty() { + return nil + } + return *page.bsl.Value +} + +// Creates a new instance of the BandwidthSchedulesListPage type. +func NewBandwidthSchedulesListPage(getNextPage func(context.Context, BandwidthSchedulesList) (BandwidthSchedulesList, error)) BandwidthSchedulesListPage { + return BandwidthSchedulesListPage{fn: getNextPage} +} + +// ClientAccessRight the mapping between a particular client IP and the type of access client has on the +// NFS share. +type ClientAccessRight struct { + // Client - IP of the client. + Client *string `json:"client,omitempty"` + // AccessPermission - Type of access to be allowed for the client. Possible values include: 'NoAccess', 'ReadOnly', 'ReadWrite' + AccessPermission ClientPermissionType `json:"accessPermission,omitempty"` +} + +// CloudError an error response from the service. +type CloudError struct { + // Error - The error details. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// ContactDetails contains all the contact details of the customer. +type ContactDetails struct { + // ContactPerson - The contact person name. + ContactPerson *string `json:"contactPerson,omitempty"` + // CompanyName - The name of the company. + CompanyName *string `json:"companyName,omitempty"` + // Phone - The phone number. + Phone *string `json:"phone,omitempty"` + // EmailList - The email list. + EmailList *[]string `json:"emailList,omitempty"` +} + +// Container represents a container on the Data Box Edge/Gateway device. +type Container struct { + autorest.Response `json:"-"` + // ContainerProperties - The container properties. + *ContainerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Container. +func (c Container) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ContainerProperties != nil { + objectMap["properties"] = c.ContainerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Container struct. +func (c *Container) 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 containerProperties ContainerProperties + err = json.Unmarshal(*v, &containerProperties) + if err != nil { + return err + } + c.ContainerProperties = &containerProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ContainerList collection of all the containers on the Data Box Edge/Gateway device. +type ContainerList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of containers. + Value *[]Container `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ContainerListIterator provides access to a complete listing of Container values. +type ContainerListIterator struct { + i int + page ContainerListPage +} + +// 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 *ContainerListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerListIterator.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 *ContainerListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ContainerListIterator) 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 ContainerListIterator) Response() ContainerList { + 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 ContainerListIterator) Value() Container { + if !iter.page.NotDone() { + return Container{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ContainerListIterator type. +func NewContainerListIterator(page ContainerListPage) ContainerListIterator { + return ContainerListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ContainerList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// containerListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ContainerList) containerListPreparer(ctx context.Context) (*http.Request, error) { + if cl.NextLink == nil || len(to.String(cl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ContainerListPage contains a page of Container values. +type ContainerListPage struct { + fn func(context.Context, ContainerList) (ContainerList, error) + cl ContainerList +} + +// 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 *ContainerListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerListPage.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.cl) + if err != nil { + return err + } + page.cl = 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 *ContainerListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ContainerListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ContainerListPage) Response() ContainerList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ContainerListPage) Values() []Container { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the ContainerListPage type. +func NewContainerListPage(getNextPage func(context.Context, ContainerList) (ContainerList, error)) ContainerListPage { + return ContainerListPage{fn: getNextPage} +} + +// ContainerProperties the container properties. +type ContainerProperties struct { + // ContainerStatus - READ-ONLY; Current status of the container. Possible values include: 'OK', 'Offline', 'Unknown', 'Updating', 'NeedsAttention' + ContainerStatus ContainerStatus `json:"containerStatus,omitempty"` + // DataFormat - DataFormat for Container. Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile' + DataFormat AzureContainerDataFormat `json:"dataFormat,omitempty"` + // RefreshDetails - READ-ONLY; Details of the refresh job on this container. + RefreshDetails *RefreshDetails `json:"refreshDetails,omitempty"` + // CreatedDateTime - READ-ONLY; The UTC time when container got created. + CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` +} + +// ContainersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainersCreateOrUpdateFuture) Result(client ContainersClient) (c Container, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.ContainersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { + c, err = client.CreateOrUpdateResponder(c.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") + } + } + return +} + +// ContainersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainersDeleteFuture) Result(client ContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.ContainersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ContainersRefreshFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainersRefreshFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainersRefreshFuture) Result(client ContainersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.ContainersRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.ContainersRefreshFuture") + return + } + ar.Response = future.Response() + return +} + +// Device the Data Box Edge/Gateway device. +type Device struct { + autorest.Response `json:"-"` + // Location - The location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. + Location *string `json:"location,omitempty"` + // Tags - The list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + Tags map[string]*string `json:"tags"` + // Sku - The SKU type. + Sku *Sku `json:"sku,omitempty"` + // Etag - The etag for the devices. + Etag *string `json:"etag,omitempty"` + // DeviceProperties - The properties of the Data Box Edge/Gateway device. + *DeviceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Device. +func (d Device) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.Location != nil { + objectMap["location"] = d.Location + } + if d.Tags != nil { + objectMap["tags"] = d.Tags + } + if d.Sku != nil { + objectMap["sku"] = d.Sku + } + if d.Etag != nil { + objectMap["etag"] = d.Etag + } + if d.DeviceProperties != nil { + objectMap["properties"] = d.DeviceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Device struct. +func (d *Device) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + d.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + d.Sku = &sku + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + d.Etag = &etag + } + case "properties": + if v != nil { + var deviceProperties DeviceProperties + err = json.Unmarshal(*v, &deviceProperties) + if err != nil { + return err + } + d.DeviceProperties = &deviceProperties + } + 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 +} + +// DeviceExtendedInfo the extended Info of the Data Box Edge/Gateway device. +type DeviceExtendedInfo struct { + autorest.Response `json:"-"` + // DeviceExtendedInfoProperties - The extended info properties. + *DeviceExtendedInfoProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeviceExtendedInfo. +func (dei DeviceExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dei.DeviceExtendedInfoProperties != nil { + objectMap["properties"] = dei.DeviceExtendedInfoProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeviceExtendedInfo struct. +func (dei *DeviceExtendedInfo) 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 deviceExtendedInfoProperties DeviceExtendedInfoProperties + err = json.Unmarshal(*v, &deviceExtendedInfoProperties) + if err != nil { + return err + } + dei.DeviceExtendedInfoProperties = &deviceExtendedInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dei.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dei.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dei.Type = &typeVar + } + } + } + + return nil +} + +// DeviceExtendedInfoProperties the properties of the Data Box Edge/Gateway device extended info. +type DeviceExtendedInfoProperties struct { + // EncryptionKeyThumbprint - The digital signature of encrypted certificate. + EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` + // EncryptionKey - The public part of the encryption certificate. Client uses this to encrypt any secret. + EncryptionKey *string `json:"encryptionKey,omitempty"` + // ResourceKey - READ-ONLY; The Resource ID of the Resource. + ResourceKey *string `json:"resourceKey,omitempty"` +} + +// DeviceList the collection of Data Box Edge/Gateway devices. +type DeviceList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of Data Box Edge/Gateway devices. + Value *[]Device `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DeviceListIterator provides access to a complete listing of Device values. +type DeviceListIterator struct { + i int + page DeviceListPage +} + +// 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 *DeviceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListIterator.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 *DeviceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeviceListIterator) 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 DeviceListIterator) Response() DeviceList { + 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 DeviceListIterator) Value() Device { + if !iter.page.NotDone() { + return Device{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DeviceListIterator type. +func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { + return DeviceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dl DeviceList) IsEmpty() bool { + return dl.Value == nil || len(*dl.Value) == 0 +} + +// deviceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dl DeviceList) deviceListPreparer(ctx context.Context) (*http.Request, error) { + if dl.NextLink == nil || len(to.String(dl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dl.NextLink))) +} + +// DeviceListPage contains a page of Device values. +type DeviceListPage struct { + fn func(context.Context, DeviceList) (DeviceList, error) + dl DeviceList +} + +// 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 *DeviceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListPage.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.dl) + if err != nil { + return err + } + page.dl = 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 *DeviceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeviceListPage) NotDone() bool { + return !page.dl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeviceListPage) Response() DeviceList { + return page.dl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeviceListPage) Values() []Device { + if page.dl.IsEmpty() { + return nil + } + return *page.dl.Value +} + +// Creates a new instance of the DeviceListPage type. +func NewDeviceListPage(getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage { + return DeviceListPage{fn: getNextPage} +} + +// DevicePatch the Data Box Edge/Gateway device patch. +type DevicePatch struct { + // Tags - The tags attached to the Data Box Edge/Gateway resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DevicePatch. +func (dp DevicePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.Tags != nil { + objectMap["tags"] = dp.Tags + } + return json.Marshal(objectMap) +} + +// DeviceProperties the properties of the Data Box Edge/Gateway device. +type DeviceProperties struct { + // DataBoxEdgeDeviceStatus - The status of the Data Box Edge/Gateway device. Possible values include: 'DeviceStatusReadyToSetup', 'DeviceStatusOnline', 'DeviceStatusOffline', 'DeviceStatusNeedsAttention', 'DeviceStatusDisconnected', 'DeviceStatusPartiallyDisconnected', 'DeviceStatusMaintenance' + DataBoxEdgeDeviceStatus DeviceStatus `json:"dataBoxEdgeDeviceStatus,omitempty"` + // SerialNumber - READ-ONLY; The Serial Number of Data Box Edge/Gateway device. + SerialNumber *string `json:"serialNumber,omitempty"` + // Description - The Description of the Data Box Edge/Gateway device. + Description *string `json:"description,omitempty"` + // ModelDescription - The description of the Data Box Edge/Gateway device model. + ModelDescription *string `json:"modelDescription,omitempty"` + // DeviceType - READ-ONLY; The type of the Data Box Edge/Gateway device. Possible values include: 'DataBoxEdgeDevice' + DeviceType DeviceType `json:"deviceType,omitempty"` + // FriendlyName - The Data Box Edge/Gateway device name. + FriendlyName *string `json:"friendlyName,omitempty"` + // Culture - READ-ONLY; The Data Box Edge/Gateway device culture. + Culture *string `json:"culture,omitempty"` + // DeviceModel - READ-ONLY; The Data Box Edge/Gateway device model. + DeviceModel *string `json:"deviceModel,omitempty"` + // DeviceSoftwareVersion - READ-ONLY; The Data Box Edge/Gateway device software version. + DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"` + // DeviceLocalCapacity - READ-ONLY; The Data Box Edge/Gateway device local capacity in MB. + DeviceLocalCapacity *int64 `json:"deviceLocalCapacity,omitempty"` + // TimeZone - READ-ONLY; The Data Box Edge/Gateway device timezone. + TimeZone *string `json:"timeZone,omitempty"` + // DeviceHcsVersion - READ-ONLY; The device software version number of the device (eg: 1.2.18105.6). + DeviceHcsVersion *string `json:"deviceHcsVersion,omitempty"` + // ConfiguredRoleTypes - READ-ONLY; Type of compute roles configured. + ConfiguredRoleTypes *[]RoleTypes `json:"configuredRoleTypes,omitempty"` + // NodeCount - READ-ONLY; The number of nodes in the cluster. + NodeCount *int32 `json:"nodeCount,omitempty"` +} + +// DevicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesCreateOrUpdateFuture) Result(client DevicesClient) (d Device, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { + d, err = client.CreateOrUpdateResponder(d.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return +} + +// DevicesCreateOrUpdateSecuritySettingsFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type DevicesCreateOrUpdateSecuritySettingsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesCreateOrUpdateSecuritySettingsFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesCreateOrUpdateSecuritySettingsFuture") + return + } + ar.Response = future.Response() + return +} + +// DevicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesDeleteFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DevicesDownloadUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesDownloadUpdatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesDownloadUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesDownloadUpdatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesDownloadUpdatesFuture") + return + } + ar.Response = future.Response() + return +} + +// DevicesInstallUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesInstallUpdatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesInstallUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesInstallUpdatesFuture") + return + } + ar.Response = future.Response() + return +} + +// DevicesScanForUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DevicesScanForUpdatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DevicesScanForUpdatesFuture) Result(client DevicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.DevicesScanForUpdatesFuture") + return + } + ar.Response = future.Response() + return +} + +// FileEventTrigger trigger details. +type FileEventTrigger struct { + // FileTriggerProperties - File trigger properties. + *FileTriggerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' + Kind KindBasicTrigger `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileEventTrigger. +func (fet FileEventTrigger) MarshalJSON() ([]byte, error) { + fet.Kind = KindFileEvent + objectMap := make(map[string]interface{}) + if fet.FileTriggerProperties != nil { + objectMap["properties"] = fet.FileTriggerProperties + } + if fet.Kind != "" { + objectMap["kind"] = fet.Kind + } + return json.Marshal(objectMap) +} + +// AsFileEventTrigger is the BasicTrigger implementation for FileEventTrigger. +func (fet FileEventTrigger) AsFileEventTrigger() (*FileEventTrigger, bool) { + return &fet, true +} + +// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for FileEventTrigger. +func (fet FileEventTrigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { + return nil, false +} + +// AsTrigger is the BasicTrigger implementation for FileEventTrigger. +func (fet FileEventTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for FileEventTrigger. +func (fet FileEventTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &fet, true +} + +// UnmarshalJSON is the custom unmarshaler for FileEventTrigger struct. +func (fet *FileEventTrigger) 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 fileTriggerProperties FileTriggerProperties + err = json.Unmarshal(*v, &fileTriggerProperties) + if err != nil { + return err + } + fet.FileTriggerProperties = &fileTriggerProperties + } + case "kind": + if v != nil { + var kind KindBasicTrigger + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fet.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fet.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fet.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fet.Type = &typeVar + } + } + } + + return nil +} + +// FileSourceInfo file source details. +type FileSourceInfo struct { + // ShareID - File share ID. + ShareID *string `json:"shareId,omitempty"` +} + +// FileTriggerProperties file trigger properties. +type FileTriggerProperties struct { + // SourceInfo - File event source details. + SourceInfo *FileSourceInfo `json:"sourceInfo,omitempty"` + // SinkInfo - Role sink info. + SinkInfo *RoleSinkInfo `json:"sinkInfo,omitempty"` + // CustomContextTag - A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + CustomContextTag *string `json:"customContextTag,omitempty"` +} + +// IoTDeviceInfo metadata of IoT device/IoT Edge device to be configured. +type IoTDeviceInfo struct { + // DeviceID - ID of the IoT device/edge device. + DeviceID *string `json:"deviceId,omitempty"` + // IoTHostHub - Host name for the IoT hub associated to the device. + IoTHostHub *string `json:"ioTHostHub,omitempty"` + // IoTHostHubID - Id for the IoT hub associated to the device. + IoTHostHubID *string `json:"ioTHostHubId,omitempty"` + // Authentication - IoT device authentication info. + Authentication *Authentication `json:"authentication,omitempty"` +} + +// IoTRole compute role. +type IoTRole struct { + // IoTRoleProperties - Properties specific to IoT role. + *IoTRoleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindRole', 'KindIOT' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for IoTRole. +func (itr IoTRole) MarshalJSON() ([]byte, error) { + itr.Kind = KindIOT + objectMap := make(map[string]interface{}) + if itr.IoTRoleProperties != nil { + objectMap["properties"] = itr.IoTRoleProperties + } + if itr.Kind != "" { + objectMap["kind"] = itr.Kind + } + return json.Marshal(objectMap) +} + +// AsIoTRole is the BasicRole implementation for IoTRole. +func (itr IoTRole) AsIoTRole() (*IoTRole, bool) { + return &itr, true +} + +// AsRole is the BasicRole implementation for IoTRole. +func (itr IoTRole) AsRole() (*Role, bool) { + return nil, false +} + +// AsBasicRole is the BasicRole implementation for IoTRole. +func (itr IoTRole) AsBasicRole() (BasicRole, bool) { + return &itr, true +} + +// UnmarshalJSON is the custom unmarshaler for IoTRole struct. +func (itr *IoTRole) 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 ioTRoleProperties IoTRoleProperties + err = json.Unmarshal(*v, &ioTRoleProperties) + if err != nil { + return err + } + itr.IoTRoleProperties = &ioTRoleProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + itr.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + itr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + itr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + itr.Type = &typeVar + } + } + } + + return nil +} + +// IoTRoleProperties ioT role properties. +type IoTRoleProperties struct { + // HostPlatform - Host OS supported by the IoT role. Possible values include: 'Windows', 'Linux' + HostPlatform PlatformType `json:"hostPlatform,omitempty"` + // IoTDeviceDetails - IoT device metadata to which data box edge device needs to be connected. + IoTDeviceDetails *IoTDeviceInfo `json:"ioTDeviceDetails,omitempty"` + // IoTEdgeDeviceDetails - IoT edge device to which the IoT role needs to be configured. + IoTEdgeDeviceDetails *IoTDeviceInfo `json:"ioTEdgeDeviceDetails,omitempty"` + // ShareMappings - Mount points of shares in role(s). + ShareMappings *[]MountPointMap `json:"shareMappings,omitempty"` + // RoleStatus - Role status. Possible values include: 'RoleStatusEnabled', 'RoleStatusDisabled' + RoleStatus RoleStatus `json:"roleStatus,omitempty"` +} + +// Ipv4Config details related to the IPv4 address configuration. +type Ipv4Config struct { + // IPAddress - READ-ONLY; The IPv4 address of the network adapter. + IPAddress *string `json:"ipAddress,omitempty"` + // Subnet - READ-ONLY; The IPv4 subnet of the network adapter. + Subnet *string `json:"subnet,omitempty"` + // Gateway - READ-ONLY; The IPv4 gateway of the network adapter. + Gateway *string `json:"gateway,omitempty"` +} + +// Ipv6Config details related to the IPv6 address configuration. +type Ipv6Config struct { + // IPAddress - READ-ONLY; The IPv6 address of the network adapter. + IPAddress *string `json:"ipAddress,omitempty"` + // PrefixLength - READ-ONLY; The IPv6 prefix of the network adapter. + PrefixLength *int32 `json:"prefixLength,omitempty"` + // Gateway - READ-ONLY; The IPv6 gateway of the network adapter. + Gateway *string `json:"gateway,omitempty"` +} + +// Job a device job. +type Job struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the object. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` + // Status - READ-ONLY; The current status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusRunning', 'JobStatusSucceeded', 'JobStatusFailed', 'JobStatusCanceled', 'JobStatusPaused', 'JobStatusScheduled' + Status JobStatus `json:"status,omitempty"` + // StartTime - READ-ONLY; The UTC date and time at which the job started. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The UTC date and time at which the job completed. + EndTime *date.Time `json:"endTime,omitempty"` + // PercentComplete - READ-ONLY; The percentage of the job that is complete. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // Error - READ-ONLY; The error details. + Error *JobErrorDetails `json:"error,omitempty"` + // JobProperties - READ-ONLY; The properties of the job. + *JobProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Job struct. +func (j *Job) 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 + } + j.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + j.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + j.Type = &typeVar + } + case "status": + if v != nil { + var status JobStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + j.Status = status + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + j.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + j.EndTime = &endTime + } + case "percentComplete": + if v != nil { + var percentComplete int32 + err = json.Unmarshal(*v, &percentComplete) + if err != nil { + return err + } + j.PercentComplete = &percentComplete + } + case "error": + if v != nil { + var errorVar JobErrorDetails + err = json.Unmarshal(*v, &errorVar) + if err != nil { + return err + } + j.Error = &errorVar + } + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } + } + } + + return nil +} + +// JobErrorDetails the job error information containing the list of job errors. +type JobErrorDetails struct { + // ErrorDetails - READ-ONLY; The error details. + ErrorDetails *[]JobErrorItem `json:"errorDetails,omitempty"` + // Code - READ-ONLY; The code intended for programmatic access. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The message that describes the error in detail. + Message *string `json:"message,omitempty"` +} + +// JobErrorItem the job error items. +type JobErrorItem struct { + // Recommendations - READ-ONLY; The recommended actions. + Recommendations *[]string `json:"recommendations,omitempty"` + // Code - READ-ONLY; The code intended for programmatic access. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The message that describes the error in detail. + Message *string `json:"message,omitempty"` +} + +// JobProperties the properties for the job. +type JobProperties struct { + // JobType - READ-ONLY; The type of the job. Possible values include: 'JobTypeInvalid', 'JobTypeScanForUpdates', 'JobTypeDownloadUpdates', 'JobTypeInstallUpdates', 'JobTypeRefreshShare', 'JobTypeRefreshContainer' + JobType JobType `json:"jobType,omitempty"` + // CurrentStage - READ-ONLY; Current stage of the update operation. Possible values include: 'UpdateOperationStageUnknown', 'UpdateOperationStageInitial', 'UpdateOperationStageScanStarted', 'UpdateOperationStageScanComplete', 'UpdateOperationStageScanFailed', 'UpdateOperationStageDownloadStarted', 'UpdateOperationStageDownloadComplete', 'UpdateOperationStageDownloadFailed', 'UpdateOperationStageInstallStarted', 'UpdateOperationStageInstallComplete', 'UpdateOperationStageInstallFailed', 'UpdateOperationStageRebootInitiated', 'UpdateOperationStageSuccess', 'UpdateOperationStageFailure', 'UpdateOperationStageRescanStarted', 'UpdateOperationStageRescanComplete', 'UpdateOperationStageRescanFailed' + CurrentStage UpdateOperationStage `json:"currentStage,omitempty"` + // DownloadProgress - READ-ONLY; The download progress. + DownloadProgress *UpdateDownloadProgress `json:"downloadProgress,omitempty"` + // InstallProgress - READ-ONLY; The install progress. + InstallProgress *UpdateInstallProgress `json:"installProgress,omitempty"` + // TotalRefreshErrors - READ-ONLY; Total number of errors encountered during the refresh process. + TotalRefreshErrors *int32 `json:"totalRefreshErrors,omitempty"` + // ErrorManifestFile - READ-ONLY; Local share/remote container relative path to the error manifest file of the refresh. + ErrorManifestFile *string `json:"errorManifestFile,omitempty"` + // RefreshedEntityID - READ-ONLY; ARM ID of the entity that was refreshed. + RefreshedEntityID *string `json:"refreshedEntityId,omitempty"` + // Folder - If only subfolders need to be refreshed, then the subfolder path inside the share or container. (The path is empty if there are no subfolders.) + Folder *string `json:"folder,omitempty"` +} + +// MetricDimensionV1 metric Dimension v1. +type MetricDimensionV1 struct { + // Name - Name of the metrics dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of the metrics dimension. + DisplayName *string `json:"displayName,omitempty"` + // ToBeExportedForShoebox - To be exported to shoe box. + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// MetricSpecificationV1 metric specification version 1. +type MetricSpecificationV1 struct { + // Name - Name of the metric. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of the metric. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Description of the metric to be displayed. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Metric units. Possible values include: 'NotSpecified', 'Percent', 'Count', 'Seconds', 'Milliseconds', 'Bytes', 'BytesPerSecond', 'CountPerSecond' + Unit MetricUnit `json:"unit,omitempty"` + // AggregationType - Metric aggregation type. Possible values include: 'MetricAggregationTypeNotSpecified', 'MetricAggregationTypeNone', 'MetricAggregationTypeAverage', 'MetricAggregationTypeMinimum', 'MetricAggregationTypeMaximum', 'MetricAggregationTypeTotal', 'MetricAggregationTypeCount' + AggregationType MetricAggregationType `json:"aggregationType,omitempty"` + // Dimensions - Metric dimensions, other than default dimension which is resource. + Dimensions *[]MetricDimensionV1 `json:"dimensions,omitempty"` + // FillGapWithZero - Set true to fill the gaps with zero. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Category - Metric category. Possible values include: 'Capacity', 'Transaction' + Category MetricCategory `json:"category,omitempty"` + // ResourceIDDimensionNameOverride - Resource name override. + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` + // SupportedTimeGrainTypes - Support granularity of metrics. + SupportedTimeGrainTypes *[]TimeGrain `json:"supportedTimeGrainTypes,omitempty"` + // SupportedAggregationTypes - Support metric aggregation type. + SupportedAggregationTypes *[]MetricAggregationType `json:"supportedAggregationTypes,omitempty"` +} + +// MountPointMap the share mount point. +type MountPointMap struct { + // ShareID - ID of the share mounted to the role VM. + ShareID *string `json:"shareId,omitempty"` + // RoleID - READ-ONLY; ID of the role to which share is mounted. + RoleID *string `json:"roleId,omitempty"` + // MountPoint - READ-ONLY; Mount point for the share. + MountPoint *string `json:"mountPoint,omitempty"` + // RoleType - READ-ONLY; Role type. Possible values include: 'IOT', 'ASA', 'Functions', 'Cognitive' + RoleType RoleTypes `json:"roleType,omitempty"` +} + +// NetworkAdapter represents the networkAdapter on a device. +type NetworkAdapter struct { + // AdapterID - READ-ONLY; Instance ID of network adapter. + AdapterID *string `json:"adapterId,omitempty"` + // AdapterPosition - READ-ONLY; Hardware position of network adapter. + AdapterPosition *NetworkAdapterPosition `json:"adapterPosition,omitempty"` + // Index - READ-ONLY; Logical index of the adapter. + Index *int32 `json:"index,omitempty"` + // NodeID - READ-ONLY; Node ID of the network adapter. + NodeID *string `json:"nodeId,omitempty"` + // NetworkAdapterName - READ-ONLY; Network adapter name. + NetworkAdapterName *string `json:"networkAdapterName,omitempty"` + // Label - READ-ONLY; Hardware label for the adapter. + Label *string `json:"label,omitempty"` + // MacAddress - READ-ONLY; MAC address. + MacAddress *string `json:"macAddress,omitempty"` + // LinkSpeed - READ-ONLY; Link speed. + LinkSpeed *int64 `json:"linkSpeed,omitempty"` + // Status - READ-ONLY; Value indicating whether this adapter is valid. Possible values include: 'Inactive', 'Active' + Status NetworkAdapterStatus `json:"status,omitempty"` + // RdmaStatus - Value indicating whether this adapter is RDMA capable. Possible values include: 'Incapable', 'Capable' + RdmaStatus NetworkAdapterRDMAStatus `json:"rdmaStatus,omitempty"` + // DhcpStatus - Value indicating whether this adapter has DHCP enabled. Possible values include: 'NetworkAdapterDHCPStatusDisabled', 'NetworkAdapterDHCPStatusEnabled' + DhcpStatus NetworkAdapterDHCPStatus `json:"dhcpStatus,omitempty"` + // Ipv4Configuration - READ-ONLY; The IPv4 configuration of the network adapter. + Ipv4Configuration *Ipv4Config `json:"ipv4Configuration,omitempty"` + // Ipv6Configuration - READ-ONLY; The IPv6 configuration of the network adapter. + Ipv6Configuration *Ipv6Config `json:"ipv6Configuration,omitempty"` + // Ipv6LinkLocalAddress - READ-ONLY; The IPv6 local address. + Ipv6LinkLocalAddress *string `json:"ipv6LinkLocalAddress,omitempty"` + // DNSServers - READ-ONLY; The list of DNS Servers of the device. + DNSServers *[]string `json:"dnsServers,omitempty"` +} + +// NetworkAdapterPosition the network adapter position. +type NetworkAdapterPosition struct { + // NetworkGroup - READ-ONLY; The network group. Possible values include: 'NetworkGroupNone', 'NetworkGroupNonRDMA', 'NetworkGroupRDMA' + NetworkGroup NetworkGroup `json:"networkGroup,omitempty"` + // Port - READ-ONLY; The port. + Port *int32 `json:"port,omitempty"` +} + +// NetworkSettings the network settings of a device. +type NetworkSettings struct { + autorest.Response `json:"-"` + // NetworkSettingsProperties - READ-ONLY; The properties of network settings of a device. + *NetworkSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkSettings. +func (ns NetworkSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NetworkSettings struct. +func (ns *NetworkSettings) 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 networkSettingsProperties NetworkSettingsProperties + err = json.Unmarshal(*v, &networkSettingsProperties) + if err != nil { + return err + } + ns.NetworkSettingsProperties = &networkSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ns.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ns.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ns.Type = &typeVar + } + } + } + + return nil +} + +// NetworkSettingsProperties the properties of network settings. +type NetworkSettingsProperties struct { + // NetworkAdapters - READ-ONLY; The network adapter list on the device. + NetworkAdapters *[]NetworkAdapter `json:"networkAdapters,omitempty"` +} + +// Node represents a single node in a Data box Edge/Gateway device +// Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 node +// Multi-node Edge devices will have more than 1 nodes +type Node struct { + // NodeProperties - READ-ONLY; The properties of the node + *NodeProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Node. +func (n Node) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Node struct. +func (n *Node) 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 nodeProperties NodeProperties + err = json.Unmarshal(*v, &nodeProperties) + if err != nil { + return err + } + n.NodeProperties = &nodeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + n.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + n.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + n.Type = &typeVar + } + } + } + + return nil +} + +// NodeList collection of Nodes. +type NodeList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of Nodes. + Value *[]Node `json:"value,omitempty"` +} + +// NodeProperties this class represents the nodes in a highly available cluster +type NodeProperties struct { + // NodeStatus - READ-ONLY; The current status of the individual node. Possible values include: 'NodeStatusUnknown', 'NodeStatusUp', 'NodeStatusDown', 'NodeStatusRebooting', 'NodeStatusShuttingDown' + NodeStatus NodeStatus `json:"nodeStatus,omitempty"` + // NodeChassisSerialNumber - READ-ONLY; Serial number of the Chassis + NodeChassisSerialNumber *string `json:"nodeChassisSerialNumber,omitempty"` + // NodeSerialNumber - READ-ONLY; Serial number of the individual node + NodeSerialNumber *string `json:"nodeSerialNumber,omitempty"` + // NodeDisplayName - READ-ONLY; Display Name of the individual node + NodeDisplayName *string `json:"nodeDisplayName,omitempty"` + // NodeFriendlySoftwareVersion - READ-ONLY; Friendly software version name that is currently installed on the node + NodeFriendlySoftwareVersion *string `json:"nodeFriendlySoftwareVersion,omitempty"` + // NodeHcsVersion - READ-ONLY; HCS version that is currently installed on the node + NodeHcsVersion *string `json:"nodeHcsVersion,omitempty"` + // NodeInstanceID - READ-ONLY; Guid instance id of the node + NodeInstanceID *string `json:"nodeInstanceId,omitempty"` +} + +// Operation operations. +type Operation struct { + // Name - Name of the operation. + Name *string `json:"name,omitempty"` + // Display - Properties displayed for the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - Origin of the operation. + Origin *string `json:"origin,omitempty"` + // OperationProperties - Operation properties. + *OperationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Display != nil { + objectMap["display"] = o.Display + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) 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 "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay operation display properties. +type OperationDisplay struct { + // Provider - Provider name. + Provider *string `json:"provider,omitempty"` + // Resource - The type of resource in which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - Operation to be performed on the resource. + Operation *string `json:"operation,omitempty"` + // Description - Description of the operation to be performed. + Description *string `json:"description,omitempty"` +} + +// OperationProperties operation properties. +type OperationProperties struct { + // ServiceSpecification - Service specification. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationsList the list of operations used for the discovery of available provider operations. +type OperationsList struct { + autorest.Response `json:"-"` + // Value - The value. + Value *[]Operation `json:"value,omitempty"` + // NextLink - Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsListIterator provides access to a complete listing of Operation values. +type OperationsListIterator struct { + i int + page OperationsListPage +} + +// 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 *OperationsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListIterator.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 *OperationsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsListIterator) 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 OperationsListIterator) Response() OperationsList { + 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 OperationsListIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsListIterator type. +func NewOperationsListIterator(page OperationsListPage) OperationsListIterator { + return OperationsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ol OperationsList) IsEmpty() bool { + return ol.Value == nil || len(*ol.Value) == 0 +} + +// operationsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ol OperationsList) operationsListPreparer(ctx context.Context) (*http.Request, error) { + if ol.NextLink == nil || len(to.String(ol.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ol.NextLink))) +} + +// OperationsListPage contains a page of Operation values. +type OperationsListPage struct { + fn func(context.Context, OperationsList) (OperationsList, error) + ol OperationsList +} + +// 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 *OperationsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListPage.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.ol) + if err != nil { + return err + } + page.ol = 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 *OperationsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsListPage) NotDone() bool { + return !page.ol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsListPage) Response() OperationsList { + return page.ol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsListPage) Values() []Operation { + if page.ol.IsEmpty() { + return nil + } + return *page.ol.Value +} + +// Creates a new instance of the OperationsListPage type. +func NewOperationsListPage(getNextPage func(context.Context, OperationsList) (OperationsList, error)) OperationsListPage { + return OperationsListPage{fn: getNextPage} +} + +// Order the order details. +type Order struct { + autorest.Response `json:"-"` + // OrderProperties - The order properties. + *OrderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Order. +func (o Order) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.OrderProperties != nil { + objectMap["properties"] = o.OrderProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Order struct. +func (o *Order) 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 orderProperties OrderProperties + err = json.Unmarshal(*v, &orderProperties) + if err != nil { + return err + } + o.OrderProperties = &orderProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + o.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + o.Type = &typeVar + } + } + } + + return nil +} + +// OrderList list of order entities. +type OrderList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of orders. + Value *[]Order `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// OrderListIterator provides access to a complete listing of Order values. +type OrderListIterator struct { + i int + page OrderListPage +} + +// 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 *OrderListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrderListIterator.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 *OrderListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OrderListIterator) 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 OrderListIterator) Response() OrderList { + 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 OrderListIterator) Value() Order { + if !iter.page.NotDone() { + return Order{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OrderListIterator type. +func NewOrderListIterator(page OrderListPage) OrderListIterator { + return OrderListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ol OrderList) IsEmpty() bool { + return ol.Value == nil || len(*ol.Value) == 0 +} + +// orderListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ol OrderList) orderListPreparer(ctx context.Context) (*http.Request, error) { + if ol.NextLink == nil || len(to.String(ol.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ol.NextLink))) +} + +// OrderListPage contains a page of Order values. +type OrderListPage struct { + fn func(context.Context, OrderList) (OrderList, error) + ol OrderList +} + +// 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 *OrderListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrderListPage.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.ol) + if err != nil { + return err + } + page.ol = 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 *OrderListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OrderListPage) NotDone() bool { + return !page.ol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OrderListPage) Response() OrderList { + return page.ol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OrderListPage) Values() []Order { + if page.ol.IsEmpty() { + return nil + } + return *page.ol.Value +} + +// Creates a new instance of the OrderListPage type. +func NewOrderListPage(getNextPage func(context.Context, OrderList) (OrderList, error)) OrderListPage { + return OrderListPage{fn: getNextPage} +} + +// OrderProperties order properties. +type OrderProperties struct { + // ContactInformation - The contact details. + ContactInformation *ContactDetails `json:"contactInformation,omitempty"` + // ShippingAddress - The shipping address. + ShippingAddress *Address `json:"shippingAddress,omitempty"` + // CurrentStatus - Current status of the order. + CurrentStatus *OrderStatus `json:"currentStatus,omitempty"` + // OrderHistory - READ-ONLY; List of status changes in the order. + OrderHistory *[]OrderStatus `json:"orderHistory,omitempty"` + // SerialNumber - READ-ONLY; Serial number of the device. + SerialNumber *string `json:"serialNumber,omitempty"` + // DeliveryTrackingInfo - READ-ONLY; Tracking information for the package delivered to the customer whether it has an original or a replacement device. + DeliveryTrackingInfo *[]TrackingInfo `json:"deliveryTrackingInfo,omitempty"` + // ReturnTrackingInfo - READ-ONLY; Tracking information for the package returned from the customer whether it has an original or a replacement device. + ReturnTrackingInfo *[]TrackingInfo `json:"returnTrackingInfo,omitempty"` +} + +// OrdersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type OrdersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OrdersCreateOrUpdateFuture) Result(client OrdersClient) (o Order, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.OrdersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if o.Response.Response, err = future.GetResult(sender); err == nil && o.Response.Response.StatusCode != http.StatusNoContent { + o, err = client.CreateOrUpdateResponder(o.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersCreateOrUpdateFuture", "Result", o.Response.Response, "Failure responding to request") + } + } + return +} + +// OrdersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type OrdersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OrdersDeleteFuture) Result(client OrdersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.OrdersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// OrderStatus represents a single status change. +type OrderStatus struct { + // Status - Status of the order as per the allowed status types. Possible values include: 'Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft' + Status OrderState `json:"status,omitempty"` + // UpdateDateTime - READ-ONLY; Time of status update. + UpdateDateTime *date.Time `json:"updateDateTime,omitempty"` + // Comments - Comments related to this status change. + Comments *string `json:"comments,omitempty"` + // AdditionalOrderDetails - READ-ONLY; Dictionary to hold generic information which is not stored + // by the already existing properties + AdditionalOrderDetails map[string]*string `json:"additionalOrderDetails"` +} + +// MarshalJSON is the custom marshaler for OrderStatus. +func (osVar OrderStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if osVar.Status != "" { + objectMap["status"] = osVar.Status + } + if osVar.Comments != nil { + objectMap["comments"] = osVar.Comments + } + return json.Marshal(objectMap) +} + +// PeriodicTimerEventTrigger trigger details. +type PeriodicTimerEventTrigger struct { + // PeriodicTimerProperties - Periodic timer trigger properties. + *PeriodicTimerProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' + Kind KindBasicTrigger `json:"kind,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) MarshalJSON() ([]byte, error) { + ptet.Kind = KindPeriodicTimerEvent + objectMap := make(map[string]interface{}) + if ptet.PeriodicTimerProperties != nil { + objectMap["properties"] = ptet.PeriodicTimerProperties + } + if ptet.Kind != "" { + objectMap["kind"] = ptet.Kind + } + return json.Marshal(objectMap) +} + +// AsFileEventTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) AsFileEventTrigger() (*FileEventTrigger, bool) { + return nil, false +} + +// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { + return &ptet, true +} + +// AsTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for PeriodicTimerEventTrigger. +func (ptet PeriodicTimerEventTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &ptet, true +} + +// UnmarshalJSON is the custom unmarshaler for PeriodicTimerEventTrigger struct. +func (ptet *PeriodicTimerEventTrigger) 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 periodicTimerProperties PeriodicTimerProperties + err = json.Unmarshal(*v, &periodicTimerProperties) + if err != nil { + return err + } + ptet.PeriodicTimerProperties = &periodicTimerProperties + } + case "kind": + if v != nil { + var kind KindBasicTrigger + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ptet.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ptet.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ptet.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ptet.Type = &typeVar + } + } + } + + return nil +} + +// PeriodicTimerProperties periodic timer trigger properties. +type PeriodicTimerProperties struct { + // SourceInfo - Periodic timer details. + SourceInfo *PeriodicTimerSourceInfo `json:"sourceInfo,omitempty"` + // SinkInfo - Role Sink information. + SinkInfo *RoleSinkInfo `json:"sinkInfo,omitempty"` + // CustomContextTag - A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + CustomContextTag *string `json:"customContextTag,omitempty"` +} + +// PeriodicTimerSourceInfo periodic timer event source. +type PeriodicTimerSourceInfo struct { + // StartTime - The time of the day that results in a valid trigger. Schedule is computed with reference to the time specified upto seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time. + StartTime *date.Time `json:"startTime,omitempty"` + // Schedule - Periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + Schedule *string `json:"schedule,omitempty"` + // Topic - Topic where periodic events are published to IoT device. + Topic *string `json:"topic,omitempty"` +} + +// RawCertificateData raw Certificate Data. +type RawCertificateData struct { + // AuthenticationType - The authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Certificate - The base64 encoded certificate raw data. + Certificate *string `json:"certificate,omitempty"` +} + +// RefreshDetails fields for tracking refresh job on the share or container. +type RefreshDetails struct { + // InProgressRefreshJobID - If a refresh job is currently in progress on this share or container, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress. + InProgressRefreshJobID *string `json:"inProgressRefreshJobId,omitempty"` + // LastCompletedRefreshJobTimeInUTC - Indicates the completed time for the last refresh job on this particular share or container, if any.This could be a failed job or a successful job. + LastCompletedRefreshJobTimeInUTC *date.Time `json:"lastCompletedRefreshJobTimeInUTC,omitempty"` + // ErrorManifestFile - Indicates the relative path of the error xml for the last refresh job on this particular share or container, if any. This could be a failed job or a successful job. + ErrorManifestFile *string `json:"errorManifestFile,omitempty"` + // LastJob - Indicates the id of the last refresh job on this particular share or container,if any. This could be a failed job or a successful job. + LastJob *string `json:"lastJob,omitempty"` +} + +// ResourceTypeSku skuInformation object +type ResourceTypeSku struct { + // ResourceType - READ-ONLY; The type of the resource + ResourceType *string `json:"resourceType,omitempty"` + // Name - READ-ONLY; The Sku name. Possible values include: 'Gateway', 'Edge', 'TEA1Node', 'TEA1NodeUPS', 'TEA1NodeHeater', 'TEA1NodeUPSHeater', 'TEA4NodeHeater', 'TEA4NodeUPSHeater', 'TMA' + Name SkuName `json:"name,omitempty"` + // Kind - READ-ONLY; The Sku kind + Kind *string `json:"kind,omitempty"` + // Tier - READ-ONLY; The Sku tier. Possible values include: 'Standard' + Tier SkuTier `json:"tier,omitempty"` + // Family - READ-ONLY; The Sku family + Family *string `json:"family,omitempty"` + // Locations - READ-ONLY; Availability of the SKU for the region + Locations *[]string `json:"locations,omitempty"` + // APIVersions - READ-ONLY; The API versions in which SKU is available + APIVersions *[]string `json:"apiVersions,omitempty"` + // LocationInfo - READ-ONLY; Availability of the SKU for the location/zone + LocationInfo *[]SkuLocationInfo `json:"locationInfo,omitempty"` + // Costs - READ-ONLY; The pricing info of the Sku. + Costs *[]SkuCost `json:"costs,omitempty"` + // Restrictions - READ-ONLY; Restrictions of the SKU availability. + Restrictions *[]SkuRestriction `json:"restrictions,omitempty"` +} + +// BasicRole compute role. +type BasicRole interface { + AsIoTRole() (*IoTRole, bool) + AsRole() (*Role, bool) +} + +// Role compute role. +type Role struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindRole', 'KindIOT' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicRole(body []byte) (BasicRole, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindIOT): + var itr IoTRole + err := json.Unmarshal(body, &itr) + return itr, err + default: + var r Role + err := json.Unmarshal(body, &r) + return r, err + } +} +func unmarshalBasicRoleArray(body []byte) ([]BasicRole, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rArray := make([]BasicRole, len(rawMessages)) + + for index, rawMessage := range rawMessages { + r, err := unmarshalBasicRole(*rawMessage) + if err != nil { + return nil, err + } + rArray[index] = r + } + return rArray, nil +} + +// MarshalJSON is the custom marshaler for Role. +func (r Role) MarshalJSON() ([]byte, error) { + r.Kind = KindRole + objectMap := make(map[string]interface{}) + if r.Kind != "" { + objectMap["kind"] = r.Kind + } + return json.Marshal(objectMap) +} + +// AsIoTRole is the BasicRole implementation for Role. +func (r Role) AsIoTRole() (*IoTRole, bool) { + return nil, false +} + +// AsRole is the BasicRole implementation for Role. +func (r Role) AsRole() (*Role, bool) { + return &r, true +} + +// AsBasicRole is the BasicRole implementation for Role. +func (r Role) AsBasicRole() (BasicRole, bool) { + return &r, true +} + +// RoleList collection of all the roles on the Data Box Edge device. +type RoleList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The Value. + Value *[]BasicRole `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RoleList struct. +func (rl *RoleList) 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 "value": + if v != nil { + value, err := unmarshalBasicRoleArray(*v) + if err != nil { + return err + } + rl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + rl.NextLink = &nextLink + } + } + } + + return nil +} + +// RoleListIterator provides access to a complete listing of Role values. +type RoleListIterator struct { + i int + page RoleListPage +} + +// 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 *RoleListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleListIterator.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 *RoleListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RoleListIterator) 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 RoleListIterator) Response() RoleList { + 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 RoleListIterator) Value() BasicRole { + if !iter.page.NotDone() { + return Role{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RoleListIterator type. +func NewRoleListIterator(page RoleListPage) RoleListIterator { + return RoleListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rl RoleList) IsEmpty() bool { + return rl.Value == nil || len(*rl.Value) == 0 +} + +// roleListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rl RoleList) roleListPreparer(ctx context.Context) (*http.Request, error) { + if rl.NextLink == nil || len(to.String(rl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rl.NextLink))) +} + +// RoleListPage contains a page of BasicRole values. +type RoleListPage struct { + fn func(context.Context, RoleList) (RoleList, error) + rl RoleList +} + +// 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 *RoleListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleListPage.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.rl) + if err != nil { + return err + } + page.rl = 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 *RoleListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RoleListPage) NotDone() bool { + return !page.rl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RoleListPage) Response() RoleList { + return page.rl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RoleListPage) Values() []BasicRole { + if page.rl.IsEmpty() { + return nil + } + return *page.rl.Value +} + +// Creates a new instance of the RoleListPage type. +func NewRoleListPage(getNextPage func(context.Context, RoleList) (RoleList, error)) RoleListPage { + return RoleListPage{fn: getNextPage} +} + +// RoleModel ... +type RoleModel struct { + autorest.Response `json:"-"` + Value BasicRole `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RoleModel struct. +func (rm *RoleModel) UnmarshalJSON(body []byte) error { + r, err := unmarshalBasicRole(body) + if err != nil { + return err + } + rm.Value = r + + return nil +} + +// RolesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RolesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RolesCreateOrUpdateFuture) Result(client RolesClient) (rm RoleModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.RolesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rm.Response.Response, err = future.GetResult(sender); err == nil && rm.Response.Response.StatusCode != http.StatusNoContent { + rm, err = client.CreateOrUpdateResponder(rm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesCreateOrUpdateFuture", "Result", rm.Response.Response, "Failure responding to request") + } + } + return +} + +// RolesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RolesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RolesDeleteFuture) Result(client RolesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.RolesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RoleSinkInfo compute role against which events will be raised. +type RoleSinkInfo struct { + // RoleID - Compute role ID. + RoleID *string `json:"roleId,omitempty"` +} + +// SecuritySettings the security settings of a device. +type SecuritySettings struct { + // SecuritySettingsProperties - Properties of the security settings. + *SecuritySettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecuritySettings. +func (ss SecuritySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.SecuritySettingsProperties != nil { + objectMap["properties"] = ss.SecuritySettingsProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecuritySettings struct. +func (ss *SecuritySettings) 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 securitySettingsProperties SecuritySettingsProperties + err = json.Unmarshal(*v, &securitySettingsProperties) + if err != nil { + return err + } + ss.SecuritySettingsProperties = &securitySettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ss.Type = &typeVar + } + } + } + + return nil +} + +// SecuritySettingsProperties the properties of security settings. +type SecuritySettingsProperties struct { + // DeviceAdminPassword - Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + DeviceAdminPassword *AsymmetricEncryptedSecret `json:"deviceAdminPassword,omitempty"` +} + +// ServiceSpecification service specification. +type ServiceSpecification struct { + // MetricSpecifications - Metric specification as defined by shoebox. + MetricSpecifications *[]MetricSpecificationV1 `json:"metricSpecifications,omitempty"` +} + +// Share represents a share on the Data Box Edge/Gateway device. +type Share struct { + autorest.Response `json:"-"` + // ShareProperties - The share properties. + *ShareProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Share. +func (s Share) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ShareProperties != nil { + objectMap["properties"] = s.ShareProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Share struct. +func (s *Share) 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 shareProperties ShareProperties + err = json.Unmarshal(*v, &shareProperties) + if err != nil { + return err + } + s.ShareProperties = &shareProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ShareAccessRight specifies the mapping between this particular user and the type of access he has on +// shares on this device. +type ShareAccessRight struct { + // ShareID - The share ID. + ShareID *string `json:"shareId,omitempty"` + // AccessType - Type of access to be allowed on the share for this user. Possible values include: 'Change', 'Read', 'Custom' + AccessType ShareAccessType `json:"accessType,omitempty"` +} + +// ShareList collection of all the shares on the Data Box Edge/Gateway device. +type ShareList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of shares. + Value *[]Share `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ShareListIterator provides access to a complete listing of Share values. +type ShareListIterator struct { + i int + page ShareListPage +} + +// 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 *ShareListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareListIterator.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 *ShareListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareListIterator) 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 ShareListIterator) Response() ShareList { + 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 ShareListIterator) Value() Share { + if !iter.page.NotDone() { + return Share{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareListIterator type. +func NewShareListIterator(page ShareListPage) ShareListIterator { + return ShareListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sl ShareList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 +} + +// shareListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sl ShareList) shareListPreparer(ctx context.Context) (*http.Request, error) { + if sl.NextLink == nil || len(to.String(sl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sl.NextLink))) +} + +// ShareListPage contains a page of Share values. +type ShareListPage struct { + fn func(context.Context, ShareList) (ShareList, error) + sl ShareList +} + +// 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 *ShareListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareListPage.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.sl) + if err != nil { + return err + } + page.sl = 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 *ShareListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareListPage) NotDone() bool { + return !page.sl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareListPage) Response() ShareList { + return page.sl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareListPage) Values() []Share { + if page.sl.IsEmpty() { + return nil + } + return *page.sl.Value +} + +// Creates a new instance of the ShareListPage type. +func NewShareListPage(getNextPage func(context.Context, ShareList) (ShareList, error)) ShareListPage { + return ShareListPage{fn: getNextPage} +} + +// ShareProperties the share properties. +type ShareProperties struct { + // Description - Description for the share. + Description *string `json:"description,omitempty"` + // ShareStatus - Current status of the share. Possible values include: 'ShareStatusOffline', 'ShareStatusUnknown', 'ShareStatusOK', 'ShareStatusUpdating', 'ShareStatusNeedsAttention' + ShareStatus ShareStatus `json:"shareStatus,omitempty"` + // MonitoringStatus - Current monitoring status of the share. Possible values include: 'Enabled', 'Disabled' + MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"` + // AzureContainerInfo - Azure container mapping for the share. + AzureContainerInfo *AzureContainerInfo `json:"azureContainerInfo,omitempty"` + // AccessProtocol - Access protocol to be used by the share. Possible values include: 'SMB', 'NFS' + AccessProtocol ShareAccessProtocol `json:"accessProtocol,omitempty"` + // UserAccessRights - Mapping of users and corresponding access rights on the share (required for SMB protocol). + UserAccessRights *[]UserAccessRight `json:"userAccessRights,omitempty"` + // ClientAccessRights - List of IP addresses and corresponding access rights on the share(required for NFS protocol). + ClientAccessRights *[]ClientAccessRight `json:"clientAccessRights,omitempty"` + // RefreshDetails - Details of the refresh job on this share. + RefreshDetails *RefreshDetails `json:"refreshDetails,omitempty"` + // ShareMappings - READ-ONLY; Share mount point to the role. + ShareMappings *[]MountPointMap `json:"shareMappings,omitempty"` + // DataPolicy - Data policy of the share. Possible values include: 'Cloud', 'Local' + DataPolicy DataPolicy `json:"dataPolicy,omitempty"` +} + +// SharesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SharesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SharesCreateOrUpdateFuture) Result(client SharesClient) (s Share, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SharesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type SharesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SharesDeleteFuture) Result(client SharesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SharesRefreshFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SharesRefreshFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SharesRefreshFuture) Result(client SharesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesRefreshFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.SharesRefreshFuture") + return + } + ar.Response = future.Response() + return +} + +// Sku the SKU type. +type Sku struct { + // Name - SKU name. Possible values include: 'Gateway', 'Edge', 'TEA1Node', 'TEA1NodeUPS', 'TEA1NodeHeater', 'TEA1NodeUPSHeater', 'TEA4NodeHeater', 'TEA4NodeUPSHeater', 'TMA' + Name SkuName `json:"name,omitempty"` + // Tier - The SKU tier. This is based on the SKU name. Possible values include: 'Standard' + Tier SkuTier `json:"tier,omitempty"` +} + +// SkuCost the metadata for retrieving price info. +type SkuCost struct { + // MeterID - READ-ONLY; Used for querying price from commerce. + MeterID *string `json:"meterId,omitempty"` + // Quantity - READ-ONLY; The cost quantity. + Quantity *int64 `json:"quantity,omitempty"` + // ExtendedUnit - READ-ONLY; Restriction of the SKU for the location/zone + ExtendedUnit *string `json:"extendedUnit,omitempty"` +} + +// SkuInformationList list of SKU Information objects +type SkuInformationList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of ResourceType Sku + Value *[]ResourceTypeSku `json:"value,omitempty"` + // NextLink - READ-ONLY; Links to the next set of results + NextLink *string `json:"nextLink,omitempty"` +} + +// SkuLocationInfo the location info. +type SkuLocationInfo struct { + // Location - READ-ONLY; The location. + Location *string `json:"location,omitempty"` + // Zones - READ-ONLY; The zones. + Zones *[]string `json:"zones,omitempty"` + // Sites - READ-ONLY; The sites. + Sites *[]string `json:"sites,omitempty"` +} + +// SkuRestriction the restrictions because of which SKU cannot be used. +type SkuRestriction struct { + // Type - READ-ONLY; The type of the restriction. + Type *string `json:"type,omitempty"` + // Values - READ-ONLY; The locations where sku is restricted. + Values *[]string `json:"values,omitempty"` + // ReasonCode - READ-ONLY; The SKU restriction reason. Possible values include: 'NotAvailableForSubscription', 'QuotaID' + ReasonCode SkuRestrictionReasonCode `json:"reasonCode,omitempty"` + // RestrictionInfo - READ-ONLY; Restriction of the SKU for the location/zone + RestrictionInfo *SkuRestrictionInfo `json:"restrictionInfo,omitempty"` +} + +// SkuRestrictionInfo the restriction info with locations and zones. +type SkuRestrictionInfo struct { + // Locations - READ-ONLY; The locations. + Locations *[]string `json:"locations,omitempty"` + // Zones - READ-ONLY; The zones. + Zones *[]string `json:"zones,omitempty"` +} + +// StorageAccount represents a Storage Account on the Data Box Edge/Gateway device. +type StorageAccount struct { + autorest.Response `json:"-"` + // StorageAccountProperties - The Storage Account properties. + *StorageAccountProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageAccount. +func (sa StorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sa.StorageAccountProperties != nil { + objectMap["properties"] = sa.StorageAccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StorageAccount struct. +func (sa *StorageAccount) 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 storageAccountProperties StorageAccountProperties + err = json.Unmarshal(*v, &storageAccountProperties) + if err != nil { + return err + } + sa.StorageAccountProperties = &storageAccountProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sa.Type = &typeVar + } + } + } + + return nil +} + +// StorageAccountCredential the storage account credential. +type StorageAccountCredential struct { + autorest.Response `json:"-"` + // StorageAccountCredentialProperties - The storage account credential properties. + *StorageAccountCredentialProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageAccountCredential. +func (sac StorageAccountCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sac.StorageAccountCredentialProperties != nil { + objectMap["properties"] = sac.StorageAccountCredentialProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StorageAccountCredential struct. +func (sac *StorageAccountCredential) 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 storageAccountCredentialProperties StorageAccountCredentialProperties + err = json.Unmarshal(*v, &storageAccountCredentialProperties) + if err != nil { + return err + } + sac.StorageAccountCredentialProperties = &storageAccountCredentialProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sac.Type = &typeVar + } + } + } + + return nil +} + +// StorageAccountCredentialList the collection of storage account credentials. +type StorageAccountCredentialList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The value. + Value *[]StorageAccountCredential `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageAccountCredentialListIterator provides access to a complete listing of StorageAccountCredential +// values. +type StorageAccountCredentialListIterator struct { + i int + page StorageAccountCredentialListPage +} + +// 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 *StorageAccountCredentialListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialListIterator.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 *StorageAccountCredentialListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageAccountCredentialListIterator) 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 StorageAccountCredentialListIterator) Response() StorageAccountCredentialList { + 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 StorageAccountCredentialListIterator) Value() StorageAccountCredential { + if !iter.page.NotDone() { + return StorageAccountCredential{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageAccountCredentialListIterator type. +func NewStorageAccountCredentialListIterator(page StorageAccountCredentialListPage) StorageAccountCredentialListIterator { + return StorageAccountCredentialListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sacl StorageAccountCredentialList) IsEmpty() bool { + return sacl.Value == nil || len(*sacl.Value) == 0 +} + +// storageAccountCredentialListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sacl StorageAccountCredentialList) storageAccountCredentialListPreparer(ctx context.Context) (*http.Request, error) { + if sacl.NextLink == nil || len(to.String(sacl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sacl.NextLink))) +} + +// StorageAccountCredentialListPage contains a page of StorageAccountCredential values. +type StorageAccountCredentialListPage struct { + fn func(context.Context, StorageAccountCredentialList) (StorageAccountCredentialList, error) + sacl StorageAccountCredentialList +} + +// 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 *StorageAccountCredentialListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialListPage.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.sacl) + if err != nil { + return err + } + page.sacl = 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 *StorageAccountCredentialListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageAccountCredentialListPage) NotDone() bool { + return !page.sacl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageAccountCredentialListPage) Response() StorageAccountCredentialList { + return page.sacl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageAccountCredentialListPage) Values() []StorageAccountCredential { + if page.sacl.IsEmpty() { + return nil + } + return *page.sacl.Value +} + +// Creates a new instance of the StorageAccountCredentialListPage type. +func NewStorageAccountCredentialListPage(getNextPage func(context.Context, StorageAccountCredentialList) (StorageAccountCredentialList, error)) StorageAccountCredentialListPage { + return StorageAccountCredentialListPage{fn: getNextPage} +} + +// StorageAccountCredentialProperties the storage account credential properties. +type StorageAccountCredentialProperties struct { + // Alias - Alias for the storage account. + Alias *string `json:"alias,omitempty"` + // UserName - Username for the storage account. + UserName *string `json:"userName,omitempty"` + // AccountKey - Encrypted storage key. + AccountKey *AsymmetricEncryptedSecret `json:"accountKey,omitempty"` + // ConnectionString - Connection string for the storage account. Use this string if username and account key are not specified. + ConnectionString *string `json:"connectionString,omitempty"` + // SslStatus - Signifies whether SSL needs to be enabled or not. Possible values include: 'SSLStatusEnabled', 'SSLStatusDisabled' + SslStatus SSLStatus `json:"sslStatus,omitempty"` + // BlobDomainName - Blob end point for private clouds. + BlobDomainName *string `json:"blobDomainName,omitempty"` + // AccountType - Type of storage accessed on the storage account. Possible values include: 'GeneralPurposeStorage', 'BlobStorage' + AccountType AccountType `json:"accountType,omitempty"` + // StorageAccountID - Id of the storage account. + StorageAccountID *string `json:"storageAccountId,omitempty"` +} + +// StorageAccountCredentialsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type StorageAccountCredentialsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StorageAccountCredentialsCreateOrUpdateFuture) Result(client StorageAccountCredentialsClient) (sac StorageAccountCredential, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountCredentialsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sac.Response.Response, err = future.GetResult(sender); err == nil && sac.Response.Response.StatusCode != http.StatusNoContent { + sac, err = client.CreateOrUpdateResponder(sac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request") + } + } + return +} + +// StorageAccountCredentialsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type StorageAccountCredentialsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StorageAccountCredentialsDeleteFuture) Result(client StorageAccountCredentialsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountCredentialsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// StorageAccountList collection of all the Storage Accounts on the Data Box Edge/Gateway device. +type StorageAccountList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of storageAccounts. + Value *[]StorageAccount `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// StorageAccountListIterator provides access to a complete listing of StorageAccount values. +type StorageAccountListIterator struct { + i int + page StorageAccountListPage +} + +// 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 *StorageAccountListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountListIterator.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 *StorageAccountListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageAccountListIterator) 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 StorageAccountListIterator) Response() StorageAccountList { + 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 StorageAccountListIterator) Value() StorageAccount { + if !iter.page.NotDone() { + return StorageAccount{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageAccountListIterator type. +func NewStorageAccountListIterator(page StorageAccountListPage) StorageAccountListIterator { + return StorageAccountListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sal StorageAccountList) IsEmpty() bool { + return sal.Value == nil || len(*sal.Value) == 0 +} + +// storageAccountListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sal StorageAccountList) storageAccountListPreparer(ctx context.Context) (*http.Request, error) { + if sal.NextLink == nil || len(to.String(sal.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sal.NextLink))) +} + +// StorageAccountListPage contains a page of StorageAccount values. +type StorageAccountListPage struct { + fn func(context.Context, StorageAccountList) (StorageAccountList, error) + sal StorageAccountList +} + +// 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 *StorageAccountListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountListPage.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.sal) + if err != nil { + return err + } + page.sal = 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 *StorageAccountListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageAccountListPage) NotDone() bool { + return !page.sal.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageAccountListPage) Response() StorageAccountList { + return page.sal +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageAccountListPage) Values() []StorageAccount { + if page.sal.IsEmpty() { + return nil + } + return *page.sal.Value +} + +// Creates a new instance of the StorageAccountListPage type. +func NewStorageAccountListPage(getNextPage func(context.Context, StorageAccountList) (StorageAccountList, error)) StorageAccountListPage { + return StorageAccountListPage{fn: getNextPage} +} + +// StorageAccountProperties the storage account properties. +type StorageAccountProperties struct { + // Description - Description for the storage Account. + Description *string `json:"description,omitempty"` + // StorageAccountStatus - Current status of the storage account. Possible values include: 'StorageAccountStatusOK', 'StorageAccountStatusOffline', 'StorageAccountStatusUnknown', 'StorageAccountStatusUpdating', 'StorageAccountStatusNeedsAttention' + StorageAccountStatus StorageAccountStatus `json:"storageAccountStatus,omitempty"` + // DataPolicy - Data policy of the storage Account. Possible values include: 'Cloud', 'Local' + DataPolicy DataPolicy `json:"dataPolicy,omitempty"` + // StorageAccountCredentialID - Storage Account Credential Id + StorageAccountCredentialID *string `json:"storageAccountCredentialId,omitempty"` + // BlobEndpoint - READ-ONLY; BlobEndpoint of Storage Account + BlobEndpoint *string `json:"blobEndpoint,omitempty"` + // ContainerCount - READ-ONLY; The Container Count. Present only for Storage Accounts with DataPolicy set to Cloud. + ContainerCount *int32 `json:"containerCount,omitempty"` +} + +// StorageAccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type StorageAccountsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StorageAccountsCreateOrUpdateFuture) Result(client StorageAccountsClient) (sa StorageAccount, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sa.Response.Response, err = future.GetResult(sender); err == nil && sa.Response.Response.StatusCode != http.StatusNoContent { + sa, err = client.CreateOrUpdateResponder(sa.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsCreateOrUpdateFuture", "Result", sa.Response.Response, "Failure responding to request") + } + } + return +} + +// StorageAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type StorageAccountsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *StorageAccountsDeleteFuture) Result(client StorageAccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.StorageAccountsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SymmetricKey symmetric key for authentication. +type SymmetricKey struct { + // ConnectionString - Connection string based on the symmetric key. + ConnectionString *AsymmetricEncryptedSecret `json:"connectionString,omitempty"` +} + +// TrackingInfo tracking courier information. +type TrackingInfo struct { + // SerialNumber - Serial number of the device being tracked. + SerialNumber *string `json:"serialNumber,omitempty"` + // CarrierName - Name of the carrier used in the delivery. + CarrierName *string `json:"carrierName,omitempty"` + // TrackingID - Tracking ID of the shipment. + TrackingID *string `json:"trackingId,omitempty"` + // TrackingURL - Tracking URL of the shipment. + TrackingURL *string `json:"trackingUrl,omitempty"` +} + +// BasicTrigger trigger details. +type BasicTrigger interface { + AsFileEventTrigger() (*FileEventTrigger, bool) + AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) + AsTrigger() (*Trigger, bool) +} + +// Trigger trigger details. +type Trigger struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindTrigger', 'KindFileEvent', 'KindPeriodicTimerEvent' + Kind KindBasicTrigger `json:"kind,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicTrigger(body []byte) (BasicTrigger, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindFileEvent): + var fet FileEventTrigger + err := json.Unmarshal(body, &fet) + return fet, err + case string(KindPeriodicTimerEvent): + var ptet PeriodicTimerEventTrigger + err := json.Unmarshal(body, &ptet) + return ptet, err + default: + var t Trigger + err := json.Unmarshal(body, &t) + return t, err + } +} +func unmarshalBasicTriggerArray(body []byte) ([]BasicTrigger, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tArray := make([]BasicTrigger, len(rawMessages)) + + for index, rawMessage := range rawMessages { + t, err := unmarshalBasicTrigger(*rawMessage) + if err != nil { + return nil, err + } + tArray[index] = t + } + return tArray, nil +} + +// MarshalJSON is the custom marshaler for Trigger. +func (t Trigger) MarshalJSON() ([]byte, error) { + t.Kind = KindTrigger + objectMap := make(map[string]interface{}) + if t.Kind != "" { + objectMap["kind"] = t.Kind + } + return json.Marshal(objectMap) +} + +// AsFileEventTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsFileEventTrigger() (*FileEventTrigger, bool) { + return nil, false +} + +// AsPeriodicTimerEventTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsPeriodicTimerEventTrigger() (*PeriodicTimerEventTrigger, bool) { + return nil, false +} + +// AsTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsTrigger() (*Trigger, bool) { + return &t, true +} + +// AsBasicTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsBasicTrigger() (BasicTrigger, bool) { + return &t, true +} + +// TriggerList collection of all trigger on the data box edge device. +type TriggerList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of triggers. + Value *[]BasicTrigger `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TriggerList struct. +func (tl *TriggerList) 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 "value": + if v != nil { + value, err := unmarshalBasicTriggerArray(*v) + if err != nil { + return err + } + tl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + tl.NextLink = &nextLink + } + } + } + + return nil +} + +// TriggerListIterator provides access to a complete listing of Trigger values. +type TriggerListIterator struct { + i int + page TriggerListPage +} + +// 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 *TriggerListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggerListIterator.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 *TriggerListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TriggerListIterator) 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 TriggerListIterator) Response() TriggerList { + 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 TriggerListIterator) Value() BasicTrigger { + if !iter.page.NotDone() { + return Trigger{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TriggerListIterator type. +func NewTriggerListIterator(page TriggerListPage) TriggerListIterator { + return TriggerListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tl TriggerList) IsEmpty() bool { + return tl.Value == nil || len(*tl.Value) == 0 +} + +// triggerListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tl TriggerList) triggerListPreparer(ctx context.Context) (*http.Request, error) { + if tl.NextLink == nil || len(to.String(tl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tl.NextLink))) +} + +// TriggerListPage contains a page of BasicTrigger values. +type TriggerListPage struct { + fn func(context.Context, TriggerList) (TriggerList, error) + tl TriggerList +} + +// 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 *TriggerListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggerListPage.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.tl) + if err != nil { + return err + } + page.tl = 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 *TriggerListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TriggerListPage) NotDone() bool { + return !page.tl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TriggerListPage) Response() TriggerList { + return page.tl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TriggerListPage) Values() []BasicTrigger { + if page.tl.IsEmpty() { + return nil + } + return *page.tl.Value +} + +// Creates a new instance of the TriggerListPage type. +func NewTriggerListPage(getNextPage func(context.Context, TriggerList) (TriggerList, error)) TriggerListPage { + return TriggerListPage{fn: getNextPage} +} + +// TriggerModel ... +type TriggerModel struct { + autorest.Response `json:"-"` + Value BasicTrigger `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TriggerModel struct. +func (tm *TriggerModel) UnmarshalJSON(body []byte) error { + t, err := unmarshalBasicTrigger(body) + if err != nil { + return err + } + tm.Value = t + + return nil +} + +// TriggersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TriggersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersCreateOrUpdateFuture) Result(client TriggersClient) (tm TriggerModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.TriggersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tm.Response.Response, err = future.GetResult(sender); err == nil && tm.Response.Response.StatusCode != http.StatusNoContent { + tm, err = client.CreateOrUpdateResponder(tm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersCreateOrUpdateFuture", "Result", tm.Response.Response, "Failure responding to request") + } + } + return +} + +// TriggersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TriggersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersDeleteFuture) Result(client TriggersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.TriggersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// UpdateDownloadProgress details about the download progress of update. +type UpdateDownloadProgress struct { + // DownloadPhase - READ-ONLY; The download phase. Possible values include: 'DownloadPhaseUnknown', 'DownloadPhaseInitializing', 'DownloadPhaseDownloading', 'DownloadPhaseVerifying' + DownloadPhase DownloadPhase `json:"downloadPhase,omitempty"` + // PercentComplete - READ-ONLY; Percentage of completion. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // TotalBytesToDownload - READ-ONLY; Total bytes to download. + TotalBytesToDownload *float64 `json:"totalBytesToDownload,omitempty"` + // TotalBytesDownloaded - READ-ONLY; Total bytes downloaded. + TotalBytesDownloaded *float64 `json:"totalBytesDownloaded,omitempty"` + // NumberOfUpdatesToDownload - READ-ONLY; Number of updates to download. + NumberOfUpdatesToDownload *int32 `json:"numberOfUpdatesToDownload,omitempty"` + // NumberOfUpdatesDownloaded - READ-ONLY; Number of updates downloaded. + NumberOfUpdatesDownloaded *int32 `json:"numberOfUpdatesDownloaded,omitempty"` +} + +// UpdateInstallProgress progress details during installation of updates. +type UpdateInstallProgress struct { + // PercentComplete - READ-ONLY; Percentage completed. + PercentComplete *int32 `json:"percentComplete,omitempty"` + // NumberOfUpdatesToInstall - READ-ONLY; Number of updates to install. + NumberOfUpdatesToInstall *int32 `json:"numberOfUpdatesToInstall,omitempty"` + // NumberOfUpdatesInstalled - READ-ONLY; Number of updates installed. + NumberOfUpdatesInstalled *int32 `json:"numberOfUpdatesInstalled,omitempty"` +} + +// UpdateSummary details about ongoing updates and availability of updates on the device. +type UpdateSummary struct { + autorest.Response `json:"-"` + // UpdateSummaryProperties - The device update information summary. + *UpdateSummaryProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateSummary. +func (us UpdateSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if us.UpdateSummaryProperties != nil { + objectMap["properties"] = us.UpdateSummaryProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UpdateSummary struct. +func (us *UpdateSummary) 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 updateSummaryProperties UpdateSummaryProperties + err = json.Unmarshal(*v, &updateSummaryProperties) + if err != nil { + return err + } + us.UpdateSummaryProperties = &updateSummaryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + us.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + us.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + us.Type = &typeVar + } + } + } + + return nil +} + +// UpdateSummaryProperties the device update information summary. +type UpdateSummaryProperties struct { + // DeviceVersionNumber - The current version of the device in format: 1.2.17312.13.", + DeviceVersionNumber *string `json:"deviceVersionNumber,omitempty"` + // FriendlyDeviceVersionName - The current version of the device in text format. + FriendlyDeviceVersionName *string `json:"friendlyDeviceVersionName,omitempty"` + // DeviceLastScannedDateTime - The last time when a scan was done on the device. + DeviceLastScannedDateTime *date.Time `json:"deviceLastScannedDateTime,omitempty"` + // LastCompletedScanJobDateTime - The time when the last scan job was completed (success/cancelled/failed) on the appliance. + LastCompletedScanJobDateTime *date.Time `json:"lastCompletedScanJobDateTime,omitempty"` + // LastCompletedDownloadJobDateTime - READ-ONLY; The time when the last Download job was completed (success/cancelled/failed) on the appliance. + LastCompletedDownloadJobDateTime *date.Time `json:"lastCompletedDownloadJobDateTime,omitempty"` + // LastCompletedInstallJobDateTime - READ-ONLY; The time when the last Install job was completed (success/cancelled/failed) on the appliance. + LastCompletedInstallJobDateTime *date.Time `json:"lastCompletedInstallJobDateTime,omitempty"` + // TotalNumberOfUpdatesAvailable - READ-ONLY; The number of updates available for the current device version as per the last device scan. + TotalNumberOfUpdatesAvailable *int32 `json:"totalNumberOfUpdatesAvailable,omitempty"` + // TotalNumberOfUpdatesPendingDownload - READ-ONLY; The total number of items pending download. + TotalNumberOfUpdatesPendingDownload *int32 `json:"totalNumberOfUpdatesPendingDownload,omitempty"` + // TotalNumberOfUpdatesPendingInstall - READ-ONLY; The total number of items pending install. + TotalNumberOfUpdatesPendingInstall *int32 `json:"totalNumberOfUpdatesPendingInstall,omitempty"` + // RebootBehavior - READ-ONLY; Indicates if updates are available and at least one of the updates needs a reboot. Possible values include: 'NeverReboots', 'RequiresReboot', 'RequestReboot' + RebootBehavior InstallRebootBehavior `json:"rebootBehavior,omitempty"` + // OngoingUpdateOperation - READ-ONLY; The current update operation. Possible values include: 'UpdateOperationNone', 'UpdateOperationScan', 'UpdateOperationDownload', 'UpdateOperationInstall' + OngoingUpdateOperation UpdateOperation `json:"ongoingUpdateOperation,omitempty"` + // InProgressDownloadJobID - READ-ONLY; The job ID of the download job in progress. + InProgressDownloadJobID *string `json:"inProgressDownloadJobId,omitempty"` + // InProgressInstallJobID - READ-ONLY; The job ID of the install job in progress. + InProgressInstallJobID *string `json:"inProgressInstallJobId,omitempty"` + // InProgressDownloadJobStartedDateTime - READ-ONLY; The time when the currently running download (if any) started. + InProgressDownloadJobStartedDateTime *date.Time `json:"inProgressDownloadJobStartedDateTime,omitempty"` + // InProgressInstallJobStartedDateTime - READ-ONLY; The time when the currently running install (if any) started. + InProgressInstallJobStartedDateTime *date.Time `json:"inProgressInstallJobStartedDateTime,omitempty"` + // UpdateTitles - READ-ONLY; The list of updates available for install. + UpdateTitles *[]string `json:"updateTitles,omitempty"` + // TotalUpdateSizeInBytes - READ-ONLY; The total size of updates available for download in bytes. + TotalUpdateSizeInBytes *float64 `json:"totalUpdateSizeInBytes,omitempty"` +} + +// UploadCertificateRequest the upload certificate request. +type UploadCertificateRequest struct { + // RawCertificateData - The Base 64 encoded certificate raw data. + *RawCertificateData `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UploadCertificateRequest. +func (ucr UploadCertificateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ucr.RawCertificateData != nil { + objectMap["properties"] = ucr.RawCertificateData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UploadCertificateRequest struct. +func (ucr *UploadCertificateRequest) 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 rawCertificateData RawCertificateData + err = json.Unmarshal(*v, &rawCertificateData) + if err != nil { + return err + } + ucr.RawCertificateData = &rawCertificateData + } + } + } + + return nil +} + +// UploadCertificateResponse the upload registration certificate response. +type UploadCertificateResponse struct { + autorest.Response `json:"-"` + // AuthType - Specifies authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory' + AuthType AuthenticationType `json:"authType,omitempty"` + // ResourceID - READ-ONLY; The resource ID of the Data Box Edge/Gateway device. + ResourceID *string `json:"resourceId,omitempty"` + // AadAuthority - READ-ONLY; Azure Active Directory tenant authority. + AadAuthority *string `json:"aadAuthority,omitempty"` + // AadTenantID - READ-ONLY; Azure Active Directory tenant ID. + AadTenantID *string `json:"aadTenantId,omitempty"` + // ServicePrincipalClientID - READ-ONLY; Azure Active Directory service principal client ID. + ServicePrincipalClientID *string `json:"servicePrincipalClientId,omitempty"` + // ServicePrincipalObjectID - READ-ONLY; Azure Active Directory service principal object ID. + ServicePrincipalObjectID *string `json:"servicePrincipalObjectId,omitempty"` + // AzureManagementEndpointAudience - READ-ONLY; The azure management endpoint audience. + AzureManagementEndpointAudience *string `json:"azureManagementEndpointAudience,omitempty"` + // AadAudience - READ-ONLY; Identifier of the target resource that is the recipient of the requested token. + AadAudience *string `json:"aadAudience,omitempty"` +} + +// User represents a user who has access to one or more shares on the Data Box Edge/Gateway device. +type User struct { + autorest.Response `json:"-"` + // UserProperties - The storage account credential properties. + *UserProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The path ID that uniquely identifies the object. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The object name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The hierarchical type of the object. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for User. +func (u User) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.UserProperties != nil { + objectMap["properties"] = u.UserProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for User struct. +func (u *User) 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 userProperties UserProperties + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + u.UserProperties = &userProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + u.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + u.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + u.Type = &typeVar + } + } + } + + return nil +} + +// UserAccessRight the mapping between a particular user and the access type on the SMB share. +type UserAccessRight struct { + // UserID - User ID (already existing in the device). + UserID *string `json:"userId,omitempty"` + // AccessType - Type of access to be allowed for the user. Possible values include: 'Change', 'Read', 'Custom' + AccessType ShareAccessType `json:"accessType,omitempty"` +} + +// UserList collection of users. +type UserList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of users. + Value *[]User `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UserListIterator provides access to a complete listing of User values. +type UserListIterator struct { + i int + page UserListPage +} + +// 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 *UserListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListIterator.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 *UserListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UserListIterator) 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 UserListIterator) Response() UserList { + 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 UserListIterator) Value() User { + if !iter.page.NotDone() { + return User{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UserListIterator type. +func NewUserListIterator(page UserListPage) UserListIterator { + return UserListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ul UserList) IsEmpty() bool { + return ul.Value == nil || len(*ul.Value) == 0 +} + +// userListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ul UserList) userListPreparer(ctx context.Context) (*http.Request, error) { + if ul.NextLink == nil || len(to.String(ul.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ul.NextLink))) +} + +// UserListPage contains a page of User values. +type UserListPage struct { + fn func(context.Context, UserList) (UserList, error) + ul UserList +} + +// 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 *UserListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListPage.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.ul) + if err != nil { + return err + } + page.ul = 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 *UserListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UserListPage) NotDone() bool { + return !page.ul.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UserListPage) Response() UserList { + return page.ul +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UserListPage) Values() []User { + if page.ul.IsEmpty() { + return nil + } + return *page.ul.Value +} + +// Creates a new instance of the UserListPage type. +func NewUserListPage(getNextPage func(context.Context, UserList) (UserList, error)) UserListPage { + return UserListPage{fn: getNextPage} +} + +// UserProperties the user properties. +type UserProperties struct { + // EncryptedPassword - The password details. + EncryptedPassword *AsymmetricEncryptedSecret `json:"encryptedPassword,omitempty"` + // ShareAccessRights - List of shares that the user has rights on. This field should not be specified during user creation. + ShareAccessRights *[]ShareAccessRight `json:"shareAccessRights,omitempty"` + // UserType - Type of the user. Possible values include: 'UserTypeShare', 'UserTypeLocalManagement', 'UserTypeARM' + UserType UserType `json:"userType,omitempty"` +} + +// UsersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type UsersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *UsersCreateOrUpdateFuture) Result(client UsersClient) (u User, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.UsersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { + u, err = client.CreateOrUpdateResponder(u.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersCreateOrUpdateFuture", "Result", u.Response.Response, "Failure responding to request") + } + } + return +} + +// UsersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type UsersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *UsersDeleteFuture) Result(client UsersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databoxedge.UsersDeleteFuture") + return + } + ar.Response = future.Response() + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/nodes.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/nodes.go new file mode 100644 index 000000000000..088bfc06da0c --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/nodes.go @@ -0,0 +1,118 @@ +package databoxedge + +// 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" +) + +// NodesClient is the client for the Nodes methods of the Databoxedge service. +type NodesClient struct { + BaseClient +} + +// NewNodesClient creates an instance of the NodesClient client. +func NewNodesClient(subscriptionID string) NodesClient { + return NewNodesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNodesClientWithBaseURI creates an instance of the NodesClient client. +func NewNodesClientWithBaseURI(baseURI string, subscriptionID string) NodesClient { + return NodesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByDataBoxEdgeDevice gets all the nodes currently configured under this Data Box Edge device +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client NodesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result NodeList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NodesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.NodesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.NodesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.NodesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client NodesClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client NodesClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client NodesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result NodeList, 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/databoxedge/mgmt/2019-08-01/databoxedge/operations.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/operations.go new file mode 100644 index 000000000000..2489a2c89838 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/operations.go @@ -0,0 +1,147 @@ +package databoxedge + +// 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 client for the Operations methods of the Databoxedge service. +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 sends the list request. +func (client OperationsClient) List(ctx context.Context) (result OperationsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.ol.Response.Response != nil { + sc = result.ol.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.ol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.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-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DataBoxEdge/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 OperationsList, 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 OperationsList) (result OperationsList, err error) { + req, err := lastResults.operationsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.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, "databoxedge.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.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 OperationsListIterator, 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/databoxedge/mgmt/2019-08-01/databoxedge/operationsstatus.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/operationsstatus.go new file mode 100644 index 000000000000..e59dc248475e --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/operationsstatus.go @@ -0,0 +1,120 @@ +package databoxedge + +// 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" +) + +// OperationsStatusClient is the client for the OperationsStatus methods of the Databoxedge service. +type OperationsStatusClient struct { + BaseClient +} + +// NewOperationsStatusClient creates an instance of the OperationsStatusClient client. +func NewOperationsStatusClient(subscriptionID string) OperationsStatusClient { + return NewOperationsStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsStatusClientWithBaseURI creates an instance of the OperationsStatusClient client. +func NewOperationsStatusClientWithBaseURI(baseURI string, subscriptionID string) OperationsStatusClient { + return OperationsStatusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// name - the job name. +// resourceGroupName - the resource group name. +func (client OperationsStatusClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsStatusClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OperationsStatusClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationsStatusClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}", 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 OperationsStatusClient) 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 OperationsStatusClient) GetResponder(resp *http.Response) (result Job, 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/databoxedge/mgmt/2019-08-01/databoxedge/orders.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/orders.go new file mode 100644 index 000000000000..1d072dac306a --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/orders.go @@ -0,0 +1,410 @@ +package databoxedge + +// 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" +) + +// OrdersClient is the client for the Orders methods of the Databoxedge service. +type OrdersClient struct { + BaseClient +} + +// NewOrdersClient creates an instance of the OrdersClient client. +func NewOrdersClient(subscriptionID string) OrdersClient { + return NewOrdersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOrdersClientWithBaseURI creates an instance of the OrdersClient client. +func NewOrdersClientWithBaseURI(baseURI string, subscriptionID string) OrdersClient { + return OrdersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// deviceName - the order details of a device. +// order - the order to be created or updated. +// resourceGroupName - the resource group name. +func (client OrdersClient) CreateOrUpdate(ctx context.Context, deviceName string, order Order, resourceGroupName string) (result OrdersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: order, + Constraints: []validation.Constraint{{Target: "order.OrderProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "order.OrderProperties.ContactInformation", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "order.OrderProperties.ContactInformation.ContactPerson", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ContactInformation.CompanyName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ContactInformation.Phone", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ContactInformation.EmailList", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "order.OrderProperties.ShippingAddress", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "order.OrderProperties.ShippingAddress.AddressLine1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ShippingAddress.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ShippingAddress.City", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ShippingAddress.State", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "order.OrderProperties.ShippingAddress.Country", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.OrdersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, order, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client OrdersClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, order Order, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", pathParameters), + autorest.WithJSON(order), + 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 OrdersClient) CreateOrUpdateSender(req *http.Request) (future OrdersCreateOrUpdateFuture, 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 OrdersClient) CreateOrUpdateResponder(resp *http.Response) (result Order, 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 sends the delete request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client OrdersClient) Delete(ctx context.Context, deviceName string, resourceGroupName string) (result OrdersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OrdersClient) DeletePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", 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 OrdersClient) DeleteSender(req *http.Request) (future OrdersDeleteFuture, 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 OrdersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client OrdersClient) Get(ctx context.Context, deviceName string, resourceGroupName string) (result Order, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.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, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OrdersClient) GetPreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", 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 OrdersClient) 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 OrdersClient) GetResponder(resp *http.Response) (result Order, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice sends the list by data box edge device request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client OrdersClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result OrderListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.ol.Response.Response != nil { + sc = result.ol.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.ol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.ol, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client OrdersClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client OrdersClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client OrdersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result OrderList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client OrdersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults OrderList) (result OrderList, err error) { + req, err := lastResults.orderListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.OrdersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client OrdersClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result OrderListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OrdersClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/roles.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/roles.go new file mode 100644 index 000000000000..15ae9ad57184 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/roles.go @@ -0,0 +1,395 @@ +package databoxedge + +// 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" +) + +// RolesClient is the client for the Roles methods of the Databoxedge service. +type RolesClient struct { + BaseClient +} + +// NewRolesClient creates an instance of the RolesClient client. +func NewRolesClient(subscriptionID string) RolesClient { + return NewRolesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRolesClientWithBaseURI creates an instance of the RolesClient client. +func NewRolesClientWithBaseURI(baseURI string, subscriptionID string) RolesClient { + return RolesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a role. +// Parameters: +// deviceName - the device name. +// name - the role name. +// role - the role properties. +// resourceGroupName - the resource group name. +func (client RolesClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, role BasicRole, resourceGroupName string) (result RolesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, role, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RolesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, role BasicRole, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", pathParameters), + autorest.WithJSON(role), + 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 RolesClient) CreateOrUpdateSender(req *http.Request) (future RolesCreateOrUpdateFuture, 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 RolesClient) CreateOrUpdateResponder(resp *http.Response) (result RoleModel, 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 deletes the role on the device. +// Parameters: +// deviceName - the device name. +// name - the role name. +// resourceGroupName - the resource group name. +func (client RolesClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result RolesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RolesClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", 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 RolesClient) DeleteSender(req *http.Request) (future RolesDeleteFuture, 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 RolesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a specific role by name. +// Parameters: +// deviceName - the device name. +// name - the role name. +// resourceGroupName - the resource group name. +func (client RolesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result RoleModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RolesClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", 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 RolesClient) 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 RolesClient) GetResponder(resp *http.Response) (result RoleModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice lists all the roles configured in a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client RolesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result RoleListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.rl.Response.Response != nil { + sc = result.rl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.rl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.rl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client RolesClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client RolesClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client RolesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result RoleList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client RolesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults RoleList) (result RoleList, err error) { + req, err := lastResults.roleListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.RolesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client RolesClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result RoleListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RolesClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/shares.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/shares.go new file mode 100644 index 000000000000..707eb0279167 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/shares.go @@ -0,0 +1,485 @@ +package databoxedge + +// 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" +) + +// SharesClient is the client for the Shares methods of the Databoxedge service. +type SharesClient struct { + BaseClient +} + +// NewSharesClient creates an instance of the SharesClient client. +func NewSharesClient(subscriptionID string) SharesClient { + return NewSharesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSharesClientWithBaseURI creates an instance of the SharesClient client. +func NewSharesClientWithBaseURI(baseURI string, subscriptionID string) SharesClient { + return SharesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// deviceName - the device name. +// name - the share name. +// share - the share properties. +// resourceGroupName - the resource group name. +func (client SharesClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, share Share, resourceGroupName string) (result SharesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: share, + Constraints: []validation.Constraint{{Target: "share.ShareProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "share.ShareProperties.AzureContainerInfo", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "share.ShareProperties.AzureContainerInfo.StorageAccountCredentialID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "share.ShareProperties.AzureContainerInfo.ContainerName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.SharesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, share, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SharesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, share Share, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", pathParameters), + autorest.WithJSON(share), + 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 SharesClient) CreateOrUpdateSender(req *http.Request) (future SharesCreateOrUpdateFuture, 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 SharesClient) CreateOrUpdateResponder(resp *http.Response) (result Share, 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 deletes the share on the Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// name - the share name. +// resourceGroupName - the resource group name. +func (client SharesClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result SharesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SharesClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", 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 SharesClient) DeleteSender(req *http.Request) (future SharesDeleteFuture, 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 SharesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// name - the share name. +// resourceGroupName - the resource group name. +func (client SharesClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result Share, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SharesClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", 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 SharesClient) 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 SharesClient) GetResponder(resp *http.Response) (result Share, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice sends the list by data box edge device request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client SharesClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result ShareListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.sl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client SharesClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client SharesClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result ShareList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client SharesClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults ShareList) (result ShareList, err error) { + req, err := lastResults.shareListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharesClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result ShareListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} + +// Refresh sends the refresh request. +// Parameters: +// deviceName - the device name. +// name - the share name. +// resourceGroupName - the resource group name. +func (client SharesClient) Refresh(ctx context.Context, deviceName string, name string, resourceGroupName string) (result SharesRefreshFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.Refresh") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RefreshPreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Refresh", nil, "Failure preparing request") + return + } + + result, err = client.RefreshSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SharesClient", "Refresh", result.Response(), "Failure sending request") + return + } + + return +} + +// RefreshPreparer prepares the Refresh request. +func (client SharesClient) RefreshPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RefreshSender sends the Refresh request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) RefreshSender(req *http.Request) (future SharesRefreshFuture, 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 +} + +// RefreshResponder handles the response to the Refresh request. The method always +// closes the http.Response Body. +func (client SharesClient) RefreshResponder(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 +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/skus.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/skus.go new file mode 100644 index 000000000000..e93e4f5b2c60 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/skus.go @@ -0,0 +1,118 @@ +package databoxedge + +// 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" +) + +// SkusClient is the client for the Skus methods of the Databoxedge service. +type SkusClient struct { + BaseClient +} + +// NewSkusClient creates an instance of the SkusClient client. +func NewSkusClient(subscriptionID string) SkusClient { + return NewSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSkusClientWithBaseURI creates an instance of the SkusClient client. +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return SkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List sends the list request. +// Parameters: +// filter - specify $filter='location eq ' to filter on location. +func (client SkusClient) List(ctx context.Context, filter string) (result SkuInformationList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.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, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SkusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.SkusClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.SkusClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SkusClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/skus", 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 SkusClient) 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 SkusClient) ListResponder(resp *http.Response) (result SkuInformationList, 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/databoxedge/mgmt/2019-08-01/databoxedge/storageaccountcredentials.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/storageaccountcredentials.go new file mode 100644 index 000000000000..6f0be6351e0e --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/storageaccountcredentials.go @@ -0,0 +1,406 @@ +package databoxedge + +// 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" +) + +// StorageAccountCredentialsClient is the client for the StorageAccountCredentials methods of the Databoxedge service. +type StorageAccountCredentialsClient struct { + BaseClient +} + +// NewStorageAccountCredentialsClient creates an instance of the StorageAccountCredentialsClient client. +func NewStorageAccountCredentialsClient(subscriptionID string) StorageAccountCredentialsClient { + return NewStorageAccountCredentialsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStorageAccountCredentialsClientWithBaseURI creates an instance of the StorageAccountCredentialsClient client. +func NewStorageAccountCredentialsClientWithBaseURI(baseURI string, subscriptionID string) StorageAccountCredentialsClient { + return StorageAccountCredentialsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the storage account credential. +// Parameters: +// deviceName - the device name. +// name - the storage account credential name. +// storageAccountCredential - the storage account credential. +// resourceGroupName - the resource group name. +func (client StorageAccountCredentialsClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, storageAccountCredential StorageAccountCredential, resourceGroupName string) (result StorageAccountCredentialsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccountCredential, + Constraints: []validation.Constraint{{Target: "storageAccountCredential.StorageAccountCredentialProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "storageAccountCredential.StorageAccountCredentialProperties.Alias", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "storageAccountCredential.StorageAccountCredentialProperties.AccountKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storageAccountCredential.StorageAccountCredentialProperties.AccountKey.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, storageAccountCredential, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client StorageAccountCredentialsClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, storageAccountCredential StorageAccountCredential, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", pathParameters), + autorest.WithJSON(storageAccountCredential), + 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 StorageAccountCredentialsClient) CreateOrUpdateSender(req *http.Request) (future StorageAccountCredentialsCreateOrUpdateFuture, 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 StorageAccountCredentialsClient) CreateOrUpdateResponder(resp *http.Response) (result StorageAccountCredential, 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 deletes the storage account credential. +// Parameters: +// deviceName - the device name. +// name - the storage account credential name. +// resourceGroupName - the resource group name. +func (client StorageAccountCredentialsClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result StorageAccountCredentialsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StorageAccountCredentialsClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", 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 StorageAccountCredentialsClient) DeleteSender(req *http.Request) (future StorageAccountCredentialsDeleteFuture, 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 StorageAccountCredentialsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified storage account credential. +// Parameters: +// deviceName - the device name. +// name - the storage account credential name. +// resourceGroupName - the resource group name. +func (client StorageAccountCredentialsClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result StorageAccountCredential, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client StorageAccountCredentialsClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", 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 StorageAccountCredentialsClient) 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 StorageAccountCredentialsClient) GetResponder(resp *http.Response) (result StorageAccountCredential, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice sends the list by data box edge device request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result StorageAccountCredentialListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.sacl.Response.Response != nil { + sc = result.sacl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.sacl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.sacl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result StorageAccountCredentialList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client StorageAccountCredentialsClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults StorageAccountCredentialList) (result StorageAccountCredentialList, err error) { + req, err := lastResults.storageAccountCredentialListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountCredentialsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client StorageAccountCredentialsClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result StorageAccountCredentialListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountCredentialsClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/storageaccounts.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/storageaccounts.go new file mode 100644 index 000000000000..a23c9eed1a14 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/storageaccounts.go @@ -0,0 +1,402 @@ +package databoxedge + +// 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" +) + +// StorageAccountsClient is the client for the StorageAccounts methods of the Databoxedge service. +type StorageAccountsClient struct { + BaseClient +} + +// NewStorageAccountsClient creates an instance of the StorageAccountsClient client. +func NewStorageAccountsClient(subscriptionID string) StorageAccountsClient { + return NewStorageAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStorageAccountsClientWithBaseURI creates an instance of the StorageAccountsClient client. +func NewStorageAccountsClientWithBaseURI(baseURI string, subscriptionID string) StorageAccountsClient { + return StorageAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// deviceName - the device name. +// storageAccountName - the StorageAccount name. +// storageAccount - the StorageAccount properties. +// resourceGroupName - the resource group name. +func (client StorageAccountsClient) CreateOrUpdate(ctx context.Context, deviceName string, storageAccountName string, storageAccount StorageAccount, resourceGroupName string) (result StorageAccountsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: storageAccount, + Constraints: []validation.Constraint{{Target: "storageAccount.StorageAccountProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("databoxedge.StorageAccountsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, storageAccountName, storageAccount, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client StorageAccountsClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, storageAccountName string, storageAccount StorageAccount, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageAccountName": autorest.Encode("path", storageAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", pathParameters), + autorest.WithJSON(storageAccount), + 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 StorageAccountsClient) CreateOrUpdateSender(req *http.Request) (future StorageAccountsCreateOrUpdateFuture, 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 StorageAccountsClient) CreateOrUpdateResponder(resp *http.Response) (result StorageAccount, 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 deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// storageAccountName - the StorageAccount name. +// resourceGroupName - the resource group name. +func (client StorageAccountsClient) Delete(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (result StorageAccountsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, storageAccountName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StorageAccountsClient) DeletePreparer(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageAccountName": autorest.Encode("path", storageAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", 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 StorageAccountsClient) DeleteSender(req *http.Request) (future StorageAccountsDeleteFuture, 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 StorageAccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// deviceName - the device name. +// storageAccountName - the storage account name. +// resourceGroupName - the resource group name. +func (client StorageAccountsClient) Get(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (result StorageAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountsClient.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, deviceName, storageAccountName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client StorageAccountsClient) GetPreparer(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageAccountName": autorest.Encode("path", storageAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", 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 StorageAccountsClient) 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 StorageAccountsClient) GetResponder(resp *http.Response) (result StorageAccount, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice sends the list by data box edge device request. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +func (client StorageAccountsClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string) (result StorageAccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountsClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.sal.Response.Response != nil { + sc = result.sal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.sal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.sal, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client StorageAccountsClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client StorageAccountsClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client StorageAccountsClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result StorageAccountList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client StorageAccountsClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults StorageAccountList) (result StorageAccountList, err error) { + req, err := lastResults.storageAccountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.StorageAccountsClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client StorageAccountsClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string) (result StorageAccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageAccountsClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName) + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/triggers.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/triggers.go new file mode 100644 index 000000000000..ff022cb26f31 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/triggers.go @@ -0,0 +1,399 @@ +package databoxedge + +// 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" +) + +// TriggersClient is the client for the Triggers methods of the Databoxedge service. +type TriggersClient struct { + BaseClient +} + +// NewTriggersClient creates an instance of the TriggersClient client. +func NewTriggersClient(subscriptionID string) TriggersClient { + return NewTriggersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTriggersClientWithBaseURI creates an instance of the TriggersClient client. +func NewTriggersClientWithBaseURI(baseURI string, subscriptionID string) TriggersClient { + return TriggersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a trigger. +// Parameters: +// deviceName - creates or updates a trigger +// name - the trigger name. +// trigger - the trigger. +// resourceGroupName - the resource group name. +func (client TriggersClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, trigger BasicTrigger, resourceGroupName string) (result TriggersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, trigger, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client TriggersClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, trigger BasicTrigger, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", pathParameters), + autorest.WithJSON(trigger), + 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 TriggersClient) CreateOrUpdateSender(req *http.Request) (future TriggersCreateOrUpdateFuture, 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 TriggersClient) CreateOrUpdateResponder(resp *http.Response) (result TriggerModel, 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 deletes the trigger on the gateway device. +// Parameters: +// deviceName - the device name. +// name - the trigger name. +// resourceGroupName - the resource group name. +func (client TriggersClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result TriggersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TriggersClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", 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 TriggersClient) DeleteSender(req *http.Request) (future TriggersDeleteFuture, 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 TriggersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a specific trigger by name. +// Parameters: +// deviceName - the device name. +// name - the trigger name. +// resourceGroupName - the resource group name. +func (client TriggersClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result TriggerModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TriggersClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", 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 TriggersClient) 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 TriggersClient) GetResponder(resp *http.Response) (result TriggerModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice lists all the triggers configured in the device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +// filter - specify $filter='CustomContextTag eq ' to filter on custom context tag property +func (client TriggersClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string, filter string) (result TriggerListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.tl.Response.Response != nil { + sc = result.tl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.tl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.tl, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client TriggersClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client TriggersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result TriggerList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client TriggersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults TriggerList) (result TriggerList, err error) { + req, err := lastResults.triggerListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.TriggersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client TriggersClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string, filter string) (result TriggerListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName, filter) + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/users.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/users.go new file mode 100644 index 000000000000..88ae1bdea0e9 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/users.go @@ -0,0 +1,410 @@ +package databoxedge + +// 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" +) + +// UsersClient is the client for the Users methods of the Databoxedge service. +type UsersClient struct { + BaseClient +} + +// NewUsersClient creates an instance of the UsersClient client. +func NewUsersClient(subscriptionID string) UsersClient { + return NewUsersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsersClientWithBaseURI creates an instance of the UsersClient client. +func NewUsersClientWithBaseURI(baseURI string, subscriptionID string) UsersClient { + return UsersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway +// device. +// Parameters: +// deviceName - the device name. +// name - the user name. +// userParameter - the user details. +// resourceGroupName - the resource group name. +func (client UsersClient) CreateOrUpdate(ctx context.Context, deviceName string, name string, userParameter User, resourceGroupName string) (result UsersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: userParameter, + Constraints: []validation.Constraint{{Target: "userParameter.UserProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "userParameter.UserProperties.EncryptedPassword", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "userParameter.UserProperties.EncryptedPassword.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("databoxedge.UsersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, deviceName, name, userParameter, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client UsersClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, name string, userParameter User, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", pathParameters), + autorest.WithJSON(userParameter), + 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 UsersClient) CreateOrUpdateSender(req *http.Request) (future UsersCreateOrUpdateFuture, 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 UsersClient) CreateOrUpdateResponder(resp *http.Response) (result User, 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 deletes the user on a databox edge/gateway device. +// Parameters: +// deviceName - the device name. +// name - the user name. +// resourceGroupName - the resource group name. +func (client UsersClient) Delete(ctx context.Context, deviceName string, name string, resourceGroupName string) (result UsersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client UsersClient) DeletePreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", 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 UsersClient) DeleteSender(req *http.Request) (future UsersDeleteFuture, 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 UsersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified user. +// Parameters: +// deviceName - the device name. +// name - the user name. +// resourceGroupName - the resource group name. +func (client UsersClient) Get(ctx context.Context, deviceName string, name string, resourceGroupName string) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.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, deviceName, name, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client UsersClient) GetPreparer(ctx context.Context, deviceName string, name string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", 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 UsersClient) 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 UsersClient) GetResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDataBoxEdgeDevice gets all the users registered on a Data Box Edge/Data Box Gateway device. +// Parameters: +// deviceName - the device name. +// resourceGroupName - the resource group name. +// filter - specify $filter='UserType eq ' to filter on user type property +func (client UsersClient) ListByDataBoxEdgeDevice(ctx context.Context, deviceName string, resourceGroupName string, filter string) (result UserListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListByDataBoxEdgeDevice") + defer func() { + sc := -1 + if result.ul.Response.Response != nil { + sc = result.ul.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDataBoxEdgeDeviceNextResults + req, err := client.ListByDataBoxEdgeDevicePreparer(ctx, deviceName, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.ul.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", resp, "Failure sending request") + return + } + + result.ul, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "ListByDataBoxEdgeDevice", resp, "Failure responding to request") + } + + return +} + +// ListByDataBoxEdgeDevicePreparer prepares the ListByDataBoxEdgeDevice request. +func (client UsersClient) ListByDataBoxEdgeDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceName": autorest.Encode("path", deviceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-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/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDataBoxEdgeDeviceSender sends the ListByDataBoxEdgeDevice request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) ListByDataBoxEdgeDeviceSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByDataBoxEdgeDeviceResponder handles the response to the ListByDataBoxEdgeDevice request. The method always +// closes the http.Response Body. +func (client UsersClient) ListByDataBoxEdgeDeviceResponder(resp *http.Response) (result UserList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDataBoxEdgeDeviceNextResults retrieves the next set of results, if any. +func (client UsersClient) listByDataBoxEdgeDeviceNextResults(ctx context.Context, lastResults UserList) (result UserList, err error) { + req, err := lastResults.userListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDataBoxEdgeDeviceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDataBoxEdgeDeviceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databoxedge.UsersClient", "listByDataBoxEdgeDeviceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDataBoxEdgeDeviceComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsersClient) ListByDataBoxEdgeDeviceComplete(ctx context.Context, deviceName string, resourceGroupName string, filter string) (result UserListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListByDataBoxEdgeDevice") + 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.ListByDataBoxEdgeDevice(ctx, deviceName, resourceGroupName, filter) + return +} diff --git a/services/databoxedge/mgmt/2019-08-01/databoxedge/version.go b/services/databoxedge/mgmt/2019-08-01/databoxedge/version.go new file mode 100644 index 000000000000..b66fbef12e18 --- /dev/null +++ b/services/databoxedge/mgmt/2019-08-01/databoxedge/version.go @@ -0,0 +1,30 @@ +package databoxedge + +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 + " databoxedge/2019-08-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/databricks/mgmt/2018-04-01/databricks/models.go b/services/databricks/mgmt/2018-04-01/databricks/models.go index 706798de28bc..590f03bb1d5b 100644 --- a/services/databricks/mgmt/2018-04-01/databricks/models.go +++ b/services/databricks/mgmt/2018-04-01/databricks/models.go @@ -31,6 +31,23 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/databricks/mgmt/2018-04-01/databricks" +// CustomParameterType enumerates the values for custom parameter type. +type CustomParameterType string + +const ( + // Bool ... + Bool CustomParameterType = "Bool" + // Object ... + Object CustomParameterType = "Object" + // String ... + String CustomParameterType = "String" +) + +// PossibleCustomParameterTypeValues returns an array of possible values for the CustomParameterType const type. +func PossibleCustomParameterTypeValues() []CustomParameterType { + return []CustomParameterType{Bool, Object, String} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -416,6 +433,58 @@ func (w *Workspace) UnmarshalJSON(body []byte) error { return nil } +// WorkspaceCustomBooleanParameter the value which should be used for this field. +type WorkspaceCustomBooleanParameter struct { + // Type - The type of variable that this is. Possible values include: 'Bool', 'Object', 'String' + Type CustomParameterType `json:"type,omitempty"` + // Value - The value which should be used for this field. + Value *bool `json:"value,omitempty"` +} + +// WorkspaceCustomObjectParameter the value which should be used for this field. +type WorkspaceCustomObjectParameter struct { + // Type - The type of variable that this is. Possible values include: 'Bool', 'Object', 'String' + Type CustomParameterType `json:"type,omitempty"` + // Value - The value which should be used for this field. + Value interface{} `json:"value,omitempty"` +} + +// WorkspaceCustomParameters custom Parameters used for Cluster Creation. +type WorkspaceCustomParameters struct { + // AmlWorkspaceID - The Workspace ID of an Azure Machine Learning Workspace + AmlWorkspaceID *WorkspaceCustomStringParameter `json:"amlWorkspaceId,omitempty"` + // CustomVirtualNetworkID - The ID of a Virtual Network where this Databricks Cluster should be created + CustomVirtualNetworkID *WorkspaceCustomStringParameter `json:"customVirtualNetworkId,omitempty"` + // CustomPublicSubnetName - The name of a Public Subnet within the Virtual Network + CustomPublicSubnetName *WorkspaceCustomStringParameter `json:"customPublicSubnetName,omitempty"` + // CustomPrivateSubnetName - The name of the Private Subnet within the Virtual Network + CustomPrivateSubnetName *WorkspaceCustomStringParameter `json:"customPrivateSubnetName,omitempty"` + // EnableNoPublicIP - Should the Public IP be Disabled? + EnableNoPublicIP *WorkspaceCustomBooleanParameter `json:"enableNoPublicIp,omitempty"` + // LoadBalancerBackendPoolName - The name of a Backend Address Pool within an Azure Load Balancer + LoadBalancerBackendPoolName *WorkspaceCustomStringParameter `json:"loadBalancerBackendPoolName,omitempty"` + // LoadBalancerID - The Resource ID of an Azure Load Balancer + LoadBalancerID *WorkspaceCustomStringParameter `json:"loadBalancerId,omitempty"` + // RelayNamespaceName - The name of an Azure Relay Namespace + RelayNamespaceName *WorkspaceCustomStringParameter `json:"relayNamespaceName,omitempty"` + // StorageAccountName - The name which should be used for the Storage Account + StorageAccountName *WorkspaceCustomStringParameter `json:"storageAccountName,omitempty"` + // StorageAccountSkuName - The SKU which should be used for this Storage Account + StorageAccountSkuName *WorkspaceCustomStringParameter `json:"storageAccountSkuName,omitempty"` + // ResourceTags - A map of Tags which should be applied to the resources used by this Databricks Cluster. + ResourceTags *WorkspaceCustomObjectParameter `json:"resourceTags,omitempty"` + // VnetAddressPrefix - The first 2 octets of the virtual network /16 address range (e.g., '10.139' for the address range 10.139.0.0/16). + VnetAddressPrefix *WorkspaceCustomStringParameter `json:"vnetAddressPrefix,omitempty"` +} + +// WorkspaceCustomStringParameter the Value. +type WorkspaceCustomStringParameter struct { + // Type - The type of variable that this is. Possible values include: 'Bool', 'Object', 'String' + Type CustomParameterType `json:"type,omitempty"` + // Value - The value which should be used for this field. + Value *string `json:"value,omitempty"` +} + // WorkspaceListResult list of workspaces. type WorkspaceListResult struct { autorest.Response `json:"-"` @@ -566,8 +635,8 @@ func NewWorkspaceListResultPage(getNextPage func(context.Context, WorkspaceListR type WorkspaceProperties struct { // ManagedResourceGroupID - The managed resource group Id. ManagedResourceGroupID *string `json:"managedResourceGroupId,omitempty"` - // Parameters - Name and value pairs that define the workspace parameters. - Parameters interface{} `json:"parameters,omitempty"` + // Parameters - The workspace's custom parameters. + Parameters *WorkspaceCustomParameters `json:"parameters,omitempty"` // ProvisioningState - READ-ONLY; The workspace provisioning state. Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // UIDefinitionURI - The blob URI where the UI definition file is located. diff --git a/services/databricks/mgmt/2018-04-01/databricks/workspaces.go b/services/databricks/mgmt/2018-04-01/databricks/workspaces.go index ca6c1c7692e1..cc9d858d1887 100644 --- a/services/databricks/mgmt/2018-04-01/databricks/workspaces.go +++ b/services/databricks/mgmt/2018-04-01/databricks/workspaces.go @@ -60,7 +60,34 @@ func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, parameters Wo if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.WorkspaceProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.ManagedResourceGroupID", Name: validation.Null, Rule: true, Chain: nil}}}, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.ManagedResourceGroupID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.WorkspaceProperties.Parameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.AmlWorkspaceID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.AmlWorkspaceID.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.CustomVirtualNetworkID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.CustomVirtualNetworkID.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.CustomPublicSubnetName", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.CustomPublicSubnetName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.CustomPrivateSubnetName", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.CustomPrivateSubnetName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.EnableNoPublicIP", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.EnableNoPublicIP.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.LoadBalancerBackendPoolName", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.LoadBalancerBackendPoolName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.LoadBalancerID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.LoadBalancerID.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.RelayNamespaceName", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.RelayNamespaceName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.StorageAccountName", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.StorageAccountName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.StorageAccountSkuName", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.StorageAccountSkuName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.ResourceTags", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.ResourceTags.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.VnetAddressPrefix", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.VnetAddressPrefix.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}, {Target: "parameters.Sku", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}, {TargetValue: resourceGroupName, diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go index 15067fbbca5e..38c61ca058a8 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/models.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -2017,6 +2017,41 @@ func PossibleTypeBasicDatasetCompressionValues() []TypeBasicDatasetCompression { return []TypeBasicDatasetCompression{TypeBZip2, TypeDatasetCompression, TypeDeflate, TypeGZip, TypeZipDeflate} } +// TypeBasicDatasetLocation enumerates the values for type basic dataset location. +type TypeBasicDatasetLocation string + +const ( + // TypeAmazonS3Location ... + TypeAmazonS3Location TypeBasicDatasetLocation = "AmazonS3Location" + // TypeAzureBlobFSLocation ... + TypeAzureBlobFSLocation TypeBasicDatasetLocation = "AzureBlobFSLocation" + // TypeAzureBlobStorageLocation ... + TypeAzureBlobStorageLocation TypeBasicDatasetLocation = "AzureBlobStorageLocation" + // TypeAzureDataLakeStoreLocation ... + TypeAzureDataLakeStoreLocation TypeBasicDatasetLocation = "AzureDataLakeStoreLocation" + // TypeAzureFileStorageLocation ... + TypeAzureFileStorageLocation TypeBasicDatasetLocation = "AzureFileStorageLocation" + // TypeDatasetLocation ... + TypeDatasetLocation TypeBasicDatasetLocation = "DatasetLocation" + // TypeFileServerLocation ... + TypeFileServerLocation TypeBasicDatasetLocation = "FileServerLocation" + // TypeFtpServerLocation ... + TypeFtpServerLocation TypeBasicDatasetLocation = "FtpServerLocation" + // TypeGoogleCloudStorageLocation ... + TypeGoogleCloudStorageLocation TypeBasicDatasetLocation = "GoogleCloudStorageLocation" + // TypeHdfsLocation ... + TypeHdfsLocation TypeBasicDatasetLocation = "HdfsLocation" + // TypeHTTPServerLocation ... + TypeHTTPServerLocation TypeBasicDatasetLocation = "HttpServerLocation" + // TypeSftpLocation ... + TypeSftpLocation TypeBasicDatasetLocation = "SftpLocation" +) + +// PossibleTypeBasicDatasetLocationValues returns an array of possible values for the TypeBasicDatasetLocation const type. +func PossibleTypeBasicDatasetLocationValues() []TypeBasicDatasetLocation { + return []TypeBasicDatasetLocation{TypeAmazonS3Location, TypeAzureBlobFSLocation, TypeAzureBlobStorageLocation, TypeAzureDataLakeStoreLocation, TypeAzureFileStorageLocation, TypeDatasetLocation, TypeFileServerLocation, TypeFtpServerLocation, TypeGoogleCloudStorageLocation, TypeHdfsLocation, TypeHTTPServerLocation, TypeSftpLocation} +} + // TypeBasicDatasetStorageFormat enumerates the values for type basic dataset storage format. type TypeBasicDatasetStorageFormat string @@ -2076,6 +2111,40 @@ func PossibleTypeBasicFactoryRepoConfigurationValues() []TypeBasicFactoryRepoCon return []TypeBasicFactoryRepoConfiguration{TypeFactoryGitHubConfiguration, TypeFactoryRepoConfiguration, TypeFactoryVSTSConfiguration} } +// TypeBasicFormatReadSettings enumerates the values for type basic format read settings. +type TypeBasicFormatReadSettings string + +const ( + // TypeDelimitedTextReadSettings ... + TypeDelimitedTextReadSettings TypeBasicFormatReadSettings = "DelimitedTextReadSettings" + // TypeFormatReadSettings ... + TypeFormatReadSettings TypeBasicFormatReadSettings = "FormatReadSettings" +) + +// PossibleTypeBasicFormatReadSettingsValues returns an array of possible values for the TypeBasicFormatReadSettings const type. +func PossibleTypeBasicFormatReadSettingsValues() []TypeBasicFormatReadSettings { + return []TypeBasicFormatReadSettings{TypeDelimitedTextReadSettings, TypeFormatReadSettings} +} + +// TypeBasicFormatWriteSettings enumerates the values for type basic format write settings. +type TypeBasicFormatWriteSettings string + +const ( + // TypeAvroWriteSettings ... + TypeAvroWriteSettings TypeBasicFormatWriteSettings = "AvroWriteSettings" + // TypeDelimitedTextWriteSettings ... + TypeDelimitedTextWriteSettings TypeBasicFormatWriteSettings = "DelimitedTextWriteSettings" + // TypeFormatWriteSettings ... + TypeFormatWriteSettings TypeBasicFormatWriteSettings = "FormatWriteSettings" + // TypeJSONWriteSettings ... + TypeJSONWriteSettings TypeBasicFormatWriteSettings = "JsonWriteSettings" +) + +// PossibleTypeBasicFormatWriteSettingsValues returns an array of possible values for the TypeBasicFormatWriteSettings const type. +func PossibleTypeBasicFormatWriteSettingsValues() []TypeBasicFormatWriteSettings { + return []TypeBasicFormatWriteSettings{TypeAvroWriteSettings, TypeDelimitedTextWriteSettings, TypeFormatWriteSettings, TypeJSONWriteSettings} +} + // TypeBasicIntegrationRuntime enumerates the values for type basic integration runtime. type TypeBasicIntegrationRuntime string @@ -2332,6 +2401,41 @@ func PossibleTypeBasicSsisObjectMetadataValues() []TypeBasicSsisObjectMetadata { return []TypeBasicSsisObjectMetadata{TypeEnvironment, TypeFolder, TypePackage, TypeProject, TypeSsisObjectMetadata} } +// TypeBasicStoreReadSettings enumerates the values for type basic store read settings. +type TypeBasicStoreReadSettings string + +const ( + // TypeAmazonS3ReadSettings ... + TypeAmazonS3ReadSettings TypeBasicStoreReadSettings = "AmazonS3ReadSettings" + // TypeAzureBlobFSReadSettings ... + TypeAzureBlobFSReadSettings TypeBasicStoreReadSettings = "AzureBlobFSReadSettings" + // TypeAzureBlobStorageReadSettings ... + TypeAzureBlobStorageReadSettings TypeBasicStoreReadSettings = "AzureBlobStorageReadSettings" + // TypeAzureDataLakeStoreReadSettings ... + TypeAzureDataLakeStoreReadSettings TypeBasicStoreReadSettings = "AzureDataLakeStoreReadSettings" + // TypeAzureFileStorageReadSettings ... + TypeAzureFileStorageReadSettings TypeBasicStoreReadSettings = "AzureFileStorageReadSettings" + // TypeFileServerReadSettings ... + TypeFileServerReadSettings TypeBasicStoreReadSettings = "FileServerReadSettings" + // TypeFtpReadSettings ... + TypeFtpReadSettings TypeBasicStoreReadSettings = "FtpReadSettings" + // TypeGoogleCloudStorageReadSettings ... + TypeGoogleCloudStorageReadSettings TypeBasicStoreReadSettings = "GoogleCloudStorageReadSettings" + // TypeHdfsReadSettings ... + TypeHdfsReadSettings TypeBasicStoreReadSettings = "HdfsReadSettings" + // TypeHTTPReadSettings ... + TypeHTTPReadSettings TypeBasicStoreReadSettings = "HttpReadSettings" + // TypeSftpReadSettings ... + TypeSftpReadSettings TypeBasicStoreReadSettings = "SftpReadSettings" + // TypeStoreReadSettings ... + TypeStoreReadSettings TypeBasicStoreReadSettings = "StoreReadSettings" +) + +// PossibleTypeBasicStoreReadSettingsValues returns an array of possible values for the TypeBasicStoreReadSettings const type. +func PossibleTypeBasicStoreReadSettingsValues() []TypeBasicStoreReadSettings { + return []TypeBasicStoreReadSettings{TypeAmazonS3ReadSettings, TypeAzureBlobFSReadSettings, TypeAzureBlobStorageReadSettings, TypeAzureDataLakeStoreReadSettings, TypeAzureFileStorageReadSettings, TypeFileServerReadSettings, TypeFtpReadSettings, TypeGoogleCloudStorageReadSettings, TypeHdfsReadSettings, TypeHTTPReadSettings, TypeSftpReadSettings, TypeStoreReadSettings} +} + // TypeBasicStoreWriteSettings enumerates the values for type basic store write settings. type TypeBasicStoreWriteSettings string @@ -2344,13 +2448,15 @@ const ( TypeAzureDataLakeStoreWriteSettings TypeBasicStoreWriteSettings = "AzureDataLakeStoreWriteSettings" // TypeFileServerWriteSettings ... TypeFileServerWriteSettings TypeBasicStoreWriteSettings = "FileServerWriteSettings" + // TypeSftpWriteSettings ... + TypeSftpWriteSettings TypeBasicStoreWriteSettings = "SftpWriteSettings" // TypeStoreWriteSettings ... TypeStoreWriteSettings TypeBasicStoreWriteSettings = "StoreWriteSettings" ) // PossibleTypeBasicStoreWriteSettingsValues returns an array of possible values for the TypeBasicStoreWriteSettings const type. func PossibleTypeBasicStoreWriteSettingsValues() []TypeBasicStoreWriteSettings { - return []TypeBasicStoreWriteSettings{TypeAzureBlobFSWriteSettings, TypeAzureBlobStorageWriteSettings, TypeAzureDataLakeStoreWriteSettings, TypeFileServerWriteSettings, TypeStoreWriteSettings} + return []TypeBasicStoreWriteSettings{TypeAzureBlobFSWriteSettings, TypeAzureBlobStorageWriteSettings, TypeAzureDataLakeStoreWriteSettings, TypeFileServerWriteSettings, TypeSftpWriteSettings, TypeStoreWriteSettings} } // TypeBasicTrigger enumerates the values for type basic trigger. @@ -8583,16 +8689,17 @@ type AmazonS3Location struct { Version interface{} `json:"version,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AmazonS3Location. func (asl AmazonS3Location) MarshalJSON() ([]byte, error) { + asl.Type = TypeAmazonS3Location objectMap := make(map[string]interface{}) if asl.BucketName != nil { objectMap["bucketName"] = asl.BucketName @@ -8600,21 +8707,86 @@ func (asl AmazonS3Location) MarshalJSON() ([]byte, error) { if asl.Version != nil { objectMap["version"] = asl.Version } - if asl.Type != nil { - objectMap["type"] = asl.Type - } if asl.FolderPath != nil { objectMap["folderPath"] = asl.FolderPath } if asl.FileName != nil { objectMap["fileName"] = asl.FileName } + if asl.Type != "" { + objectMap["type"] = asl.Type + } for k, v := range asl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsAmazonS3Location() (*AmazonS3Location, bool) { + return &asl, true +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for AmazonS3Location. +func (asl AmazonS3Location) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &asl, true +} + // UnmarshalJSON is the custom unmarshaler for AmazonS3Location struct. func (asl *AmazonS3Location) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -8654,15 +8826,6 @@ func (asl *AmazonS3Location) UnmarshalJSON(body []byte) error { } asl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - asl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -8681,6 +8844,15 @@ func (asl *AmazonS3Location) UnmarshalJSON(body []byte) error { } asl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asl.Type = typeVar + } } } @@ -8705,14 +8877,15 @@ type AmazonS3ReadSettings struct { ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AmazonS3ReadSettings. func (asrs AmazonS3ReadSettings) MarshalJSON() ([]byte, error) { + asrs.Type = TypeAmazonS3ReadSettings objectMap := make(map[string]interface{}) if asrs.Recursive != nil { objectMap["recursive"] = asrs.Recursive @@ -8735,18 +8908,83 @@ func (asrs AmazonS3ReadSettings) MarshalJSON() ([]byte, error) { if asrs.ModifiedDatetimeEnd != nil { objectMap["modifiedDatetimeEnd"] = asrs.ModifiedDatetimeEnd } - if asrs.Type != nil { - objectMap["type"] = asrs.Type - } if asrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = asrs.MaxConcurrentConnections } + if asrs.Type != "" { + objectMap["type"] = asrs.Type + } for k, v := range asrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return &asrs, true +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for AmazonS3ReadSettings. +func (asrs AmazonS3ReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &asrs, true +} + // UnmarshalJSON is the custom unmarshaler for AmazonS3ReadSettings struct. func (asrs *AmazonS3ReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -8831,23 +9069,23 @@ func (asrs *AmazonS3ReadSettings) UnmarshalJSON(body []byte) error { } asrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - asrs.Type = &typeVar + asrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - asrs.MaxConcurrentConnections = maxConcurrentConnections + asrs.Type = typeVar } } } @@ -9807,12 +10045,53 @@ func (ad *AvroDataset) UnmarshalJSON(body []byte) error { // AvroDatasetTypeProperties avro dataset properties. type AvroDatasetTypeProperties struct { // Location - The location of the avro storage. - Location *DatasetLocation `json:"location,omitempty"` + Location BasicDatasetLocation `json:"location,omitempty"` // AvroCompressionCodec - Possible values include: 'None', 'Deflate', 'Snappy', 'Xz', 'Bzip2' AvroCompressionCodec AvroCompressionCodec `json:"avroCompressionCodec,omitempty"` AvroCompressionLevel *int32 `json:"avroCompressionLevel,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for AvroDatasetTypeProperties struct. +func (adtp *AvroDatasetTypeProperties) 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 "location": + if v != nil { + location, err := unmarshalBasicDatasetLocation(*v) + if err != nil { + return err + } + adtp.Location = location + } + case "avroCompressionCodec": + if v != nil { + var avroCompressionCodec AvroCompressionCodec + err = json.Unmarshal(*v, &avroCompressionCodec) + if err != nil { + return err + } + adtp.AvroCompressionCodec = avroCompressionCodec + } + case "avroCompressionLevel": + if v != nil { + var avroCompressionLevel int32 + err = json.Unmarshal(*v, &avroCompressionLevel) + if err != nil { + return err + } + adtp.AvroCompressionLevel = &avroCompressionLevel + } + } + } + + return nil +} + // AvroFormat the data stored in Avro format. type AvroFormat struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -10268,7 +10547,7 @@ func (as *AvroSink) UnmarshalJSON(body []byte) error { // AvroSource a copy activity Avro source. type AvroSource struct { // StoreSettings - Avro store settings. - StoreSettings *StoreReadSettings `json:"storeSettings,omitempty"` + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). @@ -10285,9 +10564,7 @@ type AvroSource struct { func (as AvroSource) MarshalJSON() ([]byte, error) { as.Type = TypeAvroSource objectMap := make(map[string]interface{}) - if as.StoreSettings != nil { - objectMap["storeSettings"] = as.StoreSettings - } + objectMap["storeSettings"] = as.StoreSettings if as.SourceRetryCount != nil { objectMap["sourceRetryCount"] = as.SourceRetryCount } @@ -10767,12 +11044,11 @@ func (as *AvroSource) UnmarshalJSON(body []byte) error { switch k { case "storeSettings": if v != nil { - var storeSettings StoreReadSettings - err = json.Unmarshal(*v, &storeSettings) + storeSettings, err := unmarshalBasicStoreReadSettings(*v) if err != nil { return err } - as.StoreSettings = &storeSettings + as.StoreSettings = storeSettings } default: if v != nil { @@ -10836,12 +11112,13 @@ type AvroWriteSettings struct { RecordNamespace *string `json:"recordNamespace,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The write setting type. - Type *string `json:"type,omitempty"` + // Type - Possible values include: 'TypeFormatWriteSettings', 'TypeJSONWriteSettings', 'TypeDelimitedTextWriteSettings', 'TypeAvroWriteSettings' + Type TypeBasicFormatWriteSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AvroWriteSettings. func (aws AvroWriteSettings) MarshalJSON() ([]byte, error) { + aws.Type = TypeAvroWriteSettings objectMap := make(map[string]interface{}) if aws.RecordName != nil { objectMap["recordName"] = aws.RecordName @@ -10849,7 +11126,7 @@ func (aws AvroWriteSettings) MarshalJSON() ([]byte, error) { if aws.RecordNamespace != nil { objectMap["recordNamespace"] = aws.RecordNamespace } - if aws.Type != nil { + if aws.Type != "" { objectMap["type"] = aws.Type } for k, v := range aws.AdditionalProperties { @@ -10858,6 +11135,31 @@ func (aws AvroWriteSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsJSONWriteSettings is the BasicFormatWriteSettings implementation for AvroWriteSettings. +func (aws AvroWriteSettings) AsJSONWriteSettings() (*JSONWriteSettings, bool) { + return nil, false +} + +// AsDelimitedTextWriteSettings is the BasicFormatWriteSettings implementation for AvroWriteSettings. +func (aws AvroWriteSettings) AsDelimitedTextWriteSettings() (*DelimitedTextWriteSettings, bool) { + return nil, false +} + +// AsAvroWriteSettings is the BasicFormatWriteSettings implementation for AvroWriteSettings. +func (aws AvroWriteSettings) AsAvroWriteSettings() (*AvroWriteSettings, bool) { + return &aws, true +} + +// AsFormatWriteSettings is the BasicFormatWriteSettings implementation for AvroWriteSettings. +func (aws AvroWriteSettings) AsFormatWriteSettings() (*FormatWriteSettings, bool) { + return nil, false +} + +// AsBasicFormatWriteSettings is the BasicFormatWriteSettings implementation for AvroWriteSettings. +func (aws AvroWriteSettings) AsBasicFormatWriteSettings() (BasicFormatWriteSettings, bool) { + return &aws, true +} + // UnmarshalJSON is the custom unmarshaler for AvroWriteSettings struct. func (aws *AvroWriteSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -10899,12 +11201,12 @@ func (aws *AvroWriteSettings) UnmarshalJSON(body []byte) error { } case "type": if v != nil { - var typeVar string + var typeVar TypeBasicFormatWriteSettings err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - aws.Type = &typeVar + aws.Type = typeVar } } } @@ -13683,35 +13985,101 @@ type AzureBlobFSLocation struct { FileSystem interface{} `json:"fileSystem,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AzureBlobFSLocation. func (abfl AzureBlobFSLocation) MarshalJSON() ([]byte, error) { + abfl.Type = TypeAzureBlobFSLocation objectMap := make(map[string]interface{}) if abfl.FileSystem != nil { objectMap["fileSystem"] = abfl.FileSystem } - if abfl.Type != nil { - objectMap["type"] = abfl.Type - } if abfl.FolderPath != nil { objectMap["folderPath"] = abfl.FolderPath } if abfl.FileName != nil { objectMap["fileName"] = abfl.FileName } + if abfl.Type != "" { + objectMap["type"] = abfl.Type + } for k, v := range abfl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return &abfl, true +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for AzureBlobFSLocation. +func (abfl AzureBlobFSLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &abfl, true +} + // UnmarshalJSON is the custom unmarshaler for AzureBlobFSLocation struct. func (abfl *AzureBlobFSLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -13742,15 +14110,6 @@ func (abfl *AzureBlobFSLocation) UnmarshalJSON(body []byte) error { } abfl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - abfl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -13769,6 +14128,15 @@ func (abfl *AzureBlobFSLocation) UnmarshalJSON(body []byte) error { } abfl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + abfl.Type = typeVar + } } } @@ -13791,14 +14159,15 @@ type AzureBlobFSReadSettings struct { ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AzureBlobFSReadSettings. func (abfrs AzureBlobFSReadSettings) MarshalJSON() ([]byte, error) { + abfrs.Type = TypeAzureBlobFSReadSettings objectMap := make(map[string]interface{}) if abfrs.Recursive != nil { objectMap["recursive"] = abfrs.Recursive @@ -13818,18 +14187,83 @@ func (abfrs AzureBlobFSReadSettings) MarshalJSON() ([]byte, error) { if abfrs.ModifiedDatetimeEnd != nil { objectMap["modifiedDatetimeEnd"] = abfrs.ModifiedDatetimeEnd } - if abfrs.Type != nil { - objectMap["type"] = abfrs.Type - } if abfrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = abfrs.MaxConcurrentConnections } + if abfrs.Type != "" { + objectMap["type"] = abfrs.Type + } for k, v := range abfrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return &abfrs, true +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for AzureBlobFSReadSettings. +func (abfrs AzureBlobFSReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &abfrs, true +} + // UnmarshalJSON is the custom unmarshaler for AzureBlobFSReadSettings struct. func (abfrs *AzureBlobFSReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -13905,23 +14339,23 @@ func (abfrs *AzureBlobFSReadSettings) UnmarshalJSON(body []byte) error { } abfrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - abfrs.Type = &typeVar + abfrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - abfrs.MaxConcurrentConnections = maxConcurrentConnections + abfrs.Type = typeVar } } } @@ -14851,7 +15285,7 @@ type AzureBlobFSWriteSettings struct { MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` // CopyBehavior - The type of copy behavior for copy sink. CopyBehavior interface{} `json:"copyBehavior,omitempty"` - // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings' + // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings', 'TypeSftpWriteSettings' Type TypeBasicStoreWriteSettings `json:"type,omitempty"` } @@ -14897,6 +15331,11 @@ func (abfws AzureBlobFSWriteSettings) AsAzureBlobStorageWriteSettings() (*AzureB return nil, false } +// AsSftpWriteSettings is the BasicStoreWriteSettings implementation for AzureBlobFSWriteSettings. +func (abfws AzureBlobFSWriteSettings) AsSftpWriteSettings() (*SftpWriteSettings, bool) { + return nil, false +} + // AsStoreWriteSettings is the BasicStoreWriteSettings implementation for AzureBlobFSWriteSettings. func (abfws AzureBlobFSWriteSettings) AsStoreWriteSettings() (*StoreWriteSettings, bool) { return nil, false @@ -15700,35 +16139,101 @@ type AzureBlobStorageLocation struct { Container interface{} `json:"container,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AzureBlobStorageLocation. func (absl AzureBlobStorageLocation) MarshalJSON() ([]byte, error) { + absl.Type = TypeAzureBlobStorageLocation objectMap := make(map[string]interface{}) if absl.Container != nil { objectMap["container"] = absl.Container } - if absl.Type != nil { - objectMap["type"] = absl.Type - } if absl.FolderPath != nil { objectMap["folderPath"] = absl.FolderPath } if absl.FileName != nil { objectMap["fileName"] = absl.FileName } + if absl.Type != "" { + objectMap["type"] = absl.Type + } for k, v := range absl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return &absl, true +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for AzureBlobStorageLocation. +func (absl AzureBlobStorageLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &absl, true +} + // UnmarshalJSON is the custom unmarshaler for AzureBlobStorageLocation struct. func (absl *AzureBlobStorageLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -15759,15 +16264,6 @@ func (absl *AzureBlobStorageLocation) UnmarshalJSON(body []byte) error { } absl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - absl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -15786,6 +16282,15 @@ func (absl *AzureBlobStorageLocation) UnmarshalJSON(body []byte) error { } absl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + absl.Type = typeVar + } } } @@ -15800,6 +16305,8 @@ type AzureBlobStorageReadSettings struct { WildcardFolderPath interface{} `json:"wildcardFolderPath,omitempty"` // WildcardFileName - Azure blob wildcardFileName. Type: string (or Expression with resultType string). WildcardFileName interface{} `json:"wildcardFileName,omitempty"` + // Prefix - The prefix filter for the Azure Blob name. Type: string (or Expression with resultType string). + Prefix interface{} `json:"prefix,omitempty"` // EnablePartitionDiscovery - Indicates whether to enable partition discovery. EnablePartitionDiscovery *bool `json:"enablePartitionDiscovery,omitempty"` // ModifiedDatetimeStart - The start of file's modified datetime. Type: string (or Expression with resultType string). @@ -15808,14 +16315,15 @@ type AzureBlobStorageReadSettings struct { ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AzureBlobStorageReadSettings. func (absrs AzureBlobStorageReadSettings) MarshalJSON() ([]byte, error) { + absrs.Type = TypeAzureBlobStorageReadSettings objectMap := make(map[string]interface{}) if absrs.Recursive != nil { objectMap["recursive"] = absrs.Recursive @@ -15826,6 +16334,9 @@ func (absrs AzureBlobStorageReadSettings) MarshalJSON() ([]byte, error) { if absrs.WildcardFileName != nil { objectMap["wildcardFileName"] = absrs.WildcardFileName } + if absrs.Prefix != nil { + objectMap["prefix"] = absrs.Prefix + } if absrs.EnablePartitionDiscovery != nil { objectMap["enablePartitionDiscovery"] = absrs.EnablePartitionDiscovery } @@ -15835,18 +16346,83 @@ func (absrs AzureBlobStorageReadSettings) MarshalJSON() ([]byte, error) { if absrs.ModifiedDatetimeEnd != nil { objectMap["modifiedDatetimeEnd"] = absrs.ModifiedDatetimeEnd } - if absrs.Type != nil { - objectMap["type"] = absrs.Type - } if absrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = absrs.MaxConcurrentConnections } + if absrs.Type != "" { + objectMap["type"] = absrs.Type + } for k, v := range absrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return &absrs, true +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for AzureBlobStorageReadSettings. +func (absrs AzureBlobStorageReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &absrs, true +} + // UnmarshalJSON is the custom unmarshaler for AzureBlobStorageReadSettings struct. func (absrs *AzureBlobStorageReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -15883,6 +16459,15 @@ func (absrs *AzureBlobStorageReadSettings) UnmarshalJSON(body []byte) error { } absrs.WildcardFileName = wildcardFileName } + case "prefix": + if v != nil { + var prefix interface{} + err = json.Unmarshal(*v, &prefix) + if err != nil { + return err + } + absrs.Prefix = prefix + } case "enablePartitionDiscovery": if v != nil { var enablePartitionDiscovery bool @@ -15922,23 +16507,23 @@ func (absrs *AzureBlobStorageReadSettings) UnmarshalJSON(body []byte) error { } absrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - absrs.Type = &typeVar + absrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - absrs.MaxConcurrentConnections = maxConcurrentConnections + absrs.Type = typeVar } } } @@ -15956,7 +16541,7 @@ type AzureBlobStorageWriteSettings struct { MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` // CopyBehavior - The type of copy behavior for copy sink. CopyBehavior interface{} `json:"copyBehavior,omitempty"` - // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings' + // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings', 'TypeSftpWriteSettings' Type TypeBasicStoreWriteSettings `json:"type,omitempty"` } @@ -16002,6 +16587,11 @@ func (absws AzureBlobStorageWriteSettings) AsAzureBlobStorageWriteSettings() (*A return &absws, true } +// AsSftpWriteSettings is the BasicStoreWriteSettings implementation for AzureBlobStorageWriteSettings. +func (absws AzureBlobStorageWriteSettings) AsSftpWriteSettings() (*SftpWriteSettings, bool) { + return nil, false +} + // AsStoreWriteSettings is the BasicStoreWriteSettings implementation for AzureBlobStorageWriteSettings. func (absws AzureBlobStorageWriteSettings) AsStoreWriteSettings() (*StoreWriteSettings, bool) { return nil, false @@ -21608,32 +22198,98 @@ func (adlslstp *AzureDataLakeStoreLinkedServiceTypeProperties) UnmarshalJSON(bod type AzureDataLakeStoreLocation struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AzureDataLakeStoreLocation. func (adlsl AzureDataLakeStoreLocation) MarshalJSON() ([]byte, error) { + adlsl.Type = TypeAzureDataLakeStoreLocation objectMap := make(map[string]interface{}) - if adlsl.Type != nil { - objectMap["type"] = adlsl.Type - } if adlsl.FolderPath != nil { objectMap["folderPath"] = adlsl.FolderPath } if adlsl.FileName != nil { objectMap["fileName"] = adlsl.FileName } + if adlsl.Type != "" { + objectMap["type"] = adlsl.Type + } for k, v := range adlsl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return &adlsl, true +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for AzureDataLakeStoreLocation. +func (adlsl AzureDataLakeStoreLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &adlsl, true +} + // UnmarshalJSON is the custom unmarshaler for AzureDataLakeStoreLocation struct. func (adlsl *AzureDataLakeStoreLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -21655,15 +22311,6 @@ func (adlsl *AzureDataLakeStoreLocation) UnmarshalJSON(body []byte) error { } adlsl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - adlsl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -21682,6 +22329,15 @@ func (adlsl *AzureDataLakeStoreLocation) UnmarshalJSON(body []byte) error { } adlsl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adlsl.Type = typeVar + } } } @@ -21704,14 +22360,15 @@ type AzureDataLakeStoreReadSettings struct { ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AzureDataLakeStoreReadSettings. func (adlsrs AzureDataLakeStoreReadSettings) MarshalJSON() ([]byte, error) { + adlsrs.Type = TypeAzureDataLakeStoreReadSettings objectMap := make(map[string]interface{}) if adlsrs.Recursive != nil { objectMap["recursive"] = adlsrs.Recursive @@ -21731,18 +22388,83 @@ func (adlsrs AzureDataLakeStoreReadSettings) MarshalJSON() ([]byte, error) { if adlsrs.ModifiedDatetimeEnd != nil { objectMap["modifiedDatetimeEnd"] = adlsrs.ModifiedDatetimeEnd } - if adlsrs.Type != nil { - objectMap["type"] = adlsrs.Type - } if adlsrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = adlsrs.MaxConcurrentConnections } + if adlsrs.Type != "" { + objectMap["type"] = adlsrs.Type + } for k, v := range adlsrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return &adlsrs, true +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for AzureDataLakeStoreReadSettings. +func (adlsrs AzureDataLakeStoreReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &adlsrs, true +} + // UnmarshalJSON is the custom unmarshaler for AzureDataLakeStoreReadSettings struct. func (adlsrs *AzureDataLakeStoreReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -21818,23 +22540,23 @@ func (adlsrs *AzureDataLakeStoreReadSettings) UnmarshalJSON(body []byte) error { } adlsrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - adlsrs.Type = &typeVar + adlsrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - adlsrs.MaxConcurrentConnections = maxConcurrentConnections + adlsrs.Type = typeVar } } } @@ -22748,7 +23470,7 @@ type AzureDataLakeStoreWriteSettings struct { MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` // CopyBehavior - The type of copy behavior for copy sink. CopyBehavior interface{} `json:"copyBehavior,omitempty"` - // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings' + // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings', 'TypeSftpWriteSettings' Type TypeBasicStoreWriteSettings `json:"type,omitempty"` } @@ -22791,6 +23513,11 @@ func (adlsws AzureDataLakeStoreWriteSettings) AsAzureBlobStorageWriteSettings() return nil, false } +// AsSftpWriteSettings is the BasicStoreWriteSettings implementation for AzureDataLakeStoreWriteSettings. +func (adlsws AzureDataLakeStoreWriteSettings) AsSftpWriteSettings() (*SftpWriteSettings, bool) { + return nil, false +} + // AsStoreWriteSettings is the BasicStoreWriteSettings implementation for AzureDataLakeStoreWriteSettings. func (adlsws AzureDataLakeStoreWriteSettings) AsStoreWriteSettings() (*StoreWriteSettings, bool) { return nil, false @@ -23528,32 +24255,98 @@ func (afslstp *AzureFileStorageLinkedServiceTypeProperties) UnmarshalJSON(body [ type AzureFileStorageLocation struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AzureFileStorageLocation. func (afsl AzureFileStorageLocation) MarshalJSON() ([]byte, error) { + afsl.Type = TypeAzureFileStorageLocation objectMap := make(map[string]interface{}) - if afsl.Type != nil { - objectMap["type"] = afsl.Type - } if afsl.FolderPath != nil { objectMap["folderPath"] = afsl.FolderPath } if afsl.FileName != nil { objectMap["fileName"] = afsl.FileName } + if afsl.Type != "" { + objectMap["type"] = afsl.Type + } for k, v := range afsl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return &afsl, true +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for AzureFileStorageLocation. +func (afsl AzureFileStorageLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &afsl, true +} + // UnmarshalJSON is the custom unmarshaler for AzureFileStorageLocation struct. func (afsl *AzureFileStorageLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -23575,15 +24368,6 @@ func (afsl *AzureFileStorageLocation) UnmarshalJSON(body []byte) error { } afsl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - afsl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -23602,6 +24386,15 @@ func (afsl *AzureFileStorageLocation) UnmarshalJSON(body []byte) error { } afsl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + afsl.Type = typeVar + } } } @@ -23624,14 +24417,15 @@ type AzureFileStorageReadSettings struct { ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for AzureFileStorageReadSettings. func (afsrs AzureFileStorageReadSettings) MarshalJSON() ([]byte, error) { + afsrs.Type = TypeAzureFileStorageReadSettings objectMap := make(map[string]interface{}) if afsrs.Recursive != nil { objectMap["recursive"] = afsrs.Recursive @@ -23651,18 +24445,83 @@ func (afsrs AzureFileStorageReadSettings) MarshalJSON() ([]byte, error) { if afsrs.ModifiedDatetimeEnd != nil { objectMap["modifiedDatetimeEnd"] = afsrs.ModifiedDatetimeEnd } - if afsrs.Type != nil { - objectMap["type"] = afsrs.Type - } if afsrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = afsrs.MaxConcurrentConnections } + if afsrs.Type != "" { + objectMap["type"] = afsrs.Type + } for k, v := range afsrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return &afsrs, true +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for AzureFileStorageReadSettings. +func (afsrs AzureFileStorageReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &afsrs, true +} + // UnmarshalJSON is the custom unmarshaler for AzureFileStorageReadSettings struct. func (afsrs *AzureFileStorageReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -23738,23 +24597,23 @@ func (afsrs *AzureFileStorageReadSettings) UnmarshalJSON(body []byte) error { } afsrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - afsrs.Type = &typeVar + afsrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - afsrs.MaxConcurrentConnections = maxConcurrentConnections + afsrs.Type = typeVar } } } @@ -44340,7 +45199,7 @@ func (bd *BinaryDataset) UnmarshalJSON(body []byte) error { // BinaryDatasetTypeProperties binary dataset properties. type BinaryDatasetTypeProperties struct { // Location - The location of the Binary storage. - Location *DatasetLocation `json:"location,omitempty"` + Location BasicDatasetLocation `json:"location,omitempty"` // Compression - The data compression method used for the binary dataset. Compression BasicDatasetCompression `json:"compression,omitempty"` } @@ -44356,12 +45215,11 @@ func (bdtp *BinaryDatasetTypeProperties) UnmarshalJSON(body []byte) error { switch k { case "location": if v != nil { - var location DatasetLocation - err = json.Unmarshal(*v, &location) + location, err := unmarshalBasicDatasetLocation(*v) if err != nil { return err } - bdtp.Location = &location + bdtp.Location = location } case "compression": if v != nil { @@ -44698,7 +45556,7 @@ func (bs *BinarySink) UnmarshalJSON(body []byte) error { // BinarySource a copy activity Binary source. type BinarySource struct { // StoreSettings - Binary store settings. - StoreSettings *StoreReadSettings `json:"storeSettings,omitempty"` + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). @@ -44715,9 +45573,7 @@ type BinarySource struct { func (bs BinarySource) MarshalJSON() ([]byte, error) { bs.Type = TypeBinarySource objectMap := make(map[string]interface{}) - if bs.StoreSettings != nil { - objectMap["storeSettings"] = bs.StoreSettings - } + objectMap["storeSettings"] = bs.StoreSettings if bs.SourceRetryCount != nil { objectMap["sourceRetryCount"] = bs.SourceRetryCount } @@ -45197,12 +46053,11 @@ func (bs *BinarySource) UnmarshalJSON(body []byte) error { switch k { case "storeSettings": if v != nil { - var storeSettings StoreReadSettings - err = json.Unmarshal(*v, &storeSettings) + storeSettings, err := unmarshalBasicStoreReadSettings(*v) if err != nil { return err } - bs.StoreSettings = &storeSettings + bs.StoreSettings = storeSettings } default: if v != nil { @@ -67605,36 +68460,195 @@ func NewDatasetListResponsePage(getNextPage func(context.Context, DatasetListRes return DatasetListResponsePage{fn: getNextPage} } +// BasicDatasetLocation dataset location. +type BasicDatasetLocation interface { + AsHdfsLocation() (*HdfsLocation, bool) + AsHTTPServerLocation() (*HTTPServerLocation, bool) + AsSftpLocation() (*SftpLocation, bool) + AsFtpServerLocation() (*FtpServerLocation, bool) + AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) + AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) + AsFileServerLocation() (*FileServerLocation, bool) + AsAmazonS3Location() (*AmazonS3Location, bool) + AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) + AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) + AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) + AsDatasetLocation() (*DatasetLocation, bool) +} + // DatasetLocation dataset location. type DatasetLocation struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` +} + +func unmarshalBasicDatasetLocation(body []byte) (BasicDatasetLocation, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeHdfsLocation): + var hl HdfsLocation + err := json.Unmarshal(body, &hl) + return hl, err + case string(TypeHTTPServerLocation): + var hsl HTTPServerLocation + err := json.Unmarshal(body, &hsl) + return hsl, err + case string(TypeSftpLocation): + var sl SftpLocation + err := json.Unmarshal(body, &sl) + return sl, err + case string(TypeFtpServerLocation): + var fsl FtpServerLocation + err := json.Unmarshal(body, &fsl) + return fsl, err + case string(TypeGoogleCloudStorageLocation): + var gcsl GoogleCloudStorageLocation + err := json.Unmarshal(body, &gcsl) + return gcsl, err + case string(TypeAzureFileStorageLocation): + var afsl AzureFileStorageLocation + err := json.Unmarshal(body, &afsl) + return afsl, err + case string(TypeFileServerLocation): + var fsl FileServerLocation + err := json.Unmarshal(body, &fsl) + return fsl, err + case string(TypeAmazonS3Location): + var asl AmazonS3Location + err := json.Unmarshal(body, &asl) + return asl, err + case string(TypeAzureDataLakeStoreLocation): + var adlsl AzureDataLakeStoreLocation + err := json.Unmarshal(body, &adlsl) + return adlsl, err + case string(TypeAzureBlobFSLocation): + var abfl AzureBlobFSLocation + err := json.Unmarshal(body, &abfl) + return abfl, err + case string(TypeAzureBlobStorageLocation): + var absl AzureBlobStorageLocation + err := json.Unmarshal(body, &absl) + return absl, err + default: + var dl DatasetLocation + err := json.Unmarshal(body, &dl) + return dl, err + } +} +func unmarshalBasicDatasetLocationArray(body []byte) ([]BasicDatasetLocation, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dlArray := make([]BasicDatasetLocation, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dl, err := unmarshalBasicDatasetLocation(*rawMessage) + if err != nil { + return nil, err + } + dlArray[index] = dl + } + return dlArray, nil } // MarshalJSON is the custom marshaler for DatasetLocation. func (dl DatasetLocation) MarshalJSON() ([]byte, error) { + dl.Type = TypeDatasetLocation objectMap := make(map[string]interface{}) - if dl.Type != nil { - objectMap["type"] = dl.Type - } if dl.FolderPath != nil { objectMap["folderPath"] = dl.FolderPath } if dl.FileName != nil { objectMap["fileName"] = dl.FileName } + if dl.Type != "" { + objectMap["type"] = dl.Type + } for k, v := range dl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return &dl, true +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for DatasetLocation. +func (dl DatasetLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &dl, true +} + // UnmarshalJSON is the custom unmarshaler for DatasetLocation struct. func (dl *DatasetLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -67656,15 +68670,6 @@ func (dl *DatasetLocation) UnmarshalJSON(body []byte) error { } dl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -67683,6 +68688,15 @@ func (dl *DatasetLocation) UnmarshalJSON(body []byte) error { } dl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dl.Type = typeVar + } } } @@ -70978,7 +71992,7 @@ func (dtd *DelimitedTextDataset) UnmarshalJSON(body []byte) error { // DelimitedTextDatasetTypeProperties delimitedText dataset properties. type DelimitedTextDatasetTypeProperties struct { // Location - The location of the delimited text storage. - Location *DatasetLocation `json:"location,omitempty"` + Location BasicDatasetLocation `json:"location,omitempty"` // ColumnDelimiter - The column delimiter. Type: string (or Expression with resultType string). ColumnDelimiter interface{} `json:"columnDelimiter,omitempty"` // RowDelimiter - The row delimiter. Type: string (or Expression with resultType string). @@ -70998,23 +72012,128 @@ type DelimitedTextDatasetTypeProperties struct { NullValue interface{} `json:"nullValue,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for DelimitedTextDatasetTypeProperties struct. +func (dtdtp *DelimitedTextDatasetTypeProperties) 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 "location": + if v != nil { + location, err := unmarshalBasicDatasetLocation(*v) + if err != nil { + return err + } + dtdtp.Location = location + } + case "columnDelimiter": + if v != nil { + var columnDelimiter interface{} + err = json.Unmarshal(*v, &columnDelimiter) + if err != nil { + return err + } + dtdtp.ColumnDelimiter = columnDelimiter + } + case "rowDelimiter": + if v != nil { + var rowDelimiter interface{} + err = json.Unmarshal(*v, &rowDelimiter) + if err != nil { + return err + } + dtdtp.RowDelimiter = rowDelimiter + } + case "encodingName": + if v != nil { + var encodingName interface{} + err = json.Unmarshal(*v, &encodingName) + if err != nil { + return err + } + dtdtp.EncodingName = encodingName + } + case "compressionCodec": + if v != nil { + var compressionCodec interface{} + err = json.Unmarshal(*v, &compressionCodec) + if err != nil { + return err + } + dtdtp.CompressionCodec = compressionCodec + } + case "compressionLevel": + if v != nil { + var compressionLevel interface{} + err = json.Unmarshal(*v, &compressionLevel) + if err != nil { + return err + } + dtdtp.CompressionLevel = compressionLevel + } + case "quoteChar": + if v != nil { + var quoteChar interface{} + err = json.Unmarshal(*v, "eChar) + if err != nil { + return err + } + dtdtp.QuoteChar = quoteChar + } + case "escapeChar": + if v != nil { + var escapeChar interface{} + err = json.Unmarshal(*v, &escapeChar) + if err != nil { + return err + } + dtdtp.EscapeChar = escapeChar + } + case "firstRowAsHeader": + if v != nil { + var firstRowAsHeader interface{} + err = json.Unmarshal(*v, &firstRowAsHeader) + if err != nil { + return err + } + dtdtp.FirstRowAsHeader = firstRowAsHeader + } + case "nullValue": + if v != nil { + var nullValue interface{} + err = json.Unmarshal(*v, &nullValue) + if err != nil { + return err + } + dtdtp.NullValue = nullValue + } + } + } + + return nil +} + // DelimitedTextReadSettings delimited text read settings. type DelimitedTextReadSettings struct { // SkipLineCount - Indicates the number of non-empty rows to skip when reading data from input files. Type: integer (or Expression with resultType integer). SkipLineCount interface{} `json:"skipLineCount,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` + // Type - Possible values include: 'TypeFormatReadSettings', 'TypeDelimitedTextReadSettings' + Type TypeBasicFormatReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for DelimitedTextReadSettings. func (dtrs DelimitedTextReadSettings) MarshalJSON() ([]byte, error) { + dtrs.Type = TypeDelimitedTextReadSettings objectMap := make(map[string]interface{}) if dtrs.SkipLineCount != nil { objectMap["skipLineCount"] = dtrs.SkipLineCount } - if dtrs.Type != nil { + if dtrs.Type != "" { objectMap["type"] = dtrs.Type } for k, v := range dtrs.AdditionalProperties { @@ -71023,6 +72142,21 @@ func (dtrs DelimitedTextReadSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsDelimitedTextReadSettings is the BasicFormatReadSettings implementation for DelimitedTextReadSettings. +func (dtrs DelimitedTextReadSettings) AsDelimitedTextReadSettings() (*DelimitedTextReadSettings, bool) { + return &dtrs, true +} + +// AsFormatReadSettings is the BasicFormatReadSettings implementation for DelimitedTextReadSettings. +func (dtrs DelimitedTextReadSettings) AsFormatReadSettings() (*FormatReadSettings, bool) { + return nil, false +} + +// AsBasicFormatReadSettings is the BasicFormatReadSettings implementation for DelimitedTextReadSettings. +func (dtrs DelimitedTextReadSettings) AsBasicFormatReadSettings() (BasicFormatReadSettings, bool) { + return &dtrs, true +} + // UnmarshalJSON is the custom unmarshaler for DelimitedTextReadSettings struct. func (dtrs *DelimitedTextReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -71055,12 +72189,12 @@ func (dtrs *DelimitedTextReadSettings) UnmarshalJSON(body []byte) error { } case "type": if v != nil { - var typeVar string + var typeVar TypeBasicFormatReadSettings err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - dtrs.Type = &typeVar + dtrs.Type = typeVar } } } @@ -71403,7 +72537,7 @@ func (dts *DelimitedTextSink) UnmarshalJSON(body []byte) error { // DelimitedTextSource a copy activity DelimitedText source. type DelimitedTextSource struct { // StoreSettings - DelimitedText store settings. - StoreSettings *StoreReadSettings `json:"storeSettings,omitempty"` + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` // FormatSettings - DelimitedText format settings. FormatSettings *DelimitedTextReadSettings `json:"formatSettings,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -71422,9 +72556,7 @@ type DelimitedTextSource struct { func (dts DelimitedTextSource) MarshalJSON() ([]byte, error) { dts.Type = TypeDelimitedTextSource objectMap := make(map[string]interface{}) - if dts.StoreSettings != nil { - objectMap["storeSettings"] = dts.StoreSettings - } + objectMap["storeSettings"] = dts.StoreSettings if dts.FormatSettings != nil { objectMap["formatSettings"] = dts.FormatSettings } @@ -71907,12 +73039,11 @@ func (dts *DelimitedTextSource) UnmarshalJSON(body []byte) error { switch k { case "storeSettings": if v != nil { - var storeSettings StoreReadSettings - err = json.Unmarshal(*v, &storeSettings) + storeSettings, err := unmarshalBasicStoreReadSettings(*v) if err != nil { return err } - dts.StoreSettings = &storeSettings + dts.StoreSettings = storeSettings } case "formatSettings": if v != nil { @@ -71985,12 +73116,13 @@ type DelimitedTextWriteSettings struct { FileExtension interface{} `json:"fileExtension,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The write setting type. - Type *string `json:"type,omitempty"` + // Type - Possible values include: 'TypeFormatWriteSettings', 'TypeJSONWriteSettings', 'TypeDelimitedTextWriteSettings', 'TypeAvroWriteSettings' + Type TypeBasicFormatWriteSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for DelimitedTextWriteSettings. func (dtws DelimitedTextWriteSettings) MarshalJSON() ([]byte, error) { + dtws.Type = TypeDelimitedTextWriteSettings objectMap := make(map[string]interface{}) if dtws.QuoteAllText != nil { objectMap["quoteAllText"] = dtws.QuoteAllText @@ -71998,7 +73130,7 @@ func (dtws DelimitedTextWriteSettings) MarshalJSON() ([]byte, error) { if dtws.FileExtension != nil { objectMap["fileExtension"] = dtws.FileExtension } - if dtws.Type != nil { + if dtws.Type != "" { objectMap["type"] = dtws.Type } for k, v := range dtws.AdditionalProperties { @@ -72007,6 +73139,31 @@ func (dtws DelimitedTextWriteSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsJSONWriteSettings is the BasicFormatWriteSettings implementation for DelimitedTextWriteSettings. +func (dtws DelimitedTextWriteSettings) AsJSONWriteSettings() (*JSONWriteSettings, bool) { + return nil, false +} + +// AsDelimitedTextWriteSettings is the BasicFormatWriteSettings implementation for DelimitedTextWriteSettings. +func (dtws DelimitedTextWriteSettings) AsDelimitedTextWriteSettings() (*DelimitedTextWriteSettings, bool) { + return &dtws, true +} + +// AsAvroWriteSettings is the BasicFormatWriteSettings implementation for DelimitedTextWriteSettings. +func (dtws DelimitedTextWriteSettings) AsAvroWriteSettings() (*AvroWriteSettings, bool) { + return nil, false +} + +// AsFormatWriteSettings is the BasicFormatWriteSettings implementation for DelimitedTextWriteSettings. +func (dtws DelimitedTextWriteSettings) AsFormatWriteSettings() (*FormatWriteSettings, bool) { + return nil, false +} + +// AsBasicFormatWriteSettings is the BasicFormatWriteSettings implementation for DelimitedTextWriteSettings. +func (dtws DelimitedTextWriteSettings) AsBasicFormatWriteSettings() (BasicFormatWriteSettings, bool) { + return &dtws, true +} + // UnmarshalJSON is the custom unmarshaler for DelimitedTextWriteSettings struct. func (dtws *DelimitedTextWriteSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -72048,12 +73205,12 @@ func (dtws *DelimitedTextWriteSettings) UnmarshalJSON(body []byte) error { } case "type": if v != nil { - var typeVar string + var typeVar TypeBasicFormatWriteSettings err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - dtws.Type = &typeVar + dtws.Type = typeVar } } } @@ -84378,6 +85535,16 @@ type ExecuteDataFlowActivityTypeProperties struct { Staging *DataFlowStagingInfo `json:"staging,omitempty"` // IntegrationRuntime - The integration runtime reference. IntegrationRuntime *IntegrationRuntimeReference `json:"integrationRuntime,omitempty"` + // Compute - Compute properties for data flow activity. + Compute *ExecuteDataFlowActivityTypePropertiesCompute `json:"compute,omitempty"` +} + +// ExecuteDataFlowActivityTypePropertiesCompute compute properties for data flow activity. +type ExecuteDataFlowActivityTypePropertiesCompute struct { + // ComputeType - Compute type of the cluster which will execute data flow job. Possible values include: 'General', 'MemoryOptimized', 'ComputeOptimized' + ComputeType DataFlowComputeType `json:"computeType,omitempty"` + // CoreCount - Core count of the cluster which will execute data flow job. Supported values are: 8, 16, 32, 48, 80, 144 and 272. + CoreCount *int32 `json:"coreCount,omitempty"` } // ExecutePipelineActivity execute pipeline activity. @@ -87016,32 +88183,98 @@ func (fslstp *FileServerLinkedServiceTypeProperties) UnmarshalJSON(body []byte) type FileServerLocation struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for FileServerLocation. func (fsl FileServerLocation) MarshalJSON() ([]byte, error) { + fsl.Type = TypeFileServerLocation objectMap := make(map[string]interface{}) - if fsl.Type != nil { - objectMap["type"] = fsl.Type - } if fsl.FolderPath != nil { objectMap["folderPath"] = fsl.FolderPath } if fsl.FileName != nil { objectMap["fileName"] = fsl.FileName } + if fsl.Type != "" { + objectMap["type"] = fsl.Type + } for k, v := range fsl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return &fsl, true +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for FileServerLocation. +func (fsl FileServerLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &fsl, true +} + // UnmarshalJSON is the custom unmarshaler for FileServerLocation struct. func (fsl *FileServerLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -87063,15 +88296,6 @@ func (fsl *FileServerLocation) UnmarshalJSON(body []byte) error { } fsl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fsl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -87090,6 +88314,15 @@ func (fsl *FileServerLocation) UnmarshalJSON(body []byte) error { } fsl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fsl.Type = typeVar + } } } @@ -87112,14 +88345,15 @@ type FileServerReadSettings struct { ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for FileServerReadSettings. func (fsrs FileServerReadSettings) MarshalJSON() ([]byte, error) { + fsrs.Type = TypeFileServerReadSettings objectMap := make(map[string]interface{}) if fsrs.Recursive != nil { objectMap["recursive"] = fsrs.Recursive @@ -87139,18 +88373,83 @@ func (fsrs FileServerReadSettings) MarshalJSON() ([]byte, error) { if fsrs.ModifiedDatetimeEnd != nil { objectMap["modifiedDatetimeEnd"] = fsrs.ModifiedDatetimeEnd } - if fsrs.Type != nil { - objectMap["type"] = fsrs.Type - } if fsrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = fsrs.MaxConcurrentConnections } + if fsrs.Type != "" { + objectMap["type"] = fsrs.Type + } for k, v := range fsrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return &fsrs, true +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for FileServerReadSettings. +func (fsrs FileServerReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &fsrs, true +} + // UnmarshalJSON is the custom unmarshaler for FileServerReadSettings struct. func (fsrs *FileServerReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -87226,23 +88525,23 @@ func (fsrs *FileServerReadSettings) UnmarshalJSON(body []byte) error { } fsrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - fsrs.Type = &typeVar + fsrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - fsrs.MaxConcurrentConnections = maxConcurrentConnections + fsrs.Type = typeVar } } } @@ -87258,7 +88557,7 @@ type FileServerWriteSettings struct { MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` // CopyBehavior - The type of copy behavior for copy sink. CopyBehavior interface{} `json:"copyBehavior,omitempty"` - // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings' + // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings', 'TypeSftpWriteSettings' Type TypeBasicStoreWriteSettings `json:"type,omitempty"` } @@ -87301,6 +88600,11 @@ func (fsws FileServerWriteSettings) AsAzureBlobStorageWriteSettings() (*AzureBlo return nil, false } +// AsSftpWriteSettings is the BasicStoreWriteSettings implementation for FileServerWriteSettings. +func (fsws FileServerWriteSettings) AsSftpWriteSettings() (*SftpWriteSettings, bool) { + return nil, false +} + // AsStoreWriteSettings is the BasicStoreWriteSettings implementation for FileServerWriteSettings. func (fsws FileServerWriteSettings) AsStoreWriteSettings() (*StoreWriteSettings, bool) { return nil, false @@ -89681,18 +90985,62 @@ func (featp *ForEachActivityTypeProperties) UnmarshalJSON(body []byte) error { return nil } +// BasicFormatReadSettings format read settings. +type BasicFormatReadSettings interface { + AsDelimitedTextReadSettings() (*DelimitedTextReadSettings, bool) + AsFormatReadSettings() (*FormatReadSettings, bool) +} + // FormatReadSettings format read settings. type FormatReadSettings struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` + // Type - Possible values include: 'TypeFormatReadSettings', 'TypeDelimitedTextReadSettings' + Type TypeBasicFormatReadSettings `json:"type,omitempty"` +} + +func unmarshalBasicFormatReadSettings(body []byte) (BasicFormatReadSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeDelimitedTextReadSettings): + var dtrs DelimitedTextReadSettings + err := json.Unmarshal(body, &dtrs) + return dtrs, err + default: + var frs FormatReadSettings + err := json.Unmarshal(body, &frs) + return frs, err + } +} +func unmarshalBasicFormatReadSettingsArray(body []byte) ([]BasicFormatReadSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + frsArray := make([]BasicFormatReadSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + frs, err := unmarshalBasicFormatReadSettings(*rawMessage) + if err != nil { + return nil, err + } + frsArray[index] = frs + } + return frsArray, nil } // MarshalJSON is the custom marshaler for FormatReadSettings. func (frs FormatReadSettings) MarshalJSON() ([]byte, error) { + frs.Type = TypeFormatReadSettings objectMap := make(map[string]interface{}) - if frs.Type != nil { + if frs.Type != "" { objectMap["type"] = frs.Type } for k, v := range frs.AdditionalProperties { @@ -89701,6 +91049,21 @@ func (frs FormatReadSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsDelimitedTextReadSettings is the BasicFormatReadSettings implementation for FormatReadSettings. +func (frs FormatReadSettings) AsDelimitedTextReadSettings() (*DelimitedTextReadSettings, bool) { + return nil, false +} + +// AsFormatReadSettings is the BasicFormatReadSettings implementation for FormatReadSettings. +func (frs FormatReadSettings) AsFormatReadSettings() (*FormatReadSettings, bool) { + return &frs, true +} + +// AsBasicFormatReadSettings is the BasicFormatReadSettings implementation for FormatReadSettings. +func (frs FormatReadSettings) AsBasicFormatReadSettings() (BasicFormatReadSettings, bool) { + return &frs, true +} + // UnmarshalJSON is the custom unmarshaler for FormatReadSettings struct. func (frs *FormatReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -89724,12 +91087,12 @@ func (frs *FormatReadSettings) UnmarshalJSON(body []byte) error { } case "type": if v != nil { - var typeVar string + var typeVar TypeBasicFormatReadSettings err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - frs.Type = &typeVar + frs.Type = typeVar } } } @@ -89737,18 +91100,72 @@ func (frs *FormatReadSettings) UnmarshalJSON(body []byte) error { return nil } +// BasicFormatWriteSettings format write settings. +type BasicFormatWriteSettings interface { + AsJSONWriteSettings() (*JSONWriteSettings, bool) + AsDelimitedTextWriteSettings() (*DelimitedTextWriteSettings, bool) + AsAvroWriteSettings() (*AvroWriteSettings, bool) + AsFormatWriteSettings() (*FormatWriteSettings, bool) +} + // FormatWriteSettings format write settings. type FormatWriteSettings struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The write setting type. - Type *string `json:"type,omitempty"` + // Type - Possible values include: 'TypeFormatWriteSettings', 'TypeJSONWriteSettings', 'TypeDelimitedTextWriteSettings', 'TypeAvroWriteSettings' + Type TypeBasicFormatWriteSettings `json:"type,omitempty"` +} + +func unmarshalBasicFormatWriteSettings(body []byte) (BasicFormatWriteSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeJSONWriteSettings): + var jws JSONWriteSettings + err := json.Unmarshal(body, &jws) + return jws, err + case string(TypeDelimitedTextWriteSettings): + var dtws DelimitedTextWriteSettings + err := json.Unmarshal(body, &dtws) + return dtws, err + case string(TypeAvroWriteSettings): + var aws AvroWriteSettings + err := json.Unmarshal(body, &aws) + return aws, err + default: + var fws FormatWriteSettings + err := json.Unmarshal(body, &fws) + return fws, err + } +} +func unmarshalBasicFormatWriteSettingsArray(body []byte) ([]BasicFormatWriteSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + fwsArray := make([]BasicFormatWriteSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + fws, err := unmarshalBasicFormatWriteSettings(*rawMessage) + if err != nil { + return nil, err + } + fwsArray[index] = fws + } + return fwsArray, nil } // MarshalJSON is the custom marshaler for FormatWriteSettings. func (fws FormatWriteSettings) MarshalJSON() ([]byte, error) { + fws.Type = TypeFormatWriteSettings objectMap := make(map[string]interface{}) - if fws.Type != nil { + if fws.Type != "" { objectMap["type"] = fws.Type } for k, v := range fws.AdditionalProperties { @@ -89757,6 +91174,31 @@ func (fws FormatWriteSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsJSONWriteSettings is the BasicFormatWriteSettings implementation for FormatWriteSettings. +func (fws FormatWriteSettings) AsJSONWriteSettings() (*JSONWriteSettings, bool) { + return nil, false +} + +// AsDelimitedTextWriteSettings is the BasicFormatWriteSettings implementation for FormatWriteSettings. +func (fws FormatWriteSettings) AsDelimitedTextWriteSettings() (*DelimitedTextWriteSettings, bool) { + return nil, false +} + +// AsAvroWriteSettings is the BasicFormatWriteSettings implementation for FormatWriteSettings. +func (fws FormatWriteSettings) AsAvroWriteSettings() (*AvroWriteSettings, bool) { + return nil, false +} + +// AsFormatWriteSettings is the BasicFormatWriteSettings implementation for FormatWriteSettings. +func (fws FormatWriteSettings) AsFormatWriteSettings() (*FormatWriteSettings, bool) { + return &fws, true +} + +// AsBasicFormatWriteSettings is the BasicFormatWriteSettings implementation for FormatWriteSettings. +func (fws FormatWriteSettings) AsBasicFormatWriteSettings() (BasicFormatWriteSettings, bool) { + return &fws, true +} + // UnmarshalJSON is the custom unmarshaler for FormatWriteSettings struct. func (fws *FormatWriteSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -89780,12 +91222,12 @@ func (fws *FormatWriteSettings) UnmarshalJSON(body []byte) error { } case "type": if v != nil { - var typeVar string + var typeVar TypeBasicFormatWriteSettings err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - fws.Type = &typeVar + fws.Type = typeVar } } } @@ -89805,14 +91247,15 @@ type FtpReadSettings struct { UseBinaryTransfer *bool `json:"useBinaryTransfer,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for FtpReadSettings. func (frs FtpReadSettings) MarshalJSON() ([]byte, error) { + frs.Type = TypeFtpReadSettings objectMap := make(map[string]interface{}) if frs.Recursive != nil { objectMap["recursive"] = frs.Recursive @@ -89826,18 +91269,83 @@ func (frs FtpReadSettings) MarshalJSON() ([]byte, error) { if frs.UseBinaryTransfer != nil { objectMap["useBinaryTransfer"] = frs.UseBinaryTransfer } - if frs.Type != nil { - objectMap["type"] = frs.Type - } if frs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = frs.MaxConcurrentConnections } + if frs.Type != "" { + objectMap["type"] = frs.Type + } for k, v := range frs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return &frs, true +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for FtpReadSettings. +func (frs FtpReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &frs, true +} + // UnmarshalJSON is the custom unmarshaler for FtpReadSettings struct. func (frs *FtpReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -89895,23 +91403,23 @@ func (frs *FtpReadSettings) UnmarshalJSON(body []byte) error { } frs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - frs.Type = &typeVar + frs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - frs.MaxConcurrentConnections = maxConcurrentConnections + frs.Type = typeVar } } } @@ -90636,32 +92144,98 @@ func (fslstp *FtpServerLinkedServiceTypeProperties) UnmarshalJSON(body []byte) e type FtpServerLocation struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for FtpServerLocation. func (fsl FtpServerLocation) MarshalJSON() ([]byte, error) { + fsl.Type = TypeFtpServerLocation objectMap := make(map[string]interface{}) - if fsl.Type != nil { - objectMap["type"] = fsl.Type - } if fsl.FolderPath != nil { objectMap["folderPath"] = fsl.FolderPath } if fsl.FileName != nil { objectMap["fileName"] = fsl.FileName } + if fsl.Type != "" { + objectMap["type"] = fsl.Type + } for k, v := range fsl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return &fsl, true +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for FtpServerLocation. +func (fsl FtpServerLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &fsl, true +} + // UnmarshalJSON is the custom unmarshaler for FtpServerLocation struct. func (fsl *FtpServerLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -90683,15 +92257,6 @@ func (fsl *FtpServerLocation) UnmarshalJSON(body []byte) error { } fsl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fsl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -90710,6 +92275,15 @@ func (fsl *FtpServerLocation) UnmarshalJSON(body []byte) error { } fsl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fsl.Type = typeVar + } } } @@ -91781,8 +93355,8 @@ type GoogleAdWordsLinkedServiceTypeProperties struct { AuthenticationType GoogleAdWordsAuthenticationType `json:"authenticationType,omitempty"` // RefreshToken - The refresh token obtained from Google for authorizing access to AdWords for UserAuthentication. RefreshToken BasicSecretBase `json:"refreshToken,omitempty"` - // ClientID - The client id of the google application used to acquire the refresh token. - ClientID BasicSecretBase `json:"clientId,omitempty"` + // ClientID - The client id of the google application used to acquire the refresh token. Type: string (or Expression with resultType string). + ClientID interface{} `json:"clientId,omitempty"` // ClientSecret - The client secret of the google application used to acquire the refresh token. ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` // Email - The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR. @@ -91842,7 +93416,8 @@ func (gawlstp *GoogleAdWordsLinkedServiceTypeProperties) UnmarshalJSON(body []by } case "clientId": if v != nil { - clientID, err := unmarshalBasicSecretBase(*v) + var clientID interface{} + err = json.Unmarshal(*v, &clientID) if err != nil { return err } @@ -93727,8 +95302,8 @@ type GoogleBigQueryLinkedServiceTypeProperties struct { AuthenticationType GoogleBigQueryAuthenticationType `json:"authenticationType,omitempty"` // RefreshToken - The refresh token obtained from Google for authorizing access to BigQuery for UserAuthentication. RefreshToken BasicSecretBase `json:"refreshToken,omitempty"` - // ClientID - The client id of the google application used to acquire the refresh token. - ClientID BasicSecretBase `json:"clientId,omitempty"` + // ClientID - The client id of the google application used to acquire the refresh token. Type: string (or Expression with resultType string). + ClientID interface{} `json:"clientId,omitempty"` // ClientSecret - The client secret of the google application used to acquire the refresh token. ClientSecret BasicSecretBase `json:"clientSecret,omitempty"` // Email - The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR. @@ -93798,7 +95373,8 @@ func (gbqlstp *GoogleBigQueryLinkedServiceTypeProperties) UnmarshalJSON(body []b } case "clientId": if v != nil { - clientID, err := unmarshalBasicSecretBase(*v) + var clientID interface{} + err = json.Unmarshal(*v, &clientID) if err != nil { return err } @@ -95731,16 +97307,17 @@ type GoogleCloudStorageLocation struct { Version interface{} `json:"version,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for GoogleCloudStorageLocation. func (gcsl GoogleCloudStorageLocation) MarshalJSON() ([]byte, error) { + gcsl.Type = TypeGoogleCloudStorageLocation objectMap := make(map[string]interface{}) if gcsl.BucketName != nil { objectMap["bucketName"] = gcsl.BucketName @@ -95748,21 +97325,86 @@ func (gcsl GoogleCloudStorageLocation) MarshalJSON() ([]byte, error) { if gcsl.Version != nil { objectMap["version"] = gcsl.Version } - if gcsl.Type != nil { - objectMap["type"] = gcsl.Type - } if gcsl.FolderPath != nil { objectMap["folderPath"] = gcsl.FolderPath } if gcsl.FileName != nil { objectMap["fileName"] = gcsl.FileName } + if gcsl.Type != "" { + objectMap["type"] = gcsl.Type + } for k, v := range gcsl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return &gcsl, true +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for GoogleCloudStorageLocation. +func (gcsl GoogleCloudStorageLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &gcsl, true +} + // UnmarshalJSON is the custom unmarshaler for GoogleCloudStorageLocation struct. func (gcsl *GoogleCloudStorageLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -95802,15 +97444,6 @@ func (gcsl *GoogleCloudStorageLocation) UnmarshalJSON(body []byte) error { } gcsl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gcsl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -95829,6 +97462,15 @@ func (gcsl *GoogleCloudStorageLocation) UnmarshalJSON(body []byte) error { } gcsl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gcsl.Type = typeVar + } } } @@ -95853,14 +97495,15 @@ type GoogleCloudStorageReadSettings struct { ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for GoogleCloudStorageReadSettings. func (gcsrs GoogleCloudStorageReadSettings) MarshalJSON() ([]byte, error) { + gcsrs.Type = TypeGoogleCloudStorageReadSettings objectMap := make(map[string]interface{}) if gcsrs.Recursive != nil { objectMap["recursive"] = gcsrs.Recursive @@ -95883,18 +97526,83 @@ func (gcsrs GoogleCloudStorageReadSettings) MarshalJSON() ([]byte, error) { if gcsrs.ModifiedDatetimeEnd != nil { objectMap["modifiedDatetimeEnd"] = gcsrs.ModifiedDatetimeEnd } - if gcsrs.Type != nil { - objectMap["type"] = gcsrs.Type - } if gcsrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = gcsrs.MaxConcurrentConnections } + if gcsrs.Type != "" { + objectMap["type"] = gcsrs.Type + } for k, v := range gcsrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return &gcsrs, true +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for GoogleCloudStorageReadSettings. +func (gcsrs GoogleCloudStorageReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &gcsrs, true +} + // UnmarshalJSON is the custom unmarshaler for GoogleCloudStorageReadSettings struct. func (gcsrs *GoogleCloudStorageReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -95979,23 +97687,23 @@ func (gcsrs *GoogleCloudStorageReadSettings) UnmarshalJSON(body []byte) error { } gcsrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - gcsrs.Type = &typeVar + gcsrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - gcsrs.MaxConcurrentConnections = maxConcurrentConnections + gcsrs.Type = typeVar } } } @@ -100442,32 +102150,98 @@ func (hlstp *HdfsLinkedServiceTypeProperties) UnmarshalJSON(body []byte) error { type HdfsLocation struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for HdfsLocation. func (hl HdfsLocation) MarshalJSON() ([]byte, error) { + hl.Type = TypeHdfsLocation objectMap := make(map[string]interface{}) - if hl.Type != nil { - objectMap["type"] = hl.Type - } if hl.FolderPath != nil { objectMap["folderPath"] = hl.FolderPath } if hl.FileName != nil { objectMap["fileName"] = hl.FileName } + if hl.Type != "" { + objectMap["type"] = hl.Type + } for k, v := range hl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return &hl, true +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for HdfsLocation. +func (hl HdfsLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &hl, true +} + // UnmarshalJSON is the custom unmarshaler for HdfsLocation struct. func (hl *HdfsLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -100489,15 +102263,6 @@ func (hl *HdfsLocation) UnmarshalJSON(body []byte) error { } hl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - hl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -100516,6 +102281,15 @@ func (hl *HdfsLocation) UnmarshalJSON(body []byte) error { } hl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hl.Type = typeVar + } } } @@ -100540,14 +102314,15 @@ type HdfsReadSettings struct { DistcpSettings *DistcpSettings `json:"distcpSettings,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for HdfsReadSettings. func (hrs HdfsReadSettings) MarshalJSON() ([]byte, error) { + hrs.Type = TypeHdfsReadSettings objectMap := make(map[string]interface{}) if hrs.Recursive != nil { objectMap["recursive"] = hrs.Recursive @@ -100570,18 +102345,83 @@ func (hrs HdfsReadSettings) MarshalJSON() ([]byte, error) { if hrs.DistcpSettings != nil { objectMap["distcpSettings"] = hrs.DistcpSettings } - if hrs.Type != nil { - objectMap["type"] = hrs.Type - } if hrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = hrs.MaxConcurrentConnections } + if hrs.Type != "" { + objectMap["type"] = hrs.Type + } for k, v := range hrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return &hrs, true +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for HdfsReadSettings. +func (hrs HdfsReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &hrs, true +} + // UnmarshalJSON is the custom unmarshaler for HdfsReadSettings struct. func (hrs *HdfsReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -100666,23 +102506,23 @@ func (hrs *HdfsReadSettings) UnmarshalJSON(body []byte) error { } hrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - hrs.Type = &typeVar + hrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - hrs.MaxConcurrentConnections = maxConcurrentConnections + hrs.Type = typeVar } } } @@ -108438,14 +110278,15 @@ type HTTPReadSettings struct { RequestTimeout interface{} `json:"requestTimeout,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for HTTPReadSettings. func (hrs HTTPReadSettings) MarshalJSON() ([]byte, error) { + hrs.Type = TypeHTTPReadSettings objectMap := make(map[string]interface{}) if hrs.RequestMethod != nil { objectMap["requestMethod"] = hrs.RequestMethod @@ -108459,18 +110300,83 @@ func (hrs HTTPReadSettings) MarshalJSON() ([]byte, error) { if hrs.RequestTimeout != nil { objectMap["requestTimeout"] = hrs.RequestTimeout } - if hrs.Type != nil { - objectMap["type"] = hrs.Type - } if hrs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = hrs.MaxConcurrentConnections } + if hrs.Type != "" { + objectMap["type"] = hrs.Type + } for k, v := range hrs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return &hrs, true +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for HTTPReadSettings. +func (hrs HTTPReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &hrs, true +} + // UnmarshalJSON is the custom unmarshaler for HTTPReadSettings struct. func (hrs *HTTPReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -108528,23 +110434,23 @@ func (hrs *HTTPReadSettings) UnmarshalJSON(body []byte) error { } hrs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - hrs.Type = &typeVar + hrs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - hrs.MaxConcurrentConnections = maxConcurrentConnections + hrs.Type = typeVar } } } @@ -108558,35 +110464,101 @@ type HTTPServerLocation struct { RelativeURL interface{} `json:"relativeUrl,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for HTTPServerLocation. func (hsl HTTPServerLocation) MarshalJSON() ([]byte, error) { + hsl.Type = TypeHTTPServerLocation objectMap := make(map[string]interface{}) if hsl.RelativeURL != nil { objectMap["relativeUrl"] = hsl.RelativeURL } - if hsl.Type != nil { - objectMap["type"] = hsl.Type - } if hsl.FolderPath != nil { objectMap["folderPath"] = hsl.FolderPath } if hsl.FileName != nil { objectMap["fileName"] = hsl.FileName } + if hsl.Type != "" { + objectMap["type"] = hsl.Type + } for k, v := range hsl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return &hsl, true +} + +// AsSftpLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsSftpLocation() (*SftpLocation, bool) { + return nil, false +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for HTTPServerLocation. +func (hsl HTTPServerLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &hsl, true +} + // UnmarshalJSON is the custom unmarshaler for HTTPServerLocation struct. func (hsl *HTTPServerLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -108617,15 +110589,6 @@ func (hsl *HTTPServerLocation) UnmarshalJSON(body []byte) error { } hsl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - hsl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -108644,6 +110607,15 @@ func (hsl *HTTPServerLocation) UnmarshalJSON(body []byte) error { } hsl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hsl.Type = typeVar + } } } @@ -119679,7 +121651,7 @@ func (jd *JSONDataset) UnmarshalJSON(body []byte) error { // JSONDatasetTypeProperties json dataset properties. type JSONDatasetTypeProperties struct { // Location - The location of the json data storage. - Location *DatasetLocation `json:"location,omitempty"` + Location BasicDatasetLocation `json:"location,omitempty"` // EncodingName - The code page name of the preferred encoding. If not specified, the default value is UTF-8, unless BOM denotes another Unicode encoding. Refer to the name column of the table in the following link to set supported values: https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: string (or Expression with resultType string). EncodingName interface{} `json:"encodingName,omitempty"` // Compression - The data compression method used for the json dataset. @@ -119697,12 +121669,11 @@ func (jdtp *JSONDatasetTypeProperties) UnmarshalJSON(body []byte) error { switch k { case "location": if v != nil { - var location DatasetLocation - err = json.Unmarshal(*v, &location) + location, err := unmarshalBasicDatasetLocation(*v) if err != nil { return err } - jdtp.Location = &location + jdtp.Location = location } case "encodingName": if v != nil { @@ -120252,7 +122223,7 @@ func (js *JSONSink) UnmarshalJSON(body []byte) error { // JSONSource a copy activity Json source. type JSONSource struct { // StoreSettings - Json store settings. - StoreSettings *StoreReadSettings `json:"storeSettings,omitempty"` + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). @@ -120269,9 +122240,7 @@ type JSONSource struct { func (js JSONSource) MarshalJSON() ([]byte, error) { js.Type = TypeJSONSource objectMap := make(map[string]interface{}) - if js.StoreSettings != nil { - objectMap["storeSettings"] = js.StoreSettings - } + objectMap["storeSettings"] = js.StoreSettings if js.SourceRetryCount != nil { objectMap["sourceRetryCount"] = js.SourceRetryCount } @@ -120751,12 +122720,11 @@ func (js *JSONSource) UnmarshalJSON(body []byte) error { switch k { case "storeSettings": if v != nil { - var storeSettings StoreReadSettings - err = json.Unmarshal(*v, &storeSettings) + storeSettings, err := unmarshalBasicStoreReadSettings(*v) if err != nil { return err } - js.StoreSettings = &storeSettings + js.StoreSettings = storeSettings } default: if v != nil { @@ -120818,17 +122786,18 @@ type JSONWriteSettings struct { FilePattern JSONWriteFilePattern `json:"filePattern,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The write setting type. - Type *string `json:"type,omitempty"` + // Type - Possible values include: 'TypeFormatWriteSettings', 'TypeJSONWriteSettings', 'TypeDelimitedTextWriteSettings', 'TypeAvroWriteSettings' + Type TypeBasicFormatWriteSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for JSONWriteSettings. func (jws JSONWriteSettings) MarshalJSON() ([]byte, error) { + jws.Type = TypeJSONWriteSettings objectMap := make(map[string]interface{}) if jws.FilePattern != "" { objectMap["filePattern"] = jws.FilePattern } - if jws.Type != nil { + if jws.Type != "" { objectMap["type"] = jws.Type } for k, v := range jws.AdditionalProperties { @@ -120837,6 +122806,31 @@ func (jws JSONWriteSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsJSONWriteSettings is the BasicFormatWriteSettings implementation for JSONWriteSettings. +func (jws JSONWriteSettings) AsJSONWriteSettings() (*JSONWriteSettings, bool) { + return &jws, true +} + +// AsDelimitedTextWriteSettings is the BasicFormatWriteSettings implementation for JSONWriteSettings. +func (jws JSONWriteSettings) AsDelimitedTextWriteSettings() (*DelimitedTextWriteSettings, bool) { + return nil, false +} + +// AsAvroWriteSettings is the BasicFormatWriteSettings implementation for JSONWriteSettings. +func (jws JSONWriteSettings) AsAvroWriteSettings() (*AvroWriteSettings, bool) { + return nil, false +} + +// AsFormatWriteSettings is the BasicFormatWriteSettings implementation for JSONWriteSettings. +func (jws JSONWriteSettings) AsFormatWriteSettings() (*FormatWriteSettings, bool) { + return nil, false +} + +// AsBasicFormatWriteSettings is the BasicFormatWriteSettings implementation for JSONWriteSettings. +func (jws JSONWriteSettings) AsBasicFormatWriteSettings() (BasicFormatWriteSettings, bool) { + return &jws, true +} + // UnmarshalJSON is the custom unmarshaler for JSONWriteSettings struct. func (jws *JSONWriteSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -120869,12 +122863,12 @@ func (jws *JSONWriteSettings) UnmarshalJSON(body []byte) error { } case "type": if v != nil { - var typeVar string + var typeVar TypeBasicFormatWriteSettings err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - jws.Type = &typeVar + jws.Type = typeVar } } } @@ -149974,11 +151968,43 @@ func (od *OrcDataset) UnmarshalJSON(body []byte) error { // OrcDatasetTypeProperties ORC dataset properties. type OrcDatasetTypeProperties struct { // Location - The location of the ORC data storage. - Location *DatasetLocation `json:"location,omitempty"` + Location BasicDatasetLocation `json:"location,omitempty"` // OrcCompressionCodec - Possible values include: 'OrcCompressionCodecNone', 'OrcCompressionCodecZlib', 'OrcCompressionCodecSnappy' OrcCompressionCodec OrcCompressionCodec `json:"orcCompressionCodec,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for OrcDatasetTypeProperties struct. +func (odtp *OrcDatasetTypeProperties) 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 "location": + if v != nil { + location, err := unmarshalBasicDatasetLocation(*v) + if err != nil { + return err + } + odtp.Location = location + } + case "orcCompressionCodec": + if v != nil { + var orcCompressionCodec OrcCompressionCodec + err = json.Unmarshal(*v, &orcCompressionCodec) + if err != nil { + return err + } + odtp.OrcCompressionCodec = orcCompressionCodec + } + } + } + + return nil +} + // OrcFormat the data stored in Optimized Row Columnar (ORC) format. type OrcFormat struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -150420,7 +152446,7 @@ func (osVar *OrcSink) UnmarshalJSON(body []byte) error { // OrcSource a copy activity ORC source. type OrcSource struct { // StoreSettings - ORC store settings. - StoreSettings *StoreReadSettings `json:"storeSettings,omitempty"` + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). @@ -150437,9 +152463,7 @@ type OrcSource struct { func (osVar OrcSource) MarshalJSON() ([]byte, error) { osVar.Type = TypeOrcSource objectMap := make(map[string]interface{}) - if osVar.StoreSettings != nil { - objectMap["storeSettings"] = osVar.StoreSettings - } + objectMap["storeSettings"] = osVar.StoreSettings if osVar.SourceRetryCount != nil { objectMap["sourceRetryCount"] = osVar.SourceRetryCount } @@ -150919,12 +152943,11 @@ func (osVar *OrcSource) UnmarshalJSON(body []byte) error { switch k { case "storeSettings": if v != nil { - var storeSettings StoreReadSettings - err = json.Unmarshal(*v, &storeSettings) + storeSettings, err := unmarshalBasicStoreReadSettings(*v) if err != nil { return err } - osVar.StoreSettings = &storeSettings + osVar.StoreSettings = storeSettings } default: if v != nil { @@ -151605,8 +153628,40 @@ func (pd *ParquetDataset) UnmarshalJSON(body []byte) error { // ParquetDatasetTypeProperties parquet dataset properties. type ParquetDatasetTypeProperties struct { // Location - The location of the parquet storage. - Location *DatasetLocation `json:"location,omitempty"` - CompressionCodec interface{} `json:"compressionCodec,omitempty"` + Location BasicDatasetLocation `json:"location,omitempty"` + CompressionCodec interface{} `json:"compressionCodec,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ParquetDatasetTypeProperties struct. +func (pdtp *ParquetDatasetTypeProperties) 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 "location": + if v != nil { + location, err := unmarshalBasicDatasetLocation(*v) + if err != nil { + return err + } + pdtp.Location = location + } + case "compressionCodec": + if v != nil { + var compressionCodec interface{} + err = json.Unmarshal(*v, &compressionCodec) + if err != nil { + return err + } + pdtp.CompressionCodec = compressionCodec + } + } + } + + return nil } // ParquetFormat the data stored in Parquet format. @@ -152050,7 +154105,7 @@ func (ps *ParquetSink) UnmarshalJSON(body []byte) error { // ParquetSource a copy activity Parquet source. type ParquetSource struct { // StoreSettings - Parquet store settings. - StoreSettings *StoreReadSettings `json:"storeSettings,omitempty"` + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). @@ -152067,9 +154122,7 @@ type ParquetSource struct { func (ps ParquetSource) MarshalJSON() ([]byte, error) { ps.Type = TypeParquetSource objectMap := make(map[string]interface{}) - if ps.StoreSettings != nil { - objectMap["storeSettings"] = ps.StoreSettings - } + objectMap["storeSettings"] = ps.StoreSettings if ps.SourceRetryCount != nil { objectMap["sourceRetryCount"] = ps.SourceRetryCount } @@ -152549,12 +154602,11 @@ func (ps *ParquetSource) UnmarshalJSON(body []byte) error { switch k { case "storeSettings": if v != nil { - var storeSettings StoreReadSettings - err = json.Unmarshal(*v, &storeSettings) + storeSettings, err := unmarshalBasicStoreReadSettings(*v) if err != nil { return err } - ps.StoreSettings = &storeSettings + ps.StoreSettings = storeSettings } default: if v != nil { @@ -190173,32 +192225,98 @@ type SetVariableActivityTypeProperties struct { type SftpLocation struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Type of dataset storage location. - Type *string `json:"type,omitempty"` // FolderPath - Specify the folder path of dataset. Type: string (or Expression with resultType string) FolderPath interface{} `json:"folderPath,omitempty"` // FileName - Specify the file name of dataset. Type: string (or Expression with resultType string). FileName interface{} `json:"fileName,omitempty"` + // Type - Possible values include: 'TypeDatasetLocation', 'TypeHdfsLocation', 'TypeHTTPServerLocation', 'TypeSftpLocation', 'TypeFtpServerLocation', 'TypeGoogleCloudStorageLocation', 'TypeAzureFileStorageLocation', 'TypeFileServerLocation', 'TypeAmazonS3Location', 'TypeAzureDataLakeStoreLocation', 'TypeAzureBlobFSLocation', 'TypeAzureBlobStorageLocation' + Type TypeBasicDatasetLocation `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for SftpLocation. func (sl SftpLocation) MarshalJSON() ([]byte, error) { + sl.Type = TypeSftpLocation objectMap := make(map[string]interface{}) - if sl.Type != nil { - objectMap["type"] = sl.Type - } if sl.FolderPath != nil { objectMap["folderPath"] = sl.FolderPath } if sl.FileName != nil { objectMap["fileName"] = sl.FileName } + if sl.Type != "" { + objectMap["type"] = sl.Type + } for k, v := range sl.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsHdfsLocation() (*HdfsLocation, bool) { + return nil, false +} + +// AsHTTPServerLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsHTTPServerLocation() (*HTTPServerLocation, bool) { + return nil, false +} + +// AsSftpLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsSftpLocation() (*SftpLocation, bool) { + return &sl, true +} + +// AsFtpServerLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsFtpServerLocation() (*FtpServerLocation, bool) { + return nil, false +} + +// AsGoogleCloudStorageLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsGoogleCloudStorageLocation() (*GoogleCloudStorageLocation, bool) { + return nil, false +} + +// AsAzureFileStorageLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsAzureFileStorageLocation() (*AzureFileStorageLocation, bool) { + return nil, false +} + +// AsFileServerLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsFileServerLocation() (*FileServerLocation, bool) { + return nil, false +} + +// AsAmazonS3Location is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsAmazonS3Location() (*AmazonS3Location, bool) { + return nil, false +} + +// AsAzureDataLakeStoreLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsAzureDataLakeStoreLocation() (*AzureDataLakeStoreLocation, bool) { + return nil, false +} + +// AsAzureBlobFSLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsAzureBlobFSLocation() (*AzureBlobFSLocation, bool) { + return nil, false +} + +// AsAzureBlobStorageLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsAzureBlobStorageLocation() (*AzureBlobStorageLocation, bool) { + return nil, false +} + +// AsDatasetLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsDatasetLocation() (*DatasetLocation, bool) { + return nil, false +} + +// AsBasicDatasetLocation is the BasicDatasetLocation implementation for SftpLocation. +func (sl SftpLocation) AsBasicDatasetLocation() (BasicDatasetLocation, bool) { + return &sl, true +} + // UnmarshalJSON is the custom unmarshaler for SftpLocation struct. func (sl *SftpLocation) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -190220,15 +192338,6 @@ func (sl *SftpLocation) UnmarshalJSON(body []byte) error { } sl.AdditionalProperties[k] = additionalProperties } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sl.Type = &typeVar - } case "folderPath": if v != nil { var folderPath interface{} @@ -190247,6 +192356,15 @@ func (sl *SftpLocation) UnmarshalJSON(body []byte) error { } sl.FileName = fileName } + case "type": + if v != nil { + var typeVar TypeBasicDatasetLocation + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sl.Type = typeVar + } } } @@ -190267,14 +192385,15 @@ type SftpReadSettings struct { ModifiedDatetimeEnd interface{} `json:"modifiedDatetimeEnd,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` } // MarshalJSON is the custom marshaler for SftpReadSettings. func (srs SftpReadSettings) MarshalJSON() ([]byte, error) { + srs.Type = TypeSftpReadSettings objectMap := make(map[string]interface{}) if srs.Recursive != nil { objectMap["recursive"] = srs.Recursive @@ -190291,18 +192410,83 @@ func (srs SftpReadSettings) MarshalJSON() ([]byte, error) { if srs.ModifiedDatetimeEnd != nil { objectMap["modifiedDatetimeEnd"] = srs.ModifiedDatetimeEnd } - if srs.Type != nil { - objectMap["type"] = srs.Type - } if srs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = srs.MaxConcurrentConnections } + if srs.Type != "" { + objectMap["type"] = srs.Type + } for k, v := range srs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return &srs, true +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return nil, false +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for SftpReadSettings. +func (srs SftpReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &srs, true +} + // UnmarshalJSON is the custom unmarshaler for SftpReadSettings struct. func (srs *SftpReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -190369,23 +192553,23 @@ func (srs *SftpReadSettings) UnmarshalJSON(body []byte) error { } srs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - srs.Type = &typeVar + srs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - srs.MaxConcurrentConnections = maxConcurrentConnections + srs.Type = typeVar } } } @@ -191137,6 +193321,140 @@ func (sslstp *SftpServerLinkedServiceTypeProperties) UnmarshalJSON(body []byte) return nil } +// SftpWriteSettings sftp write settings. +type SftpWriteSettings struct { + // OperationTimeout - Specifies the timeout for writing each chunk to SFTP server. Default value: 01:00:00 (one hour). Type: string (or Expression with resultType string). + OperationTimeout interface{} `json:"operationTimeout,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). + MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // CopyBehavior - The type of copy behavior for copy sink. + CopyBehavior interface{} `json:"copyBehavior,omitempty"` + // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings', 'TypeSftpWriteSettings' + Type TypeBasicStoreWriteSettings `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SftpWriteSettings. +func (sws SftpWriteSettings) MarshalJSON() ([]byte, error) { + sws.Type = TypeSftpWriteSettings + objectMap := make(map[string]interface{}) + if sws.OperationTimeout != nil { + objectMap["operationTimeout"] = sws.OperationTimeout + } + if sws.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = sws.MaxConcurrentConnections + } + if sws.CopyBehavior != nil { + objectMap["copyBehavior"] = sws.CopyBehavior + } + if sws.Type != "" { + objectMap["type"] = sws.Type + } + for k, v := range sws.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsFileServerWriteSettings is the BasicStoreWriteSettings implementation for SftpWriteSettings. +func (sws SftpWriteSettings) AsFileServerWriteSettings() (*FileServerWriteSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreWriteSettings is the BasicStoreWriteSettings implementation for SftpWriteSettings. +func (sws SftpWriteSettings) AsAzureDataLakeStoreWriteSettings() (*AzureDataLakeStoreWriteSettings, bool) { + return nil, false +} + +// AsAzureBlobFSWriteSettings is the BasicStoreWriteSettings implementation for SftpWriteSettings. +func (sws SftpWriteSettings) AsAzureBlobFSWriteSettings() (*AzureBlobFSWriteSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageWriteSettings is the BasicStoreWriteSettings implementation for SftpWriteSettings. +func (sws SftpWriteSettings) AsAzureBlobStorageWriteSettings() (*AzureBlobStorageWriteSettings, bool) { + return nil, false +} + +// AsSftpWriteSettings is the BasicStoreWriteSettings implementation for SftpWriteSettings. +func (sws SftpWriteSettings) AsSftpWriteSettings() (*SftpWriteSettings, bool) { + return &sws, true +} + +// AsStoreWriteSettings is the BasicStoreWriteSettings implementation for SftpWriteSettings. +func (sws SftpWriteSettings) AsStoreWriteSettings() (*StoreWriteSettings, bool) { + return nil, false +} + +// AsBasicStoreWriteSettings is the BasicStoreWriteSettings implementation for SftpWriteSettings. +func (sws SftpWriteSettings) AsBasicStoreWriteSettings() (BasicStoreWriteSettings, bool) { + return &sws, true +} + +// UnmarshalJSON is the custom unmarshaler for SftpWriteSettings struct. +func (sws *SftpWriteSettings) 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 "operationTimeout": + if v != nil { + var operationTimeout interface{} + err = json.Unmarshal(*v, &operationTimeout) + if err != nil { + return err + } + sws.OperationTimeout = operationTimeout + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if sws.AdditionalProperties == nil { + sws.AdditionalProperties = make(map[string]interface{}) + } + sws.AdditionalProperties[k] = additionalProperties + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + sws.MaxConcurrentConnections = maxConcurrentConnections + } + case "copyBehavior": + if v != nil { + var copyBehavior interface{} + err = json.Unmarshal(*v, ©Behavior) + if err != nil { + return err + } + sws.CopyBehavior = copyBehavior + } + case "type": + if v != nil { + var typeVar TypeBasicStoreWriteSettings + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sws.Type = typeVar + } + } + } + + return nil +} + // ShopifyLinkedService shopify Service linked service. type ShopifyLinkedService struct { // ShopifyLinkedServiceTypeProperties - Shopify Service linked service properties. @@ -203524,31 +205842,190 @@ type StoredProcedureParameter struct { Type StoredProcedureParameterType `json:"type,omitempty"` } +// BasicStoreReadSettings connector read setting. +type BasicStoreReadSettings interface { + AsHdfsReadSettings() (*HdfsReadSettings, bool) + AsHTTPReadSettings() (*HTTPReadSettings, bool) + AsSftpReadSettings() (*SftpReadSettings, bool) + AsFtpReadSettings() (*FtpReadSettings, bool) + AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) + AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) + AsFileServerReadSettings() (*FileServerReadSettings, bool) + AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) + AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) + AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) + AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) + AsStoreReadSettings() (*StoreReadSettings, bool) +} + // StoreReadSettings connector read setting. type StoreReadSettings struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - The read setting type. - Type *string `json:"type,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeStoreReadSettings', 'TypeHdfsReadSettings', 'TypeHTTPReadSettings', 'TypeSftpReadSettings', 'TypeFtpReadSettings', 'TypeGoogleCloudStorageReadSettings', 'TypeAzureFileStorageReadSettings', 'TypeFileServerReadSettings', 'TypeAmazonS3ReadSettings', 'TypeAzureDataLakeStoreReadSettings', 'TypeAzureBlobFSReadSettings', 'TypeAzureBlobStorageReadSettings' + Type TypeBasicStoreReadSettings `json:"type,omitempty"` +} + +func unmarshalBasicStoreReadSettings(body []byte) (BasicStoreReadSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeHdfsReadSettings): + var hrs HdfsReadSettings + err := json.Unmarshal(body, &hrs) + return hrs, err + case string(TypeHTTPReadSettings): + var hrs HTTPReadSettings + err := json.Unmarshal(body, &hrs) + return hrs, err + case string(TypeSftpReadSettings): + var srs SftpReadSettings + err := json.Unmarshal(body, &srs) + return srs, err + case string(TypeFtpReadSettings): + var frs FtpReadSettings + err := json.Unmarshal(body, &frs) + return frs, err + case string(TypeGoogleCloudStorageReadSettings): + var gcsrs GoogleCloudStorageReadSettings + err := json.Unmarshal(body, &gcsrs) + return gcsrs, err + case string(TypeAzureFileStorageReadSettings): + var afsrs AzureFileStorageReadSettings + err := json.Unmarshal(body, &afsrs) + return afsrs, err + case string(TypeFileServerReadSettings): + var fsrs FileServerReadSettings + err := json.Unmarshal(body, &fsrs) + return fsrs, err + case string(TypeAmazonS3ReadSettings): + var asrs AmazonS3ReadSettings + err := json.Unmarshal(body, &asrs) + return asrs, err + case string(TypeAzureDataLakeStoreReadSettings): + var adlsrs AzureDataLakeStoreReadSettings + err := json.Unmarshal(body, &adlsrs) + return adlsrs, err + case string(TypeAzureBlobFSReadSettings): + var abfrs AzureBlobFSReadSettings + err := json.Unmarshal(body, &abfrs) + return abfrs, err + case string(TypeAzureBlobStorageReadSettings): + var absrs AzureBlobStorageReadSettings + err := json.Unmarshal(body, &absrs) + return absrs, err + default: + var srs StoreReadSettings + err := json.Unmarshal(body, &srs) + return srs, err + } +} +func unmarshalBasicStoreReadSettingsArray(body []byte) ([]BasicStoreReadSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + srsArray := make([]BasicStoreReadSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + srs, err := unmarshalBasicStoreReadSettings(*rawMessage) + if err != nil { + return nil, err + } + srsArray[index] = srs + } + return srsArray, nil } // MarshalJSON is the custom marshaler for StoreReadSettings. func (srs StoreReadSettings) MarshalJSON() ([]byte, error) { + srs.Type = TypeStoreReadSettings objectMap := make(map[string]interface{}) - if srs.Type != nil { - objectMap["type"] = srs.Type - } if srs.MaxConcurrentConnections != nil { objectMap["maxConcurrentConnections"] = srs.MaxConcurrentConnections } + if srs.Type != "" { + objectMap["type"] = srs.Type + } for k, v := range srs.AdditionalProperties { objectMap[k] = v } return json.Marshal(objectMap) } +// AsHdfsReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsHdfsReadSettings() (*HdfsReadSettings, bool) { + return nil, false +} + +// AsHTTPReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsHTTPReadSettings() (*HTTPReadSettings, bool) { + return nil, false +} + +// AsSftpReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsSftpReadSettings() (*SftpReadSettings, bool) { + return nil, false +} + +// AsFtpReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsFtpReadSettings() (*FtpReadSettings, bool) { + return nil, false +} + +// AsGoogleCloudStorageReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsGoogleCloudStorageReadSettings() (*GoogleCloudStorageReadSettings, bool) { + return nil, false +} + +// AsAzureFileStorageReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsAzureFileStorageReadSettings() (*AzureFileStorageReadSettings, bool) { + return nil, false +} + +// AsFileServerReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsFileServerReadSettings() (*FileServerReadSettings, bool) { + return nil, false +} + +// AsAmazonS3ReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsAmazonS3ReadSettings() (*AmazonS3ReadSettings, bool) { + return nil, false +} + +// AsAzureDataLakeStoreReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsAzureDataLakeStoreReadSettings() (*AzureDataLakeStoreReadSettings, bool) { + return nil, false +} + +// AsAzureBlobFSReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsAzureBlobFSReadSettings() (*AzureBlobFSReadSettings, bool) { + return nil, false +} + +// AsAzureBlobStorageReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsAzureBlobStorageReadSettings() (*AzureBlobStorageReadSettings, bool) { + return nil, false +} + +// AsStoreReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsStoreReadSettings() (*StoreReadSettings, bool) { + return &srs, true +} + +// AsBasicStoreReadSettings is the BasicStoreReadSettings implementation for StoreReadSettings. +func (srs StoreReadSettings) AsBasicStoreReadSettings() (BasicStoreReadSettings, bool) { + return &srs, true +} + // UnmarshalJSON is the custom unmarshaler for StoreReadSettings struct. func (srs *StoreReadSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage @@ -203570,23 +206047,23 @@ func (srs *StoreReadSettings) UnmarshalJSON(body []byte) error { } srs.AdditionalProperties[k] = additionalProperties } - case "type": + case "maxConcurrentConnections": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) if err != nil { return err } - srs.Type = &typeVar + srs.MaxConcurrentConnections = maxConcurrentConnections } - case "maxConcurrentConnections": + case "type": if v != nil { - var maxConcurrentConnections interface{} - err = json.Unmarshal(*v, &maxConcurrentConnections) + var typeVar TypeBasicStoreReadSettings + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - srs.MaxConcurrentConnections = maxConcurrentConnections + srs.Type = typeVar } } } @@ -203600,6 +206077,7 @@ type BasicStoreWriteSettings interface { AsAzureDataLakeStoreWriteSettings() (*AzureDataLakeStoreWriteSettings, bool) AsAzureBlobFSWriteSettings() (*AzureBlobFSWriteSettings, bool) AsAzureBlobStorageWriteSettings() (*AzureBlobStorageWriteSettings, bool) + AsSftpWriteSettings() (*SftpWriteSettings, bool) AsStoreWriteSettings() (*StoreWriteSettings, bool) } @@ -203611,7 +206089,7 @@ type StoreWriteSettings struct { MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` // CopyBehavior - The type of copy behavior for copy sink. CopyBehavior interface{} `json:"copyBehavior,omitempty"` - // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings' + // Type - Possible values include: 'TypeStoreWriteSettings', 'TypeFileServerWriteSettings', 'TypeAzureDataLakeStoreWriteSettings', 'TypeAzureBlobFSWriteSettings', 'TypeAzureBlobStorageWriteSettings', 'TypeSftpWriteSettings' Type TypeBasicStoreWriteSettings `json:"type,omitempty"` } @@ -203639,6 +206117,10 @@ func unmarshalBasicStoreWriteSettings(body []byte) (BasicStoreWriteSettings, err var absws AzureBlobStorageWriteSettings err := json.Unmarshal(body, &absws) return absws, err + case string(TypeSftpWriteSettings): + var sws SftpWriteSettings + err := json.Unmarshal(body, &sws) + return sws, err default: var sws StoreWriteSettings err := json.Unmarshal(body, &sws) @@ -203703,6 +206185,11 @@ func (sws StoreWriteSettings) AsAzureBlobStorageWriteSettings() (*AzureBlobStora return nil, false } +// AsSftpWriteSettings is the BasicStoreWriteSettings implementation for StoreWriteSettings. +func (sws StoreWriteSettings) AsSftpWriteSettings() (*SftpWriteSettings, bool) { + return nil, false +} + // AsStoreWriteSettings is the BasicStoreWriteSettings implementation for StoreWriteSettings. func (sws StoreWriteSettings) AsStoreWriteSettings() (*StoreWriteSettings, bool) { return &sws, true diff --git a/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/client.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/client.go new file mode 100644 index 000000000000..1f3866e9d4d5 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/client.go @@ -0,0 +1,165 @@ +// Package machinelearningservices implements the Azure ARM Machinelearningservices service API version 2020-01-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 = "2020-01-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/2020-01-01/machinelearningservices/machinelearningcompute.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/machinelearningcompute.go new file mode 100644 index 000000000000..5b51e4a95d06 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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/2020-01-01/machinelearningservices/machinelearningservicesapi/interfaces.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/machinelearningservicesapi/interfaces.go new file mode 100644 index 000000000000..327f2243588a --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/machinelearningservicesapi/interfaces.go @@ -0,0 +1,110 @@ +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/2020-01-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) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result machinelearningservices.PrivateEndpointConnection, err error) + Put(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties machinelearningservices.PrivateEndpointConnection) (result machinelearningservices.PrivateEndpointConnection, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*machinelearningservices.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.PrivateLinkResourceListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*machinelearningservices.PrivateLinkResourcesClient)(nil) diff --git a/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/models.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/models.go new file mode 100644 index 000000000000..c9b46151d64a --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/models.go @@ -0,0 +1,3673 @@ +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/2020-01-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} +} + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // Creating ... + Creating PrivateEndpointConnectionProvisioningState = "Creating" + // Deleting ... + Deleting PrivateEndpointConnectionProvisioningState = "Deleting" + // Failed ... + Failed PrivateEndpointConnectionProvisioningState = "Failed" + // Succeeded ... + Succeeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{Creating, Deleting, Failed, Succeeded} +} + +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // Approved ... + Approved PrivateEndpointServiceConnectionStatus = "Approved" + // Pending ... + Pending PrivateEndpointServiceConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{Approved, Pending, Rejected} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUnknown ... + ProvisioningStateUnknown ProvisioningState = "Unknown" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUnknown, ProvisioningStateUpdating} +} + +// 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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"` +} + +// PrivateEndpoint the Private Endpoint resource. +type PrivateEndpoint struct { + // ID - READ-ONLY; The ARM identifier for Private Endpoint + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection the Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `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 PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + if pec.Location != nil { + objectMap["location"] = pec.Location + } + if pec.Tags != nil { + objectMap["tags"] = pec.Tags + } + if pec.Sku != nil { + objectMap["sku"] = pec.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) 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 privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + pec.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pec.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pec.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + pec.Sku = &sku + } + } + } + + return nil +} + +// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - The resource of private end point. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `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 PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + if plr.Location != nil { + objectMap["location"] = plr.Location + } + if plr.Tags != nil { + objectMap["tags"] = plr.Tags + } + if plr.Sku != nil { + objectMap["sku"] = plr.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) 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 privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + plr.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + plr.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + plr.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + plr.Sku = &sku + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The private link resource Private link DNS zone name. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// PrivateLinkServiceConnectionState a collection of information about the state of the connection between +// service consumer and provider. +type PrivateLinkServiceConnectionState struct { + // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected' + Status PrivateEndpointServiceConnectionStatus `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"` +} + +// 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + 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/2020-01-01/machinelearningservices/operations.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/operations.go new file mode 100644 index 000000000000..66174c5d2807 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-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 = "2020-01-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/2020-01-01/machinelearningservices/privateendpointconnections.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/privateendpointconnections.go new file mode 100644 index 000000000000..42fc321c024c --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/privateendpointconnections.go @@ -0,0 +1,289 @@ +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" +) + +// PrivateEndpointConnectionsClient is the these APIs allow end users to operate on Azure Machine Learning Workspace +// resources. +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete deletes the specified private endpoint connection associated with the workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-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}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) 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 specified private endpoint connection associated with the workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "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.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-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}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put update the state of specified private endpoint connection associated with the workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace +// properties - the private endpoint connection properties. +func (client PrivateEndpointConnectionsClient) Put(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Put") + 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: properties, + Constraints: []validation.Constraint{{Target: "properties.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "properties.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("machinelearningservices.PrivateEndpointConnectionsClient", "Put", err.Error()) + } + + req, err := client.PutPreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Put", nil, "Failure preparing request") + return + } + + resp, err := client.PutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Put", resp, "Failure sending request") + return + } + + result, err = client.PutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Put", resp, "Failure responding to request") + } + + return +} + +// PutPreparer prepares the Put request. +func (client PrivateEndpointConnectionsClient) PutPreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-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}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) PutSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) PutResponder(resp *http.Response) (result PrivateEndpointConnection, 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/2020-01-01/machinelearningservices/privatelinkresources.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/privatelinkresources.go new file mode 100644 index 000000000000..80f13fe8fd1a --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/privatelinkresources.go @@ -0,0 +1,119 @@ +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" +) + +// PrivateLinkResourcesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace +// resources. +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByWorkspace gets the private link resources that need to be created for a workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client PrivateLinkResourcesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateLinkResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client PrivateLinkResourcesClient) ListByWorkspacePreparer(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 = "2020-01-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}/privateLinkResources", 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 PrivateLinkResourcesClient) 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 PrivateLinkResourcesClient) ListByWorkspaceResponder(resp *http.Response) (result PrivateLinkResourceListResult, 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/2020-01-01/machinelearningservices/quotas.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/quotas.go new file mode 100644 index 000000000000..6b9d8c0962e0 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-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 = "2020-01-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 = "2020-01-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/2020-01-01/machinelearningservices/usages.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/usages.go new file mode 100644 index 000000000000..8c65ee6423d0 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-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 = "2020-01-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/2020-01-01/machinelearningservices/version.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/version.go new file mode 100644 index 000000000000..6966a98ed560 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-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/2020-01-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/2020-01-01/machinelearningservices/virtualmachinesizes.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/virtualmachinesizes.go new file mode 100644 index 000000000000..989ff8b4fe2c --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-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 = "2020-01-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/2020-01-01/machinelearningservices/workspacefeatures.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/workspacefeatures.go new file mode 100644 index 000000000000..4d5f8b3a71f6 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-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 = "2020-01-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/2020-01-01/machinelearningservices/workspaces.go b/services/machinelearningservices/mgmt/2020-01-01/machinelearningservices/workspaces.go new file mode 100644 index 000000000000..65e8f21ba830 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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 = "2020-01-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/mediaservices/mgmt/2018-07-01/media/models.go b/services/mediaservices/mgmt/2018-07-01/media/models.go index ef138d13a8eb..cd29ffc08fa5 100644 --- a/services/mediaservices/mgmt/2018-07-01/media/models.go +++ b/services/mediaservices/mgmt/2018-07-01/media/models.go @@ -102,6 +102,8 @@ func PossibleAssetStorageEncryptionFormatValues() []AssetStorageEncryptionFormat type ContentKeyPolicyFairPlayRentalAndLeaseKeyType string const ( + // DualExpiry Dual expiry for offline rental. + DualExpiry ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "DualExpiry" // PersistentLimited Content key can be persisted and the valid duration is limited by the Rental Duration // value PersistentLimited ContentKeyPolicyFairPlayRentalAndLeaseKeyType = "PersistentLimited" @@ -116,7 +118,7 @@ const ( // PossibleContentKeyPolicyFairPlayRentalAndLeaseKeyTypeValues returns an array of possible values for the ContentKeyPolicyFairPlayRentalAndLeaseKeyType const type. func PossibleContentKeyPolicyFairPlayRentalAndLeaseKeyTypeValues() []ContentKeyPolicyFairPlayRentalAndLeaseKeyType { - return []ContentKeyPolicyFairPlayRentalAndLeaseKeyType{PersistentLimited, PersistentUnlimited, Undefined, Unknown} + return []ContentKeyPolicyFairPlayRentalAndLeaseKeyType{DualExpiry, PersistentLimited, PersistentUnlimited, Undefined, Unknown} } // ContentKeyPolicyPlayReadyContentType enumerates the values for content key policy play ready content type. @@ -243,6 +245,13 @@ const ( // will remain 720p at best, and will start at rates lower than 3 Mbps. The output will have video and // audio in separate MP4 files, which is optimal for adaptive streaming. AdaptiveStreaming EncoderNamedPreset = "AdaptiveStreaming" + // ContentAwareEncoding Produces a set of GOP-aligned MP4s by using content-aware encoding. Given any input + // content, the service performs an initial lightweight analysis of the input content, and uses the results + // to determine the optimal number of layers, appropriate bitrate and resolution settings for delivery by + // adaptive streaming. This preset is particularly effective for low and medium complexity videos, where + // the output files will be at lower bitrates but at a quality that still delivers a good experience to + // viewers. The output will contain MP4 files with video and audio interleaved. + ContentAwareEncoding EncoderNamedPreset = "ContentAwareEncoding" // ContentAwareEncodingExperimental Exposes an experimental preset for content-aware encoding. Given any // input content, the service attempts to automatically determine the optimal number of layers, appropriate // bitrate and resolution settings for delivery by adaptive streaming. The underlying algorithms will @@ -270,7 +279,7 @@ const ( // PossibleEncoderNamedPresetValues returns an array of possible values for the EncoderNamedPreset const type. func PossibleEncoderNamedPresetValues() []EncoderNamedPreset { - return []EncoderNamedPreset{AACGoodQualityAudio, AdaptiveStreaming, ContentAwareEncodingExperimental, H264MultipleBitrate1080p, H264MultipleBitrate720p, H264MultipleBitrateSD, H264SingleBitrate1080p, H264SingleBitrate720p, H264SingleBitrateSD} + return []EncoderNamedPreset{AACGoodQualityAudio, AdaptiveStreaming, ContentAwareEncoding, ContentAwareEncodingExperimental, H264MultipleBitrate1080p, H264MultipleBitrate720p, H264MultipleBitrateSD, H264SingleBitrate1080p, H264SingleBitrate720p, H264SingleBitrateSD} } // EncryptionScheme enumerates the values for encryption scheme. @@ -2106,8 +2115,10 @@ type BasicAudioAnalyzerPreset interface { // including speech transcription. Currently, the preset supports processing of content with a single audio // track. type AudioAnalyzerPreset struct { - // AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are English ('en-US' and 'en-GB'), Spanish ('es-ES' and 'es-MX'), French ('fr-FR'), Italian ('it-IT'), Japanese ('ja-JP'), Portuguese ('pt-BR'), Chinese ('zh-CN'), German ('de-DE'), Arabic ('ar-EG' and 'ar-SY'), Russian ('ru-RU'), Hindi ('hi-IN'), and Korean ('ko-KR'). If you know the language of your content, it is recommended that you specify it. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. This language detection feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." + // AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). If you know the language of your content, it is recommended that you specify it. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." The list of supported languages is available here: https://go.microsoft.com/fwlink/?linkid=2109463 AudioLanguage *string `json:"audioLanguage,omitempty"` + // ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself + ExperimentalOptions map[string]*string `json:"experimentalOptions"` // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` } @@ -2156,6 +2167,9 @@ func (aap AudioAnalyzerPreset) MarshalJSON() ([]byte, error) { if aap.AudioLanguage != nil { objectMap["audioLanguage"] = aap.AudioLanguage } + if aap.ExperimentalOptions != nil { + objectMap["experimentalOptions"] = aap.ExperimentalOptions + } if aap.OdataType != "" { objectMap["@odata.type"] = aap.OdataType } @@ -2271,7 +2285,7 @@ func (ao AudioOverlay) AsBasicOverlay() (BasicOverlay, bool) { // BuiltInStandardEncoderPreset describes a built-in preset for encoding the input video with the Standard // Encoder. type BuiltInStandardEncoderPreset struct { - // PresetName - The built-in preset to be used for encoding videos. Possible values include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'ContentAwareEncodingExperimental', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD' + // PresetName - The built-in preset to be used for encoding videos. Possible values include: 'H264SingleBitrateSD', 'H264SingleBitrate720p', 'H264SingleBitrate1080p', 'AdaptiveStreaming', 'AACGoodQualityAudio', 'ContentAwareEncodingExperimental', 'ContentAwareEncoding', 'H264MultipleBitrate1080p', 'H264MultipleBitrate720p', 'H264MultipleBitrateSD' PresetName EncoderNamedPreset `json:"presetName,omitempty"` // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` @@ -3028,10 +3042,12 @@ type ContentKeyPolicyFairPlayConfiguration struct { FairPlayPfxPassword *string `json:"fairPlayPfxPassword,omitempty"` // FairPlayPfx - The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). FairPlayPfx *string `json:"fairPlayPfx,omitempty"` - // RentalAndLeaseKeyType - The rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'PersistentUnlimited', 'PersistentLimited' + // RentalAndLeaseKeyType - The rental and lease key type. Possible values include: 'Unknown', 'Undefined', 'DualExpiry', 'PersistentUnlimited', 'PersistentLimited' RentalAndLeaseKeyType ContentKeyPolicyFairPlayRentalAndLeaseKeyType `json:"rentalAndLeaseKeyType,omitempty"` // RentalDuration - The rental duration. Must be greater than or equal to 0. RentalDuration *int64 `json:"rentalDuration,omitempty"` + // OfflineRentalConfiguration - Offline rental policy + OfflineRentalConfiguration *ContentKeyPolicyFairPlayOfflineRentalConfiguration `json:"offlineRentalConfiguration,omitempty"` // OdataType - Possible values include: 'OdataTypeContentKeyPolicyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyClearKeyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyUnknownConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyWidevineConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyPlayReadyConfiguration', 'OdataTypeMicrosoftMediaContentKeyPolicyFairPlayConfiguration' OdataType OdataTypeBasicContentKeyPolicyConfiguration `json:"@odata.type,omitempty"` } @@ -3055,6 +3071,9 @@ func (ckpfpc ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error if ckpfpc.RentalDuration != nil { objectMap["rentalDuration"] = ckpfpc.RentalDuration } + if ckpfpc.OfflineRentalConfiguration != nil { + objectMap["offlineRentalConfiguration"] = ckpfpc.OfflineRentalConfiguration + } if ckpfpc.OdataType != "" { objectMap["@odata.type"] = ckpfpc.OdataType } @@ -3096,6 +3115,14 @@ func (ckpfpc ContentKeyPolicyFairPlayConfiguration) AsBasicContentKeyPolicyConfi return &ckpfpc, true } +// ContentKeyPolicyFairPlayOfflineRentalConfiguration ... +type ContentKeyPolicyFairPlayOfflineRentalConfiguration struct { + // PlaybackDurationSeconds - Playback duration + PlaybackDurationSeconds *int64 `json:"playbackDurationSeconds,omitempty"` + // StorageDurationSeconds - Storage duration + StorageDurationSeconds *int64 `json:"storageDurationSeconds,omitempty"` +} + // ContentKeyPolicyOpenRestriction represents an open restriction. License or key will be delivered on // every request. type ContentKeyPolicyOpenRestriction struct { @@ -4506,6 +4533,8 @@ type EnvelopeEncryption struct { type FaceDetectorPreset struct { // Resolution - Specifies the maximum resolution at which your video is analyzed. The default behavior is "SourceResolution," which will keep the input video at its original resolution when analyzed. Using "StandardDefinition" will resize input videos to standard definition while preserving the appropriate aspect ratio. It will only resize if the video is of higher resolution. For example, a 1920x1080 input would be scaled to 640x360 before processing. Switching to "StandardDefinition" will reduce the time it takes to process high resolution video. It may also reduce the cost of using this component (see https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). However, faces that end up being too small in the resized video may not be detected. Possible values include: 'SourceResolution', 'StandardDefinition' Resolution AnalysisResolution `json:"resolution,omitempty"` + // ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself + ExperimentalOptions map[string]*string `json:"experimentalOptions"` // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` } @@ -4517,6 +4546,9 @@ func (fdp FaceDetectorPreset) MarshalJSON() ([]byte, error) { if fdp.Resolution != "" { objectMap["resolution"] = fdp.Resolution } + if fdp.ExperimentalOptions != nil { + objectMap["experimentalOptions"] = fdp.ExperimentalOptions + } if fdp.OdataType != "" { objectMap["@odata.type"] = fdp.OdataType } @@ -6250,6 +6282,10 @@ type JobOutput struct { Progress *int32 `json:"progress,omitempty"` // Label - A label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. Label *string `json:"label,omitempty"` + // StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing. + EndTime *date.Time `json:"endTime,omitempty"` // OdataType - Possible values include: 'OdataTypeJobOutput', 'OdataTypeMicrosoftMediaJobOutputAsset' OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"` } @@ -6331,6 +6367,10 @@ type JobOutputAsset struct { Progress *int32 `json:"progress,omitempty"` // Label - A label that is assigned to a JobOutput in order to help uniquely identify it. This is useful when your Transform has more than one TransformOutput, whereby your Job has more than one JobOutput. In such cases, when you submit the Job, you will add two or more JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you retrieve the Job, either through events or on a GET request, you can use the label to easily identify the JobOutput. If a label is not provided, a default value of '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in the corresponding TransformOutput and the output index is the relative index of the this JobOutput within the Job. Note that this index is the same as the relative index of the corresponding TransformOutput within its Transform. Label *string `json:"label,omitempty"` + // StartTime - READ-ONLY; The UTC date and time at which this Job Output began processing. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The UTC date and time at which this Job Output finished processing. + EndTime *date.Time `json:"endTime,omitempty"` // OdataType - Possible values include: 'OdataTypeJobOutput', 'OdataTypeMicrosoftMediaJobOutputAsset' OdataType OdataTypeBasicJobOutput `json:"@odata.type,omitempty"` } @@ -6384,6 +6424,10 @@ type JobProperties struct { Priority Priority `json:"priority,omitempty"` // CorrelationData - Customer provided key, value pairs that will be returned in Job and JobOutput state events. CorrelationData map[string]*string `json:"correlationData"` + // StartTime - READ-ONLY; The UTC date and time at which this Job began processing. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The UTC date and time at which this Job finished processing. + EndTime *date.Time `json:"endTime,omitempty"` } // MarshalJSON is the custom marshaler for JobProperties. @@ -6484,6 +6528,24 @@ func (jp *JobProperties) UnmarshalJSON(body []byte) error { } jp.CorrelationData = correlationData } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + jp.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + jp.EndTime = &endTime + } } } @@ -10896,8 +10958,10 @@ func (vVar Video) AsBasicCodec() (BasicCodec, bool) { type VideoAnalyzerPreset struct { // InsightsToExtract - Defines the type of insights that you want the service to generate. The allowed values are 'AudioInsightsOnly', 'VideoInsightsOnly', and 'AllInsights'. The default is AllInsights. If you set this to AllInsights and the input is audio only, then only audio insights are generated. Similarly if the input is video only, then only video insights are generated. It is recommended that you not use AudioInsightsOnly if you expect some of your inputs to be video only; or use VideoInsightsOnly if you expect some of your inputs to be audio only. Your Jobs in such conditions would error out. Possible values include: 'AudioInsightsOnly', 'VideoInsightsOnly', 'AllInsights' InsightsToExtract InsightsType `json:"insightsToExtract,omitempty"` - // AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). The list of supported languages are English ('en-US' and 'en-GB'), Spanish ('es-ES' and 'es-MX'), French ('fr-FR'), Italian ('it-IT'), Japanese ('ja-JP'), Portuguese ('pt-BR'), Chinese ('zh-CN'), German ('de-DE'), Arabic ('ar-EG' and 'ar-SY'), Russian ('ru-RU'), Hindi ('hi-IN'), and Korean ('ko-KR'). If you know the language of your content, it is recommended that you specify it. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. This language detection feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." + // AudioLanguage - The language for the audio payload in the input using the BCP-47 format of 'language tag-region' (e.g: 'en-US'). If you know the language of your content, it is recommended that you specify it. If the language isn't specified or set to null, automatic language detection will choose the first language detected and process with the selected language for the duration of the file. It does not currently support dynamically switching between languages after the first language is detected. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to 'en-US'." The list of supported languages is available here: https://go.microsoft.com/fwlink/?linkid=2109463 AudioLanguage *string `json:"audioLanguage,omitempty"` + // ExperimentalOptions - Dictionary containing key value pairs for parameters not exposed in the preset itself + ExperimentalOptions map[string]*string `json:"experimentalOptions"` // OdataType - Possible values include: 'OdataTypePreset', 'OdataTypeMicrosoftMediaFaceDetectorPreset', 'OdataTypeMicrosoftMediaAudioAnalyzerPreset', 'OdataTypeMicrosoftMediaBuiltInStandardEncoderPreset', 'OdataTypeMicrosoftMediaStandardEncoderPreset', 'OdataTypeMicrosoftMediaVideoAnalyzerPreset' OdataType OdataTypeBasicPreset `json:"@odata.type,omitempty"` } @@ -10912,6 +10976,9 @@ func (vap VideoAnalyzerPreset) MarshalJSON() ([]byte, error) { if vap.AudioLanguage != nil { objectMap["audioLanguage"] = vap.AudioLanguage } + if vap.ExperimentalOptions != nil { + objectMap["experimentalOptions"] = vap.ExperimentalOptions + } if vap.OdataType != "" { objectMap["@odata.type"] = vap.OdataType } diff --git a/services/netapp/mgmt/2019-10-01/netapp/accounts.go b/services/netapp/mgmt/2019-10-01/netapp/accounts.go new file mode 100644 index 000000000000..00f10b69d6f5 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/accounts.go @@ -0,0 +1,478 @@ +package netapp + +// 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" +) + +// AccountsClient is the microsoft NetApp Azure Resource Provider specification +type AccountsClient struct { + BaseClient +} + +// NewAccountsClient creates an instance of the AccountsClient client. +func NewAccountsClient(subscriptionID string) AccountsClient { + return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client. +func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update the specified NetApp account within the resource group +// Parameters: +// body - netApp Account object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountsClient) CreateOrUpdate(ctx context.Context, body Account, resourceGroupName string, accountName string) (result AccountsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, body Account, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), + autorest.WithJSON(body), + 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 AccountsClient) CreateOrUpdateSender(req *http.Request) (future AccountsCreateOrUpdateFuture, 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 AccountsClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the specified NetApp account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result AccountsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "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.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", 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 AccountsClient) DeleteSender(req *http.Request) (future AccountsDeleteFuture, 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 AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the NetApp account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Get") + 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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "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.NetApp/netAppAccounts/{accountName}", 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 AccountsClient) 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 AccountsClient) GetResponder(resp *http.Response) (result Account, 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 list and describe all NetApp accounts in the resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client AccountsClient) List(ctx context.Context, resourceGroupName string) (result AccountList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AccountsClient) ListPreparer(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.NetApp/netAppAccounts", 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 AccountsClient) 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 AccountsClient) ListResponder(resp *http.Response) (result AccountList, 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 patch the specified NetApp account +// Parameters: +// body - netApp Account object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountsClient) Update(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountsClient) UpdatePreparer(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), + autorest.WithJSON(body), + 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 AccountsClient) 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 AccountsClient) UpdateResponder(resp *http.Response) (result Account, 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 +} diff --git a/services/netapp/mgmt/2019-10-01/netapp/client.go b/services/netapp/mgmt/2019-10-01/netapp/client.go new file mode 100644 index 000000000000..0dfd8925e16e --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/client.go @@ -0,0 +1,51 @@ +// Package netapp implements the Azure ARM Netapp service API version 2019-10-01. +// +// Microsoft NetApp Azure Resource Provider specification +package netapp + +// 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 Netapp + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Netapp. +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/netapp/mgmt/2019-10-01/netapp/models.go b/services/netapp/mgmt/2019-10-01/netapp/models.go new file mode 100644 index 000000000000..e7f905978a96 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/models.go @@ -0,0 +1,1572 @@ +package netapp + +// 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" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-10-01/netapp" + +// CheckNameResourceTypes enumerates the values for check name resource types. +type CheckNameResourceTypes string + +const ( + // MicrosoftNetAppnetAppAccounts ... + MicrosoftNetAppnetAppAccounts CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts" + // MicrosoftNetAppnetAppAccountscapacityPools ... + MicrosoftNetAppnetAppAccountscapacityPools CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools" + // MicrosoftNetAppnetAppAccountscapacityPoolsvolumes ... + MicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" + // MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ... + MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" +) + +// PossibleCheckNameResourceTypesValues returns an array of possible values for the CheckNameResourceTypes const type. +func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { + return []CheckNameResourceTypes{MicrosoftNetAppnetAppAccounts, MicrosoftNetAppnetAppAccountscapacityPools, MicrosoftNetAppnetAppAccountscapacityPoolsvolumes, MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots} +} + +// EndpointType enumerates the values for endpoint type. +type EndpointType string + +const ( + // Dst ... + Dst EndpointType = "dst" + // Src ... + Src EndpointType = "src" +) + +// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. +func PossibleEndpointTypeValues() []EndpointType { + return []EndpointType{Dst, Src} +} + +// InAvailabilityReasonType enumerates the values for in availability reason type. +type InAvailabilityReasonType string + +const ( + // AlreadyExists ... + AlreadyExists InAvailabilityReasonType = "AlreadyExists" + // Invalid ... + Invalid InAvailabilityReasonType = "Invalid" +) + +// PossibleInAvailabilityReasonTypeValues returns an array of possible values for the InAvailabilityReasonType const type. +func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { + return []InAvailabilityReasonType{AlreadyExists, Invalid} +} + +// MirrorState enumerates the values for mirror state. +type MirrorState string + +const ( + // Broken ... + Broken MirrorState = "Broken" + // Mirrored ... + Mirrored MirrorState = "Mirrored" + // Uninitialized ... + Uninitialized MirrorState = "Uninitialized" +) + +// PossibleMirrorStateValues returns an array of possible values for the MirrorState const type. +func PossibleMirrorStateValues() []MirrorState { + return []MirrorState{Broken, Mirrored, Uninitialized} +} + +// RelationshipStatus enumerates the values for relationship status. +type RelationshipStatus string + +const ( + // Idle ... + Idle RelationshipStatus = "Idle" + // Transferring ... + Transferring RelationshipStatus = "Transferring" +) + +// PossibleRelationshipStatusValues returns an array of possible values for the RelationshipStatus const type. +func PossibleRelationshipStatusValues() []RelationshipStatus { + return []RelationshipStatus{Idle, Transferring} +} + +// ReplicationSchedule enumerates the values for replication schedule. +type ReplicationSchedule string + +const ( + // OneZerominutely ... + OneZerominutely ReplicationSchedule = "_10minutely" + // Daily ... + Daily ReplicationSchedule = "daily" + // Hourly ... + Hourly ReplicationSchedule = "hourly" + // Monthly ... + Monthly ReplicationSchedule = "monthly" + // Weekly ... + Weekly ReplicationSchedule = "weekly" +) + +// PossibleReplicationScheduleValues returns an array of possible values for the ReplicationSchedule const type. +func PossibleReplicationScheduleValues() []ReplicationSchedule { + return []ReplicationSchedule{OneZerominutely, Daily, Hourly, Monthly, Weekly} +} + +// ServiceLevel enumerates the values for service level. +type ServiceLevel string + +const ( + // Premium Premium service level + Premium ServiceLevel = "Premium" + // Standard Standard service level + Standard ServiceLevel = "Standard" + // Ultra Ultra service level + Ultra ServiceLevel = "Ultra" +) + +// PossibleServiceLevelValues returns an array of possible values for the ServiceLevel const type. +func PossibleServiceLevelValues() []ServiceLevel { + return []ServiceLevel{Premium, Standard, Ultra} +} + +// Account netApp account resource +type Account struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // AccountProperties - NetApp Account properties + *AccountProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + } + } + + return nil +} + +// AccountList list of NetApp account resources +type AccountList struct { + autorest.Response `json:"-"` + // Value - Multiple NetApp accounts + Value *[]Account `json:"value,omitempty"` +} + +// AccountPatch netApp account patch resource +type AccountPatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // AccountProperties - NetApp Account properties + *AccountProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountPatch. +func (ap AccountPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.Location != nil { + objectMap["location"] = ap.Location + } + if ap.Tags != nil { + objectMap["tags"] = ap.Tags + } + if ap.AccountProperties != nil { + objectMap["properties"] = ap.AccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountPatch struct. +func (ap *AccountPatch) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ap.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ap.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ap.Tags = tags + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + ap.AccountProperties = &accountProperties + } + } + } + + return nil +} + +// AccountProperties netApp account properties +type AccountProperties struct { + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // ActiveDirectories - Active Directories + ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` +} + +// AccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AccountsCreateOrUpdateFuture) Result(client AccountsClient) (a Account, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("netapp.AccountsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { + a, err = client.CreateOrUpdateResponder(a.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request") + } + } + return +} + +// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AccountsDeleteFuture) Result(client AccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("netapp.AccountsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ActiveDirectory active Directory +type ActiveDirectory struct { + // ActiveDirectoryID - Id of the Active Directory + ActiveDirectoryID *string `json:"activeDirectoryId,omitempty"` + // Username - Username of Active Directory domain administrator + Username *string `json:"username,omitempty"` + // Password - Plain text password of Active Directory domain administrator + Password *string `json:"password,omitempty"` + // Domain - Name of the Active Directory domain + Domain *string `json:"domain,omitempty"` + // DNS - Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain + DNS *string `json:"dns,omitempty"` + // Status - Status of the Active Directory + Status *string `json:"status,omitempty"` + // SmbServerName - NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes + SmbServerName *string `json:"smbServerName,omitempty"` + // OrganizationalUnit - The Organizational Unit (OU) within the Windows Active Directory + OrganizationalUnit *string `json:"organizationalUnit,omitempty"` +} + +// AuthorizeRequest authorize request +type AuthorizeRequest struct { + // RemoteVolumeResourceID - Resource id + RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` +} + +// CapacityPool capacity pool resource +type CapacityPool struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // PoolProperties - Capacity pool properties + *PoolProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityPool. +func (cp CapacityPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Location != nil { + objectMap["location"] = cp.Location + } + if cp.Tags != nil { + objectMap["tags"] = cp.Tags + } + if cp.PoolProperties != nil { + objectMap["properties"] = cp.PoolProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CapacityPool struct. +func (cp *CapacityPool) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cp.Tags = tags + } + case "properties": + if v != nil { + var poolProperties PoolProperties + err = json.Unmarshal(*v, &poolProperties) + if err != nil { + return err + } + cp.PoolProperties = &poolProperties + } + } + } + + return nil +} + +// CapacityPoolList list of capacity pool resources +type CapacityPoolList struct { + autorest.Response `json:"-"` + // Value - List of Capacity pools + Value *[]CapacityPool `json:"value,omitempty"` +} + +// CapacityPoolPatch capacity pool patch resource +type CapacityPoolPatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // PoolPatchProperties - Capacity pool properties + *PoolPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityPoolPatch. +func (cpp CapacityPoolPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpp.Location != nil { + objectMap["location"] = cpp.Location + } + if cpp.Tags != nil { + objectMap["tags"] = cpp.Tags + } + if cpp.PoolPatchProperties != nil { + objectMap["properties"] = cpp.PoolPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CapacityPoolPatch struct. +func (cpp *CapacityPoolPatch) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cpp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cpp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cpp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cpp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cpp.Tags = tags + } + case "properties": + if v != nil { + var poolPatchProperties PoolPatchProperties + err = json.Unmarshal(*v, &poolPatchProperties) + if err != nil { + return err + } + cpp.PoolPatchProperties = &poolPatchProperties + } + } + } + + return nil +} + +// Dimension dimension of blobs, possibly be blob type or access tier. +type Dimension struct { + // Name - Display name of dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of dimension. + DisplayName *string `json:"displayName,omitempty"` +} + +// ExportPolicyRule volume Export Policy Rule +type ExportPolicyRule struct { + // RuleIndex - Order index + RuleIndex *int32 `json:"ruleIndex,omitempty"` + // UnixReadOnly - Read only access + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + // UnixReadWrite - Read and write access + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` + // Cifs - Allows CIFS protocol + Cifs *bool `json:"cifs,omitempty"` + // Nfsv3 - Allows NFSv3 protocol + Nfsv3 *bool `json:"nfsv3,omitempty"` + // Nfsv41 - Allows NFSv4.1 protocol + Nfsv41 *bool `json:"nfsv41,omitempty"` + // AllowedClients - Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names + AllowedClients *string `json:"allowedClients,omitempty"` +} + +// MetricSpecification metric specification of operation. +type MetricSpecification struct { + // Name - Name of metric specification. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of metric specification. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Display description of metric specification. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit could be Bytes or Count. + Unit *string `json:"unit,omitempty"` + // Dimensions - Dimensions of blobs, including blob type and access tier. + Dimensions *[]Dimension `json:"dimensions,omitempty"` + // AggregationType - Aggregation type could be Average. + AggregationType *string `json:"aggregationType,omitempty"` + // FillGapWithZero - The property to decide fill gap with zero or not. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Category - The category this metric specification belong to, could be Capacity. + Category *string `json:"category,omitempty"` + // ResourceIDDimensionNameOverride - Account Resource Id. + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` +} + +// MountTarget mount Target +type MountTarget struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // MountTargetProperties - Mount Target Properties + *MountTargetProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for MountTarget. +func (mt MountTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mt.Location != nil { + objectMap["location"] = mt.Location + } + if mt.Tags != nil { + objectMap["tags"] = mt.Tags + } + if mt.MountTargetProperties != nil { + objectMap["properties"] = mt.MountTargetProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MountTarget struct. +func (mt *MountTarget) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mt.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mt.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mt.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mt.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mt.Tags = tags + } + case "properties": + if v != nil { + var mountTargetProperties MountTargetProperties + err = json.Unmarshal(*v, &mountTargetProperties) + if err != nil { + return err + } + mt.MountTargetProperties = &mountTargetProperties + } + } + } + + return nil +} + +// MountTargetList list of Mount Targets +type MountTargetList struct { + autorest.Response `json:"-"` + // Value - A list of Mount targets + Value *[]MountTarget `json:"value,omitempty"` +} + +// MountTargetProperties mount target properties +type MountTargetProperties struct { + // MountTargetID - READ-ONLY; UUID v4 used to identify the MountTarget + MountTargetID *string `json:"mountTargetId,omitempty"` + // FileSystemID - UUID v4 used to identify the MountTarget + FileSystemID *string `json:"fileSystemId,omitempty"` + // IPAddress - READ-ONLY; The mount target's IPv4 address + IPAddress *string `json:"ipAddress,omitempty"` + // Subnet - The subnet + Subnet *string `json:"subnet,omitempty"` + // StartIP - The start of IPv4 address range to use when creating a new mount target + StartIP *string `json:"startIp,omitempty"` + // EndIP - The end of IPv4 address range to use when creating a new mount target + EndIP *string `json:"endIp,omitempty"` + // Gateway - The gateway of the IPv4 address range to use when creating a new mount target + Gateway *string `json:"gateway,omitempty"` + // Netmask - The netmask of the IPv4 address range to use when creating a new mount target + Netmask *string `json:"netmask,omitempty"` + // SmbServerFqdn - The SMB server's Fully Qualified Domain Name, FQDN + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// Operation microsoft.NetApp REST API operation definition. +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - The origin of operations. + Origin *string `json:"origin,omitempty"` + // OperationProperties - Properties of operation, include metric specifications. + *OperationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Display != nil { + objectMap["display"] = o.Display + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) 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 "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft NetApp. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed etc. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Operation description. + Description *string `json:"description,omitempty"` +} + +// OperationListResult result of the request to list Cloud Volume operations. It contains a list of +// operations and a URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of Storage operations supported by the Storage resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// OperationProperties properties of operation, include metric specifications. +type OperationProperties struct { + // ServiceSpecification - One property of operation, include metric specifications. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// PoolPatchProperties patchable pool properties +type PoolPatchProperties struct { + // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + Size *int64 `json:"size,omitempty"` + // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` +} + +// PoolProperties pool properties +type PoolProperties struct { + // PoolID - READ-ONLY; UUID v4 used to identify the Pool + PoolID *string `json:"poolId,omitempty"` + // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). + Size *int64 `json:"size,omitempty"` + // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// PoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoolsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoolsCreateOrUpdateFuture) Result(client PoolsClient) (cp CapacityPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("netapp.PoolsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent { + cp, err = client.CreateOrUpdateResponder(cp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", cp.Response.Response, "Failure responding to request") + } + } + return +} + +// PoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type PoolsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoolsDeleteFuture) Result(client PoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("netapp.PoolsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationObject replication properties +type ReplicationObject struct { + // ReplicationID - Id + ReplicationID *string `json:"replicationId,omitempty"` + // EndpointType - Indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'Src', 'Dst' + EndpointType EndpointType `json:"endpointType,omitempty"` + // ReplicationSchedule - Schedule. Possible values include: '10minutely', 'Hourly', 'Daily', 'Weekly', 'Monthly' + ReplicationSchedule ReplicationSchedule `json:"replicationSchedule,omitempty"` + // RemoteVolumeResourceID - The resource ID of the remote volume. + RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` + // RemoteVolumeRegion - The remote region for the other end of the Volume Replication. + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` +} + +// ReplicationStatus replication status +type ReplicationStatus struct { + autorest.Response `json:"-"` + // Healthy - Replication health check + Healthy *bool `json:"healthy,omitempty"` + // RelationshipStatus - Status of the mirror relationship. Possible values include: 'Idle', 'Transferring' + RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` + // MirrorState - The status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken' + MirrorState MirrorState `json:"mirrorState,omitempty"` + // TotalProgress - The progress of the replication + TotalProgress *string `json:"totalProgress,omitempty"` + // ErrorMessage - Displays error message if the replication is in an error state + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// ResourceNameAvailability information regarding availability of a resource name. +type ResourceNameAvailability struct { + autorest.Response `json:"-"` + // IsAvailable - true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. + IsAvailable *bool `json:"isAvailable,omitempty"` + // Reason - Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists' + Reason InAvailabilityReasonType `json:"reason,omitempty"` + // Message - 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 resource name is already in use, and direct them to select a different name. + Message *string `json:"message,omitempty"` +} + +// ResourceNameAvailabilityRequest resource name availability request content. +type ResourceNameAvailabilityRequest struct { + // Name - Resource name to verify. + Name *string `json:"name,omitempty"` + // Type - Resource type used for verification. Possible values include: 'MicrosoftNetAppnetAppAccounts', 'MicrosoftNetAppnetAppAccountscapacityPools', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots' + Type CheckNameResourceTypes `json:"type,omitempty"` + // ResourceGroup - Resource group name. + ResourceGroup *string `json:"resourceGroup,omitempty"` +} + +// ServiceSpecification one property of operation, include metric specifications. +type ServiceSpecification struct { + // MetricSpecifications - Metric specifications of operation. + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` +} + +// Snapshot snapshot of a Volume +type Snapshot struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // SnapshotProperties - Snapshot Properties + *SnapshotProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + if s.SnapshotProperties != nil { + objectMap["properties"] = s.SnapshotProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Snapshot struct. +func (s *Snapshot) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + case "properties": + if v != nil { + var snapshotProperties SnapshotProperties + err = json.Unmarshal(*v, &snapshotProperties) + if err != nil { + return err + } + s.SnapshotProperties = &snapshotProperties + } + } + } + + return nil +} + +// SnapshotPatch snapshot patch +type SnapshotPatch struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SnapshotPatch. +func (sp SnapshotPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.Tags != nil { + objectMap["tags"] = sp.Tags + } + return json.Marshal(objectMap) +} + +// SnapshotProperties snapshot properties +type SnapshotProperties struct { + // SnapshotID - READ-ONLY; UUID v4 used to identify the Snapshot + SnapshotID *string `json:"snapshotId,omitempty"` + // FileSystemID - UUID v4 used to identify the FileSystem + FileSystemID *string `json:"fileSystemId,omitempty"` + // Created - READ-ONLY; The creation date of the snapshot + Created *date.Time `json:"created,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// SnapshotsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SnapshotsCreateFuture) Result(client SnapshotsClient) (s Snapshot, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SnapshotsDeleteFuture) Result(client SnapshotsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SnapshotsList list of Snapshots +type SnapshotsList struct { + autorest.Response `json:"-"` + // Value - A list of Snapshots + Value *[]Snapshot `json:"value,omitempty"` +} + +// Volume volume resource +type Volume struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // VolumeProperties - Volume properties + *VolumeProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Volume. +func (vVar Volume) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.Location != nil { + objectMap["location"] = vVar.Location + } + if vVar.Tags != nil { + objectMap["tags"] = vVar.Tags + } + if vVar.VolumeProperties != nil { + objectMap["properties"] = vVar.VolumeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Volume struct. +func (vVar *Volume) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vVar.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vVar.Tags = tags + } + case "properties": + if v != nil { + var volumeProperties VolumeProperties + err = json.Unmarshal(*v, &volumeProperties) + if err != nil { + return err + } + vVar.VolumeProperties = &volumeProperties + } + } + } + + return nil +} + +// VolumeList list of volume resources +type VolumeList struct { + autorest.Response `json:"-"` + // Value - List of volumes + Value *[]Volume `json:"value,omitempty"` +} + +// VolumePatch volume patch resource +type VolumePatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // VolumePatchProperties - Patchable volume properties + *VolumePatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumePatch. +func (vp VolumePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vp.Location != nil { + objectMap["location"] = vp.Location + } + if vp.Tags != nil { + objectMap["tags"] = vp.Tags + } + if vp.VolumePatchProperties != nil { + objectMap["properties"] = vp.VolumePatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VolumePatch struct. +func (vp *VolumePatch) 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 "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vp.Tags = tags + } + case "properties": + if v != nil { + var volumePatchProperties VolumePatchProperties + err = json.Unmarshal(*v, &volumePatchProperties) + if err != nil { + return err + } + vp.VolumePatchProperties = &volumePatchProperties + } + } + } + + return nil +} + +// VolumePatchProperties patchable volume properties +type VolumePatchProperties struct { + // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` + // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + UsageThreshold *int64 `json:"usageThreshold,omitempty"` + // ExportPolicy - Set of export policy rules + ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` +} + +// VolumePatchPropertiesExportPolicy set of export policy rules +type VolumePatchPropertiesExportPolicy struct { + // Rules - Export policy rule + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} + +// VolumeProperties volume properties +type VolumeProperties struct { + // FileSystemID - READ-ONLY; Unique FileSystem Identifier. + FileSystemID *string `json:"fileSystemId,omitempty"` + // CreationToken - A unique file path for the volume. Used when creating mount targets + CreationToken *string `json:"creationToken,omitempty"` + // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' + ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` + // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + UsageThreshold *int64 `json:"usageThreshold,omitempty"` + // ExportPolicy - Set of export policy rules + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + // ProtocolTypes - Set of protocol types + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // SnapshotID - UUID v4 or resource identifier used to identify the Snapshot. + SnapshotID *string `json:"snapshotId,omitempty"` + // BaremetalTenantID - READ-ONLY; Unique Baremetal Tenant Identifier. + BaremetalTenantID *string `json:"baremetalTenantId,omitempty"` + // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes + SubnetID *string `json:"subnetId,omitempty"` + // MountTargets - List of mount targets + MountTargets interface{} `json:"mountTargets,omitempty"` + // VolumeType - What type of volume is this + VolumeType *string `json:"volumeType,omitempty"` + // DataProtection - DataProtection type volumes include an object containing details of the replication + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + // IsRestoring - Restoring + IsRestoring *bool `json:"isRestoring,omitempty"` +} + +// VolumePropertiesDataProtection dataProtection type volumes include an object containing details of the +// replication +type VolumePropertiesDataProtection struct { + // Replication - Replication properties + Replication *ReplicationObject `json:"replication,omitempty"` +} + +// VolumePropertiesExportPolicy set of export policy rules +type VolumePropertiesExportPolicy struct { + // Rules - Export policy rule + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} + +// VolumesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VolumesCreateOrUpdateFuture) Result(client VolumesClient) (vVar Volume, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("netapp.VolumesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { + vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") + } + } + return +} + +// VolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VolumesDeleteFuture) Result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteFuture") + return + } + ar.Response = future.Response() + return +} diff --git a/services/netapp/mgmt/2019-10-01/netapp/mounttargets.go b/services/netapp/mgmt/2019-10-01/netapp/mounttargets.go new file mode 100644 index 000000000000..13e7dcbd3de9 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/mounttargets.go @@ -0,0 +1,131 @@ +package netapp + +// 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" +) + +// MountTargetsClient is the microsoft NetApp Azure Resource Provider specification +type MountTargetsClient struct { + BaseClient +} + +// NewMountTargetsClient creates an instance of the MountTargetsClient client. +func NewMountTargetsClient(subscriptionID string) MountTargetsClient { + return NewMountTargetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMountTargetsClientWithBaseURI creates an instance of the MountTargetsClient client. +func NewMountTargetsClientWithBaseURI(baseURI string, subscriptionID string) MountTargetsClient { + return MountTargetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list all mount targets associated with the volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client MountTargetsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result MountTargetList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MountTargetsClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.MountTargetsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.MountTargetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.MountTargetsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.MountTargetsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client MountTargetsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/mountTargets", 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 MountTargetsClient) 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 MountTargetsClient) ListResponder(resp *http.Response) (result MountTargetList, 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/netapp/mgmt/2019-10-01/netapp/netappapi/interfaces.go b/services/netapp/mgmt/2019-10-01/netapp/netappapi/interfaces.go new file mode 100644 index 000000000000..e47edd2d0362 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/netappapi/interfaces.go @@ -0,0 +1,95 @@ +package netappapi + +// 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/netapp/mgmt/2019-10-01/netapp" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result netapp.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*netapp.OperationsClient)(nil) + +// ResourceClientAPI contains the set of methods on the ResourceClient type. +type ResourceClientAPI interface { + CheckFilePathAvailability(ctx context.Context, body netapp.ResourceNameAvailabilityRequest, location string) (result netapp.ResourceNameAvailability, err error) + CheckNameAvailability(ctx context.Context, body netapp.ResourceNameAvailabilityRequest, location string) (result netapp.ResourceNameAvailability, err error) +} + +var _ ResourceClientAPI = (*netapp.ResourceClient)(nil) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CreateOrUpdate(ctx context.Context, body netapp.Account, resourceGroupName string, accountName string) (result netapp.AccountsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result netapp.AccountsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result netapp.Account, err error) + List(ctx context.Context, resourceGroupName string) (result netapp.AccountList, err error) + Update(ctx context.Context, body netapp.AccountPatch, resourceGroupName string, accountName string) (result netapp.Account, err error) +} + +var _ AccountsClientAPI = (*netapp.AccountsClient)(nil) + +// PoolsClientAPI contains the set of methods on the PoolsClient type. +type PoolsClientAPI interface { + CreateOrUpdate(ctx context.Context, body netapp.CapacityPool, resourceGroupName string, accountName string, poolName string) (result netapp.PoolsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.PoolsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.CapacityPool, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.CapacityPoolList, err error) + Update(ctx context.Context, body netapp.CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (result netapp.CapacityPool, err error) +} + +var _ PoolsClientAPI = (*netapp.PoolsClient)(nil) + +// VolumesClientAPI contains the set of methods on the VolumesClient type. +type VolumesClientAPI interface { + AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body netapp.AuthorizeRequest) (result autorest.Response, err error) + BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, body netapp.Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesDeleteFuture, err error) + DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.Volume, err error) + List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.VolumeList, err error) + ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.ReplicationStatus, err error) + ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result autorest.Response, err error) + Update(ctx context.Context, body netapp.VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.Volume, err error) +} + +var _ VolumesClientAPI = (*netapp.VolumesClient)(nil) + +// MountTargetsClientAPI contains the set of methods on the MountTargetsClient type. +type MountTargetsClientAPI interface { + List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.MountTargetList, err error) +} + +var _ MountTargetsClientAPI = (*netapp.MountTargetsClient)(nil) + +// SnapshotsClientAPI contains the set of methods on the SnapshotsClient type. +type SnapshotsClientAPI interface { + Create(ctx context.Context, body netapp.Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.Snapshot, err error) + List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.SnapshotsList, err error) + Update(ctx context.Context, body netapp.SnapshotPatch, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.Snapshot, err error) +} + +var _ SnapshotsClientAPI = (*netapp.SnapshotsClient)(nil) diff --git a/services/netapp/mgmt/2019-10-01/netapp/operations.go b/services/netapp/mgmt/2019-10-01/netapp/operations.go new file mode 100644 index 000000000000..cd2ea139ad24 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/operations.go @@ -0,0 +1,109 @@ +package netapp + +// 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 microsoft NetApp Azure Resource Provider specification +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 Microsoft.NetApp 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, "netapp.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, "netapp.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.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.NetApp/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/netapp/mgmt/2019-10-01/netapp/pools.go b/services/netapp/mgmt/2019-10-01/netapp/pools.go new file mode 100644 index 000000000000..e7b76159b131 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/pools.go @@ -0,0 +1,499 @@ +package netapp + +// 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" +) + +// PoolsClient is the microsoft NetApp Azure Resource Provider specification +type PoolsClient struct { + BaseClient +} + +// NewPoolsClient creates an instance of the PoolsClient client. +func NewPoolsClient(subscriptionID string) PoolsClient { + return NewPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPoolsClientWithBaseURI creates an instance of the PoolsClient client. +func NewPoolsClientWithBaseURI(baseURI string, subscriptionID string) PoolsClient { + return PoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update a capacity pool +// Parameters: +// body - capacity pool object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client PoolsClient) CreateOrUpdate(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (result PoolsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.PoolProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.PoolProperties.PoolID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.PoolProperties.PoolID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + {Target: "body.PoolProperties.Size", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.PoolProperties.Size", Name: validation.InclusiveMaximum, Rule: int64(549755813888000), Chain: nil}, + {Target: "body.PoolProperties.Size", Name: validation.InclusiveMinimum, Rule: int64(4398046511104), Chain: nil}, + }}, + }}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PoolsClient) CreateOrUpdatePreparer(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), + autorest.WithJSON(body), + 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 PoolsClient) CreateOrUpdateSender(req *http.Request) (future PoolsCreateOrUpdateFuture, 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 PoolsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the specified capacity pool +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client PoolsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result PoolsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "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.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", 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 PoolsClient) DeleteSender(req *http.Request) (future PoolsDeleteFuture, 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 PoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get details of the specified capacity pool +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client PoolsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result CapacityPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Get") + 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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", 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 PoolsClient) 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 PoolsClient) GetResponder(resp *http.Response) (result CapacityPool, 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 list all capacity pools in the NetApp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client PoolsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "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.NetApp/netAppAccounts/{accountName}/capacityPools", 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 PoolsClient) 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 PoolsClient) ListResponder(resp *http.Response) (result CapacityPoolList, 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 patch the specified capacity pool +// Parameters: +// body - capacity pool object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client PoolsClient) Update(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (result CapacityPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PoolsClient) UpdatePreparer(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), + autorest.WithJSON(body), + 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 PoolsClient) 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 PoolsClient) UpdateResponder(resp *http.Response) (result CapacityPool, 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 +} diff --git a/services/netapp/mgmt/2019-10-01/netapp/resource.go b/services/netapp/mgmt/2019-10-01/netapp/resource.go new file mode 100644 index 000000000000..98e2f1503c95 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/resource.go @@ -0,0 +1,212 @@ +package netapp + +// 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" +) + +// ResourceClient is the microsoft NetApp Azure Resource Provider specification +type ResourceClient struct { + BaseClient +} + +// NewResourceClient creates an instance of the ResourceClient client. +func NewResourceClient(subscriptionID string) ResourceClient { + return NewResourceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceClientWithBaseURI creates an instance of the ResourceClient client. +func NewResourceClientWithBaseURI(baseURI string, subscriptionID string) ResourceClient { + return ResourceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckFilePathAvailability check if a file path is available. +// Parameters: +// body - file path availability request. +// location - the location +func (client ResourceClient) CheckFilePathAvailability(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (result ResourceNameAvailability, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckFilePathAvailability") + 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: body, + Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.ResourceClient", "CheckFilePathAvailability", err.Error()) + } + + req, err := client.CheckFilePathAvailabilityPreparer(ctx, body, location) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckFilePathAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckFilePathAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckFilePathAvailabilityPreparer prepares the CheckFilePathAvailability request. +func (client ResourceClient) CheckFilePathAvailabilityPreparer(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-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.NetApp/locations/{location}/checkFilePathAvailability", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckFilePathAvailabilitySender sends the CheckFilePathAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceClient) CheckFilePathAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckFilePathAvailabilityResponder handles the response to the CheckFilePathAvailability request. The method always +// closes the http.Response Body. +func (client ResourceClient) CheckFilePathAvailabilityResponder(resp *http.Response) (result ResourceNameAvailability, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckNameAvailability check if a resource name is available. +// Parameters: +// body - name availability request. +// location - the location +func (client ResourceClient) CheckNameAvailability(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (result ResourceNameAvailability, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckNameAvailability") + 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: body, + Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.ResourceClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, body, location) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ResourceClient) CheckNameAvailabilityPreparer(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-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.NetApp/locations/{location}/checkNameAvailability", pathParameters), + autorest.WithJSON(body), + 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 ResourceClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ResourceClient) CheckNameAvailabilityResponder(resp *http.Response) (result ResourceNameAvailability, 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/netapp/mgmt/2019-10-01/netapp/snapshots.go b/services/netapp/mgmt/2019-10-01/netapp/snapshots.go new file mode 100644 index 000000000000..19dbca87d9d3 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/snapshots.go @@ -0,0 +1,517 @@ +package netapp + +// 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" +) + +// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification +type SnapshotsClient struct { + BaseClient +} + +// NewSnapshotsClient creates an instance of the SnapshotsClient client. +func NewSnapshotsClient(subscriptionID string) SnapshotsClient { + return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client. +func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { + return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create the specified snapshot within the given volume +// Parameters: +// body - snapshot object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the mount target +func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.SnapshotProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.SnapshotProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.SnapshotProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + {Target: "body.SnapshotProperties.FileSystemID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.SnapshotProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.SnapshotProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.SnapshotProperties.FileSystemID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + }}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SnapshotsClient) CreatePreparer(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(body), + 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 SnapshotsClient) CreateSender(req *http.Request) (future SnapshotsCreateFuture, 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 +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete snapshot +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the mount target +func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", 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 SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, 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 SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get details of the specified snapshot +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the mount target +func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") + 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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", 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 SnapshotsClient) 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 SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, 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 list all snapshots associated with the volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client SnapshotsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SnapshotsList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SnapshotsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots", 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 SnapshotsClient) 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 SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotsList, 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 patch a snapshot +// Parameters: +// body - snapshot object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the mount target +func (client SnapshotsClient) Update(ctx context.Context, body SnapshotPatch, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SnapshotsClient) UpdatePreparer(ctx context.Context, body SnapshotPatch, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(body), + 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 SnapshotsClient) 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 SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, 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 +} diff --git a/services/netapp/mgmt/2019-10-01/netapp/version.go b/services/netapp/mgmt/2019-10-01/netapp/version.go new file mode 100644 index 000000000000..15ae8573f032 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/version.go @@ -0,0 +1,30 @@ +package netapp + +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 + " netapp/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/netapp/mgmt/2019-10-01/netapp/volumes.go b/services/netapp/mgmt/2019-10-01/netapp/volumes.go new file mode 100644 index 000000000000..718315cc37e2 --- /dev/null +++ b/services/netapp/mgmt/2019-10-01/netapp/volumes.go @@ -0,0 +1,971 @@ +package netapp + +// 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" +) + +// VolumesClient is the microsoft NetApp Azure Resource Provider specification +type VolumesClient struct { + BaseClient +} + +// NewVolumesClient creates an instance of the VolumesClient client. +func NewVolumesClient(subscriptionID string) VolumesClient { + return NewVolumesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVolumesClientWithBaseURI creates an instance of the VolumesClient client. +func NewVolumesClientWithBaseURI(baseURI string, subscriptionID string) VolumesClient { + return VolumesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AuthorizeReplication authorize the replication connection on the source volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// body - authorize request object supplied in the body of the operation. +func (client VolumesClient) AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.AuthorizeReplication") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "AuthorizeReplication", err.Error()) + } + + req, err := client.AuthorizeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure preparing request") + return + } + + resp, err := client.AuthorizeReplicationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", resp, "Failure sending request") + return + } + + result, err = client.AuthorizeReplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", resp, "Failure responding to request") + } + + return +} + +// AuthorizeReplicationPreparer prepares the AuthorizeReplication request. +func (client VolumesClient) AuthorizeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2019-10-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AuthorizeReplicationSender sends the AuthorizeReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) AuthorizeReplicationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// AuthorizeReplicationResponder handles the response to the AuthorizeReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) AuthorizeReplicationResponder(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 +} + +// BreakReplication break the replication connection on the destination volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.BreakReplication") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "BreakReplication", err.Error()) + } + + req, err := client.BreakReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure preparing request") + return + } + + resp, err := client.BreakReplicationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", resp, "Failure sending request") + return + } + + result, err = client.BreakReplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", resp, "Failure responding to request") + } + + return +} + +// BreakReplicationPreparer prepares the BreakReplication request. +func (client VolumesClient) BreakReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BreakReplicationSender sends the BreakReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) BreakReplicationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// BreakReplicationResponder handles the response to the BreakReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) BreakReplicationResponder(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 +} + +// CreateOrUpdate create or update the specified volume within the capacity pool +// Parameters: +// body - volume object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.VolumeProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.FileSystemID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + {Target: "body.VolumeProperties.CreationToken", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.VolumeProperties.UsageThreshold", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMaximum, Rule: int64(109951162777600), Chain: nil}, + {Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMinimum, Rule: int64(107374182400), Chain: nil}, + }}, + {Target: "body.VolumeProperties.SnapshotID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil}, + }}, + {Target: "body.VolumeProperties.BaremetalTenantID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.BaremetalTenantID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.BaremetalTenantID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.BaremetalTenantID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + {Target: "body.VolumeProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.VolumeProperties.DataProtection", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication.RemoteVolumeResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), + autorest.WithJSON(body), + 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 VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, 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 VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the specified volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", 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 VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, 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 VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteReplication delete the replication connection on the destination volume, and send release to the source +// replication +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.DeleteReplication") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "DeleteReplication", err.Error()) + } + + req, err := client.DeleteReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteReplicationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", resp, "Failure sending request") + return + } + + result, err = client.DeleteReplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", resp, "Failure responding to request") + } + + return +} + +// DeleteReplicationPreparer prepares the DeleteReplication request. +func (client VolumesClient) DeleteReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteReplicationSender sends the DeleteReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) DeleteReplicationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// DeleteReplicationResponder handles the response to the DeleteReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) DeleteReplicationResponder(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 get the details of the specified volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get") + 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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", 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 VolumesClient) 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 VolumesClient) GetResponder(resp *http.Response) (result Volume, 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 list all volumes within the capacity pool +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client VolumesClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VolumesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", 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 VolumesClient) 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 VolumesClient) ListResponder(resp *http.Response) (result VolumeList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ReplicationStatusMethod get the status of the replication +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result ReplicationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReplicationStatusMethod") + 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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "ReplicationStatusMethod", err.Error()) + } + + req, err := client.ReplicationStatusMethodPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", nil, "Failure preparing request") + return + } + + resp, err := client.ReplicationStatusMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure sending request") + return + } + + result, err = client.ReplicationStatusMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure responding to request") + } + + return +} + +// ReplicationStatusMethodPreparer prepares the ReplicationStatusMethod request. +func (client VolumesClient) ReplicationStatusMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReplicationStatusMethodSender sends the ReplicationStatusMethod request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) ReplicationStatusMethodSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ReplicationStatusMethodResponder handles the response to the ReplicationStatusMethod request. The method always +// closes the http.Response Body. +func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response) (result ReplicationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it +// will reverse-resync the connection and sync from source to destination. +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ResyncReplication") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "ResyncReplication", err.Error()) + } + + req, err := client.ResyncReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure preparing request") + return + } + + resp, err := client.ResyncReplicationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", resp, "Failure sending request") + return + } + + result, err = client.ResyncReplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", resp, "Failure responding to request") + } + + return +} + +// ResyncReplicationPreparer prepares the ResyncReplication request. +func (client VolumesClient) ResyncReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncReplicationSender sends the ResyncReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) ResyncReplicationSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ResyncReplicationResponder handles the response to the ResyncReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) ResyncReplicationResponder(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 +} + +// Update patch the specified volume +// Parameters: +// body - volume object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) Update(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.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: 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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VolumesClient) UpdatePreparer(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), + autorest.WithJSON(body), + 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 VolumesClient) 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 VolumesClient) UpdateResponder(resp *http.Response) (result Volume, 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 +} diff --git a/services/preview/authorization/mgmt/2017-10-01-preview/authorization/authorizationapi/interfaces.go b/services/preview/authorization/mgmt/2017-10-01-preview/authorization/authorizationapi/interfaces.go index 42fee8b0533f..3856b3d366e2 100644 --- a/services/preview/authorization/mgmt/2017-10-01-preview/authorization/authorizationapi/interfaces.go +++ b/services/preview/authorization/mgmt/2017-10-01-preview/authorization/authorizationapi/interfaces.go @@ -51,8 +51,8 @@ var _ RoleDefinitionsClientAPI = (*authorization.RoleDefinitionsClient)(nil) // ProviderOperationsMetadataClientAPI contains the set of methods on the ProviderOperationsMetadataClient type. type ProviderOperationsMetadataClientAPI interface { - Get(ctx context.Context, resourceProviderNamespace string, expand string) (result authorization.ProviderOperationsMetadata, err error) - List(ctx context.Context, expand string) (result authorization.ProviderOperationsMetadataListResultPage, err error) + Get(ctx context.Context, resourceProviderNamespace string, APIVersion string, expand string) (result authorization.ProviderOperationsMetadata, err error) + List(ctx context.Context, APIVersion string, expand string) (result authorization.ProviderOperationsMetadataListResultPage, err error) } var _ ProviderOperationsMetadataClientAPI = (*authorization.ProviderOperationsMetadataClient)(nil) diff --git a/services/preview/authorization/mgmt/2017-10-01-preview/authorization/provideroperationsmetadata.go b/services/preview/authorization/mgmt/2017-10-01-preview/authorization/provideroperationsmetadata.go index 5d30cf9ed564..c7e814a9dcf2 100644 --- a/services/preview/authorization/mgmt/2017-10-01-preview/authorization/provideroperationsmetadata.go +++ b/services/preview/authorization/mgmt/2017-10-01-preview/authorization/provideroperationsmetadata.go @@ -46,8 +46,9 @@ func NewProviderOperationsMetadataClientWithBaseURI(baseURI string, subscription // Get gets provider operations metadata for the specified resource provider. // Parameters: // resourceProviderNamespace - the namespace of the resource provider. +// APIVersion - the API version to use for the operation. // expand - specifies whether to expand the values. -func (client ProviderOperationsMetadataClient) Get(ctx context.Context, resourceProviderNamespace string, expand string) (result ProviderOperationsMetadata, err error) { +func (client ProviderOperationsMetadataClient) Get(ctx context.Context, resourceProviderNamespace string, APIVersion string, expand string) (result ProviderOperationsMetadata, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationsMetadataClient.Get") defer func() { @@ -58,7 +59,7 @@ func (client ProviderOperationsMetadataClient) Get(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, resourceProviderNamespace, expand) + req, err := client.GetPreparer(ctx, resourceProviderNamespace, APIVersion, expand) if err != nil { err = autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataClient", "Get", nil, "Failure preparing request") return @@ -80,12 +81,11 @@ func (client ProviderOperationsMetadataClient) Get(ctx context.Context, resource } // GetPreparer prepares the Get request. -func (client ProviderOperationsMetadataClient) GetPreparer(ctx context.Context, resourceProviderNamespace string, expand string) (*http.Request, error) { +func (client ProviderOperationsMetadataClient) GetPreparer(ctx context.Context, resourceProviderNamespace string, APIVersion string, expand string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace), } - const APIVersion = "" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -125,8 +125,9 @@ func (client ProviderOperationsMetadataClient) GetResponder(resp *http.Response) // List gets provider operations metadata for all resource providers. // Parameters: +// APIVersion - the API version to use for this operation. // expand - specifies whether to expand the values. -func (client ProviderOperationsMetadataClient) List(ctx context.Context, expand string) (result ProviderOperationsMetadataListResultPage, err error) { +func (client ProviderOperationsMetadataClient) List(ctx context.Context, APIVersion string, expand string) (result ProviderOperationsMetadataListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationsMetadataClient.List") defer func() { @@ -138,7 +139,7 @@ func (client ProviderOperationsMetadataClient) List(ctx context.Context, expand }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, expand) + req, err := client.ListPreparer(ctx, APIVersion, expand) if err != nil { err = autorest.NewErrorWithError(err, "authorization.ProviderOperationsMetadataClient", "List", nil, "Failure preparing request") return @@ -160,8 +161,7 @@ func (client ProviderOperationsMetadataClient) List(ctx context.Context, expand } // ListPreparer prepares the List request. -func (client ProviderOperationsMetadataClient) ListPreparer(ctx context.Context, expand string) (*http.Request, error) { - const APIVersion = "" +func (client ProviderOperationsMetadataClient) ListPreparer(ctx context.Context, APIVersion string, expand string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -221,7 +221,7 @@ func (client ProviderOperationsMetadataClient) listNextResults(ctx context.Conte } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProviderOperationsMetadataClient) ListComplete(ctx context.Context, expand string) (result ProviderOperationsMetadataListResultIterator, err error) { +func (client ProviderOperationsMetadataClient) ListComplete(ctx context.Context, APIVersion string, expand string) (result ProviderOperationsMetadataListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationsMetadataClient.List") defer func() { @@ -232,6 +232,6 @@ func (client ProviderOperationsMetadataClient) ListComplete(ctx context.Context, tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, expand) + result.page, err = client.List(ctx, APIVersion, expand) return } diff --git a/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint/models.go b/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint/models.go index 94267d5bae8b..0d848a3bcef1 100644 --- a/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint/models.go +++ b/services/preview/blueprint/mgmt/2018-11-01-preview/blueprint/models.go @@ -999,7 +999,7 @@ type AssignmentProperties struct { // BlueprintID - ID of the published version of a blueprint definition. BlueprintID *string `json:"blueprintId,omitempty"` // Parameters - Blueprint assignment parameter values. - Parameters map[string]*ParameterValueBase `json:"parameters"` + Parameters map[string]*ParameterValue `json:"parameters"` // ResourceGroups - Names and locations of resource group placeholders. ResourceGroups map[string]*ResourceGroupValue `json:"resourceGroups"` // Status - READ-ONLY; Status of blueprint assignment. This field is readonly. @@ -1040,6 +1040,8 @@ func (ap AssignmentProperties) MarshalJSON() ([]byte, error) { // AssignmentStatus the status of a blueprint assignment. This field is readonly. type AssignmentStatus struct { + // ManagedResources - READ-ONLY; List of resources that were created by the blueprint assignment. + ManagedResources *[]string `json:"managedResources,omitempty"` // TimeCreated - READ-ONLY; Creation time of this blueprint definition. TimeCreated *date.Time `json:"timeCreated,omitempty"` // LastModified - READ-ONLY; Last modified time of this blueprint definition. @@ -1406,22 +1408,16 @@ type ParameterDefinitionMetadata struct { DisplayName *string `json:"displayName,omitempty"` // Description - Description of this parameter/resourceGroup. Description *string `json:"description,omitempty"` - // StrongType - StrongType for UI to render rich experience during blueprint assignment. + // StrongType - StrongType for UI to render rich experience during blueprint assignment. Supported strong types are resourceType, principalId and location. StrongType *string `json:"strongType,omitempty"` } -// ParameterValue value for the specified parameter. +// ParameterValue value for the specified parameter. Can be either 'value' or 'reference' but not both. type ParameterValue struct { - // Value - Actual value. + // Value - Parameter value as value type. Value interface{} `json:"value,omitempty"` - // Description - Optional property. Establishes ParameterValueBase as a BaseClass. - Description *string `json:"description,omitempty"` -} - -// ParameterValueBase base class for ParameterValue. -type ParameterValueBase struct { - // Description - Optional property. Establishes ParameterValueBase as a BaseClass. - Description *string `json:"description,omitempty"` + // Reference - Parameter value as reference type. + Reference *SecretValueReference `json:"reference,omitempty"` } // PolicyAssignmentArtifact blueprint artifact that applies a Policy assignment. @@ -1547,7 +1543,7 @@ type PolicyAssignmentArtifactProperties struct { // PolicyDefinitionID - Azure resource ID of the policy definition. PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` // Parameters - Parameter values for the policy definition. - Parameters map[string]*ParameterValueBase `json:"parameters"` + Parameters map[string]*ParameterValue `json:"parameters"` // ResourceGroup - Name of the resource group placeholder to which the policy will be assigned. ResourceGroup *string `json:"resourceGroup,omitempty"` } @@ -2162,14 +2158,6 @@ type RoleAssignmentArtifactProperties struct { ResourceGroup *string `json:"resourceGroup,omitempty"` } -// SecretReferenceParameterValue the reference to a secret, if the parameter should be protected. -type SecretReferenceParameterValue struct { - // Reference - Specifies the reference. - Reference *SecretValueReference `json:"reference,omitempty"` - // Description - Optional property. Establishes ParameterValueBase as a BaseClass. - Description *string `json:"description,omitempty"` -} - // SecretValueReference reference to a Key Vault secret. type SecretValueReference struct { // KeyVault - Specifies the reference to a given Azure Key Vault. @@ -2350,7 +2338,7 @@ type TemplateArtifactProperties struct { // ResourceGroup - If applicable, the name of the resource group placeholder to which the Resource Manager template blueprint artifact will be deployed. ResourceGroup *string `json:"resourceGroup,omitempty"` // Parameters - Resource Manager template blueprint artifact parameter values. - Parameters map[string]*ParameterValueBase `json:"parameters"` + Parameters map[string]*ParameterValue `json:"parameters"` } // MarshalJSON is the custom marshaler for TemplateArtifactProperties. diff --git a/services/preview/cognitiveservices/v1.0/anomalydetector/anomalydetectorapi/interfaces.go b/services/preview/cognitiveservices/v1.0/anomalydetector/anomalydetectorapi/interfaces.go index f57b8a48443e..5dceda5f09b9 100644 --- a/services/preview/cognitiveservices/v1.0/anomalydetector/anomalydetectorapi/interfaces.go +++ b/services/preview/cognitiveservices/v1.0/anomalydetector/anomalydetectorapi/interfaces.go @@ -24,6 +24,7 @@ import ( // BaseClientAPI contains the set of methods on the BaseClient type. type BaseClientAPI interface { + ChangePointDetect(ctx context.Context, body anomalydetector.ChangePointDetectRequest) (result anomalydetector.ChangePointDetectResponse, err error) EntireDetect(ctx context.Context, body anomalydetector.Request) (result anomalydetector.EntireDetectResponse, err error) LastDetect(ctx context.Context, body anomalydetector.Request) (result anomalydetector.LastDetectResponse, err error) } diff --git a/services/preview/cognitiveservices/v1.0/anomalydetector/client.go b/services/preview/cognitiveservices/v1.0/anomalydetector/client.go index ff385f090f55..dc10c7314548 100644 --- a/services/preview/cognitiveservices/v1.0/anomalydetector/client.go +++ b/services/preview/cognitiveservices/v1.0/anomalydetector/client.go @@ -1,9 +1,16 @@ // Package anomalydetector implements the Azure ARM Anomalydetector service API version 1.0. // -// The Anomaly Detector API detects anomalies automatically in time series data. It supports two functionalities, one -// is for detecting the whole series with model trained by the timeseries, another is detecting last point with model -// trained by points before. By using this service, business customers can discover incidents and establish a logic -// flow for root cause analysis. +// The Anomaly Detector API detects anomalies automatically in time series data. It supports two kinds of mode, one is +// for stateless using, another is for stateful using. In stateless mode, there are three functionalities. Entire +// Detect is for detecting the whole series with model trained by the time series, Last Detect is detecting last point +// with model trained by points before. ChangePoint Detect is for detecting trend changes in time series. In stateful +// mode, user can store time series, the stored time series will be used for detection anomalies. Under this mode, user +// can still use the above three functionalities by only giving a time range without preparing time series in client +// side. Besides the above three functionalities, stateful model also provide group based detection and labeling +// service. By leveraging labeling service user can provide labels for each detection result, these labels will be used +// for retuning or regenerating detection models. Inconsistency detection is a kind of group based detection, this +// detection will find inconsistency ones in a set of time series. By using anomaly detector service, business +// customers can discover incidents and establish a logic flow for root cause analysis. package anomalydetector // Copyright (c) Microsoft and contributors. All rights reserved. @@ -52,6 +59,83 @@ func NewWithoutDefaults(endpoint string) BaseClient { } } +// ChangePointDetect evaluate change point score of every series point +// Parameters: +// body - time series points and granularity is needed. Advanced model parameters can also be set in the +// request if needed. +func (client BaseClient) ChangePointDetect(ctx context.Context, body ChangePointDetectRequest) (result ChangePointDetectResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ChangePointDetect") + 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: body, + Constraints: []validation.Constraint{{Target: "body.Series", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("anomalydetector.BaseClient", "ChangePointDetect", err.Error()) + } + + req, err := client.ChangePointDetectPreparer(ctx, body) + if err != nil { + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "ChangePointDetect", nil, "Failure preparing request") + return + } + + resp, err := client.ChangePointDetectSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "ChangePointDetect", resp, "Failure sending request") + return + } + + result, err = client.ChangePointDetectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "ChangePointDetect", resp, "Failure responding to request") + } + + return +} + +// ChangePointDetectPreparer prepares the ChangePointDetect request. +func (client BaseClient) ChangePointDetectPreparer(ctx context.Context, body ChangePointDetectRequest) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/anomalydetector/v1.0", urlParameters), + autorest.WithPath("/timeseries/changePoint/detect"), + autorest.WithJSON(body)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ChangePointDetectSender sends the ChangePointDetect request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ChangePointDetectSender(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...) +} + +// ChangePointDetectResponder handles the response to the ChangePointDetect request. The method always +// closes the http.Response Body. +func (client BaseClient) ChangePointDetectResponder(resp *http.Response) (result ChangePointDetectResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // EntireDetect this operation generates a model using an entire series, each point is detected with the same model. // With this method, points before and after a certain point are used to determine whether it is an anomaly. The entire // detection can give user an overall status of the time series. diff --git a/services/preview/cognitiveservices/v1.0/anomalydetector/models.go b/services/preview/cognitiveservices/v1.0/anomalydetector/models.go index e82f87857fdb..32dc03500469 100644 --- a/services/preview/cognitiveservices/v1.0/anomalydetector/models.go +++ b/services/preview/cognitiveservices/v1.0/anomalydetector/models.go @@ -56,6 +56,33 @@ type APIError struct { Message *string `json:"message,omitempty"` } +// ChangePointDetectRequest ... +type ChangePointDetectRequest struct { + // Series - Time series data points. Points should be sorted by timestamp in ascending order to match the change point detection result. + Series *[]Point `json:"series,omitempty"` + // Granularity - Can only be one of yearly, monthly, weekly, daily, hourly or minutely. Granularity is used for verify whether input series is valid. Possible values include: 'Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly', 'Minutely' + Granularity Granularity `json:"granularity,omitempty"` + // CustomInterval - Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. + CustomInterval *int32 `json:"customInterval,omitempty"` + // Period - Optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically. + Period *int32 `json:"period,omitempty"` + // StableTrendWindow - Optional argument, advanced model parameter, a default stableTrendWindow will be used in detection. + StableTrendWindow *int32 `json:"stableTrendWindow,omitempty"` + // Threshold - Optional argument, advanced model parameter, between 0.0-1.0, the lower the value is, the larger the trend error will be which means less change point will be accepted. + Threshold *float64 `json:"threshold,omitempty"` +} + +// ChangePointDetectResponse ... +type ChangePointDetectResponse struct { + autorest.Response `json:"-"` + // Period - Frequency extracted from the series, zero means no recurrent pattern has been found. + Period *int32 `json:"period,omitempty"` + // IsChangePoint - isChangePoint contains change point properties for each input point. True means an anomaly either negative or positive has been detected. The index of the array is consistent with the input series. + IsChangePoint *[]bool `json:"isChangePoint,omitempty"` + // ConfidenceScores - the change point confidence of each point + ConfidenceScores *[]float64 `json:"confidenceScores,omitempty"` +} + // EntireDetectResponse ... type EntireDetectResponse struct { autorest.Response `json:"-"` @@ -108,7 +135,7 @@ type Point struct { type Request struct { // Series - Time series data points. Points should be sorted by timestamp in ascending order to match the anomaly detection result. If the data is not sorted correctly or there is duplicated timestamp, the API will not work. In such case, an error message will be returned. Series *[]Point `json:"series,omitempty"` - // Granularity - Can only be one of yearly, monthly, weekly, daily, hourly or minutely. Granularity is used for verify whether input series is valid. Possible values include: 'Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly', 'Minutely' + // Granularity - Possible values include: 'Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly', 'Minutely' Granularity Granularity `json:"granularity,omitempty"` // CustomInterval - Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. CustomInterval *int32 `json:"customInterval,omitempty"` diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/client.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/client.go new file mode 100644 index 000000000000..a5b7e3cc955e --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/client.go @@ -0,0 +1,51 @@ +// Package containerregistry implements the Azure ARM Containerregistry service API version 2019-12-01-preview. +// +// +package containerregistry + +// 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 Containerregistry + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerregistry. +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/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi/interfaces.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi/interfaces.go new file mode 100644 index 000000000000..452426068449 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi/interfaces.go @@ -0,0 +1,72 @@ +package containerregistryapi + +// 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/containerregistry/mgmt/2019-12-01-preview/containerregistry" +) + +// RegistriesClientAPI contains the set of methods on the RegistriesClient type. +type RegistriesClientAPI interface { + CheckNameAvailability(ctx context.Context, registryNameCheckRequest containerregistry.RegistryNameCheckRequest) (result containerregistry.RegistryNameStatus, err error) + Create(ctx context.Context, resourceGroupName string, registryName string, registry containerregistry.Registry) (result containerregistry.RegistriesCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.RegistriesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.Registry, err error) + ImportImage(ctx context.Context, resourceGroupName string, registryName string, parameters containerregistry.ImportImageParameters) (result containerregistry.RegistriesImportImageFuture, err error) + List(ctx context.Context) (result containerregistry.RegistryListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerregistry.RegistryListResultPage, err error) + ListCredentials(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.RegistryListCredentialsResult, err error) + ListUsages(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.RegistryUsageListResult, err error) + RegenerateCredential(ctx context.Context, resourceGroupName string, registryName string, regenerateCredentialParameters containerregistry.RegenerateCredentialParameters) (result containerregistry.RegistryListCredentialsResult, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters containerregistry.RegistryUpdateParameters) (result containerregistry.RegistriesUpdateFuture, err error) +} + +var _ RegistriesClientAPI = (*containerregistry.RegistriesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result containerregistry.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*containerregistry.OperationsClient)(nil) + +// ReplicationsClientAPI contains the set of methods on the ReplicationsClient type. +type ReplicationsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication containerregistry.Replication) (result containerregistry.ReplicationsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result containerregistry.ReplicationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result containerregistry.Replication, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.ReplicationListResultPage, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters containerregistry.ReplicationUpdateParameters) (result containerregistry.ReplicationsUpdateFuture, err error) +} + +var _ ReplicationsClientAPI = (*containerregistry.ReplicationsClient)(nil) + +// WebhooksClientAPI contains the set of methods on the WebhooksClient type. +type WebhooksClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters containerregistry.WebhookCreateParameters) (result containerregistry.WebhooksCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.WebhooksDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.Webhook, err error) + GetCallbackConfig(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.CallbackConfig, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.WebhookListResultPage, err error) + ListEvents(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.EventListResultPage, err error) + Ping(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.EventInfo, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters containerregistry.WebhookUpdateParameters) (result containerregistry.WebhooksUpdateFuture, err error) +} + +var _ WebhooksClientAPI = (*containerregistry.WebhooksClient)(nil) diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/models.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/models.go new file mode 100644 index 000000000000..e5c1f7c04b44 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/models.go @@ -0,0 +1,2494 @@ +package containerregistry + +// 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/containerregistry/mgmt/2019-12-01-preview/containerregistry" + +// Action enumerates the values for action. +type Action string + +const ( + // Allow ... + Allow Action = "Allow" +) + +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{Allow} +} + +// DefaultAction enumerates the values for default action. +type DefaultAction string + +const ( + // DefaultActionAllow ... + DefaultActionAllow DefaultAction = "Allow" + // DefaultActionDeny ... + DefaultActionDeny DefaultAction = "Deny" +) + +// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. +func PossibleDefaultActionValues() []DefaultAction { + return []DefaultAction{DefaultActionAllow, DefaultActionDeny} +} + +// EncryptionStatus enumerates the values for encryption status. +type EncryptionStatus string + +const ( + // Disabled ... + Disabled EncryptionStatus = "disabled" + // Enabled ... + Enabled EncryptionStatus = "enabled" +) + +// PossibleEncryptionStatusValues returns an array of possible values for the EncryptionStatus const type. +func PossibleEncryptionStatusValues() []EncryptionStatus { + return []EncryptionStatus{Disabled, Enabled} +} + +// ImportMode enumerates the values for import mode. +type ImportMode string + +const ( + // Force ... + Force ImportMode = "Force" + // NoForce ... + NoForce ImportMode = "NoForce" +) + +// PossibleImportModeValues returns an array of possible values for the ImportMode const type. +func PossibleImportModeValues() []ImportMode { + return []ImportMode{Force, NoForce} +} + +// PasswordName enumerates the values for password name. +type PasswordName string + +const ( + // Password ... + Password PasswordName = "password" + // Password2 ... + Password2 PasswordName = "password2" +) + +// PossiblePasswordNameValues returns an array of possible values for the PasswordName const type. +func PossiblePasswordNameValues() []PasswordName { + return []PasswordName{Password, Password2} +} + +// PolicyStatus enumerates the values for policy status. +type PolicyStatus string + +const ( + // PolicyStatusDisabled ... + PolicyStatusDisabled PolicyStatus = "disabled" + // PolicyStatusEnabled ... + PolicyStatusEnabled PolicyStatus = "enabled" +) + +// PossiblePolicyStatusValues returns an array of possible values for the PolicyStatus const type. +func PossiblePolicyStatusValues() []PolicyStatus { + return []PolicyStatus{PolicyStatusDisabled, PolicyStatusEnabled} +} + +// 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" + // 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, Updating} +} + +// RegistryUsageUnit enumerates the values for registry usage unit. +type RegistryUsageUnit string + +const ( + // Bytes ... + Bytes RegistryUsageUnit = "Bytes" + // Count ... + Count RegistryUsageUnit = "Count" +) + +// PossibleRegistryUsageUnitValues returns an array of possible values for the RegistryUsageUnit const type. +func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { + return []RegistryUsageUnit{Bytes, Count} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // UserAssigned ... + UserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Basic ... + Basic SkuName = "Basic" + // Classic ... + Classic SkuName = "Classic" + // Premium ... + Premium SkuName = "Premium" + // Standard ... + Standard SkuName = "Standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Classic, Premium, Standard} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // SkuTierBasic ... + SkuTierBasic SkuTier = "Basic" + // SkuTierClassic ... + SkuTierClassic SkuTier = "Classic" + // SkuTierPremium ... + SkuTierPremium SkuTier = "Premium" + // SkuTierStandard ... + SkuTierStandard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierClassic, SkuTierPremium, SkuTierStandard} +} + +// TrustPolicyType enumerates the values for trust policy type. +type TrustPolicyType string + +const ( + // Notary ... + Notary TrustPolicyType = "Notary" +) + +// PossibleTrustPolicyTypeValues returns an array of possible values for the TrustPolicyType const type. +func PossibleTrustPolicyTypeValues() []TrustPolicyType { + return []TrustPolicyType{Notary} +} + +// WebhookAction enumerates the values for webhook action. +type WebhookAction string + +const ( + // ChartDelete ... + ChartDelete WebhookAction = "chart_delete" + // ChartPush ... + ChartPush WebhookAction = "chart_push" + // Delete ... + Delete WebhookAction = "delete" + // Push ... + Push WebhookAction = "push" + // Quarantine ... + Quarantine WebhookAction = "quarantine" +) + +// PossibleWebhookActionValues returns an array of possible values for the WebhookAction const type. +func PossibleWebhookActionValues() []WebhookAction { + return []WebhookAction{ChartDelete, ChartPush, Delete, Push, Quarantine} +} + +// WebhookStatus enumerates the values for webhook status. +type WebhookStatus string + +const ( + // WebhookStatusDisabled ... + WebhookStatusDisabled WebhookStatus = "disabled" + // WebhookStatusEnabled ... + WebhookStatusEnabled WebhookStatus = "enabled" +) + +// PossibleWebhookStatusValues returns an array of possible values for the WebhookStatus const type. +func PossibleWebhookStatusValues() []WebhookStatus { + return []WebhookStatus{WebhookStatusDisabled, WebhookStatusEnabled} +} + +// Actor the agent that initiated the event. For most situations, this could be from the authorization +// context of the request. +type Actor struct { + // Name - The subject or username associated with the request context that generated the event. + Name *string `json:"name,omitempty"` +} + +// CallbackConfig the configuration of service URI and custom headers for the webhook. +type CallbackConfig struct { + autorest.Response `json:"-"` + // ServiceURI - The service URI for the webhook to post notifications. + ServiceURI *string `json:"serviceUri,omitempty"` + // CustomHeaders - Custom headers that will be added to the webhook notifications. + CustomHeaders map[string]*string `json:"customHeaders"` +} + +// MarshalJSON is the custom marshaler for CallbackConfig. +func (cc CallbackConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cc.ServiceURI != nil { + objectMap["serviceUri"] = cc.ServiceURI + } + if cc.CustomHeaders != nil { + objectMap["customHeaders"] = cc.CustomHeaders + } + return json.Marshal(objectMap) +} + +// EncryptionProperty ... +type EncryptionProperty struct { + // Status - Indicates whether or not the encryption is enabled for container registry. Possible values include: 'Enabled', 'Disabled' + Status EncryptionStatus `json:"status,omitempty"` + // KeyVaultProperties - Key vault properties. + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` +} + +// Event the event for a webhook. +type Event struct { + // EventRequestMessage - The event request message sent to the service URI. + EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"` + // EventResponseMessage - The event response message received from the service URI. + EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"` + // ID - The event ID. + ID *string `json:"id,omitempty"` +} + +// EventContent the content of the event request message. +type EventContent struct { + // ID - The event ID. + ID *string `json:"id,omitempty"` + // Timestamp - The time at which the event occurred. + Timestamp *date.Time `json:"timestamp,omitempty"` + // Action - The action that encompasses the provided event. + Action *string `json:"action,omitempty"` + // Target - The target of the event. + Target *Target `json:"target,omitempty"` + // Request - The request that generated the event. + Request *Request `json:"request,omitempty"` + // Actor - The agent that initiated the event. For most situations, this could be from the authorization context of the request. + Actor *Actor `json:"actor,omitempty"` + // Source - The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + Source *Source `json:"source,omitempty"` +} + +// EventInfo the basic information of an event. +type EventInfo struct { + autorest.Response `json:"-"` + // ID - The event ID. + ID *string `json:"id,omitempty"` +} + +// EventListResult the result of a request to list events for a webhook. +type EventListResult struct { + autorest.Response `json:"-"` + // Value - The list of events. Since this list may be incomplete, the nextLink field should be used to request the next list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of events. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventListResultIterator provides access to a complete listing of Event values. +type EventListResultIterator struct { + i int + page EventListResultPage +} + +// 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 *EventListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventListResultIterator.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 *EventListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventListResultIterator) 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 EventListResultIterator) Response() EventListResult { + 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 EventListResultIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventListResultIterator type. +func NewEventListResultIterator(page EventListResultPage) EventListResultIterator { + return EventListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (elr EventListResult) IsEmpty() bool { + return elr.Value == nil || len(*elr.Value) == 0 +} + +// eventListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (elr EventListResult) eventListResultPreparer(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))) +} + +// EventListResultPage contains a page of Event values. +type EventListResultPage struct { + fn func(context.Context, EventListResult) (EventListResult, error) + elr EventListResult +} + +// 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 *EventListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventListResultPage.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 *EventListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventListResultPage) NotDone() bool { + return !page.elr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventListResultPage) Response() EventListResult { + return page.elr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventListResultPage) Values() []Event { + if page.elr.IsEmpty() { + return nil + } + return *page.elr.Value +} + +// Creates a new instance of the EventListResultPage type. +func NewEventListResultPage(getNextPage func(context.Context, EventListResult) (EventListResult, error)) EventListResultPage { + return EventListResultPage{fn: getNextPage} +} + +// EventRequestMessage the event request message sent to the service URI. +type EventRequestMessage struct { + // Content - The content of the event request message. + Content *EventContent `json:"content,omitempty"` + // Headers - The headers of the event request message. + Headers map[string]*string `json:"headers"` + // Method - The HTTP method used to send the event request message. + Method *string `json:"method,omitempty"` + // RequestURI - The URI used to send the event request message. + RequestURI *string `json:"requestUri,omitempty"` + // Version - The HTTP message version. + Version *string `json:"version,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventRequestMessage. +func (erm EventRequestMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erm.Content != nil { + objectMap["content"] = erm.Content + } + if erm.Headers != nil { + objectMap["headers"] = erm.Headers + } + if erm.Method != nil { + objectMap["method"] = erm.Method + } + if erm.RequestURI != nil { + objectMap["requestUri"] = erm.RequestURI + } + if erm.Version != nil { + objectMap["version"] = erm.Version + } + return json.Marshal(objectMap) +} + +// EventResponseMessage the event response message received from the service URI. +type EventResponseMessage struct { + // Content - The content of the event response message. + Content *string `json:"content,omitempty"` + // Headers - The headers of the event response message. + Headers map[string]*string `json:"headers"` + // ReasonPhrase - The reason phrase of the event response message. + ReasonPhrase *string `json:"reasonPhrase,omitempty"` + // StatusCode - The status code of the event response message. + StatusCode *string `json:"statusCode,omitempty"` + // Version - The HTTP message version. + Version *string `json:"version,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventResponseMessage. +func (erm EventResponseMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erm.Content != nil { + objectMap["content"] = erm.Content + } + if erm.Headers != nil { + objectMap["headers"] = erm.Headers + } + if erm.ReasonPhrase != nil { + objectMap["reasonPhrase"] = erm.ReasonPhrase + } + if erm.StatusCode != nil { + objectMap["statusCode"] = erm.StatusCode + } + if erm.Version != nil { + objectMap["version"] = erm.Version + } + return json.Marshal(objectMap) +} + +// IdentityProperties managed identity for the resource. +type IdentityProperties struct { + // PrincipalID - The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the resource. The user identity + // dictionary key references will be ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + // providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for IdentityProperties. +func (IP IdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.PrincipalID != nil { + objectMap["principalId"] = IP.PrincipalID + } + if IP.TenantID != nil { + objectMap["tenantId"] = IP.TenantID + } + if IP.Type != "" { + objectMap["type"] = IP.Type + } + if IP.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = IP.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ImportImageParameters ... +type ImportImageParameters struct { + // Source - The source of the image. + Source *ImportSource `json:"source,omitempty"` + // TargetTags - List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + TargetTags *[]string `json:"targetTags,omitempty"` + // UntaggedTargetRepositories - List of strings of repository names to do a manifest only copy. No tag will be created. + UntaggedTargetRepositories *[]string `json:"untaggedTargetRepositories,omitempty"` + // Mode - When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force' + Mode ImportMode `json:"mode,omitempty"` +} + +// ImportSource ... +type ImportSource struct { + // ResourceID - The resource identifier of the source Azure Container Registry. + ResourceID *string `json:"resourceId,omitempty"` + // RegistryURI - The address of the source registry (e.g. 'mcr.microsoft.com'). + RegistryURI *string `json:"registryUri,omitempty"` + // Credentials - Credentials used when importing from a registry uri. + Credentials *ImportSourceCredentials `json:"credentials,omitempty"` + // SourceImage - Repository name of the source image. + // Specify an image by repository ('hello-world'). This will use the 'latest' tag. + // Specify an image by tag ('hello-world:latest'). + // Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + SourceImage *string `json:"sourceImage,omitempty"` +} + +// ImportSourceCredentials ... +type ImportSourceCredentials struct { + // Username - The username to authenticate with the source registry. + Username *string `json:"username,omitempty"` + // Password - The password used to authenticate with the source registry. + Password *string `json:"password,omitempty"` +} + +// IPRule IP rule with specific IP or IP range in CIDR format. +type IPRule struct { + // Action - The action of IP ACL rule. Possible values include: 'Allow' + Action Action `json:"action,omitempty"` + // IPAddressOrRange - Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + IPAddressOrRange *string `json:"value,omitempty"` +} + +// KeyVaultProperties ... +type KeyVaultProperties struct { + // KeyIdentifier - Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // Identity - The client id of the identity which will be used to access key vault. + Identity *string `json:"identity,omitempty"` +} + +// NetworkRuleSet the network rule set for a container registry. +type NetworkRuleSet struct { + // DefaultAction - The default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny' + DefaultAction DefaultAction `json:"defaultAction,omitempty"` + // VirtualNetworkRules - The virtual network rules. + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + // IPRules - The IP ACL rules. + IPRules *[]IPRule `json:"ipRules,omitempty"` +} + +// OperationDefinition the definition of a container registry operation. +type OperationDefinition struct { + // Origin - The origin information of the container registry operation. + Origin *string `json:"origin,omitempty"` + // Name - Operation name: {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + // Display - The display information for the container registry operation. + Display *OperationDisplayDefinition `json:"display,omitempty"` + // OperationPropertiesDefinition - The properties information for the container registry operation. + *OperationPropertiesDefinition `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDefinition. +func (od OperationDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if od.Origin != nil { + objectMap["origin"] = od.Origin + } + if od.Name != nil { + objectMap["name"] = od.Name + } + if od.Display != nil { + objectMap["display"] = od.Display + } + if od.OperationPropertiesDefinition != nil { + objectMap["properties"] = od.OperationPropertiesDefinition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationDefinition struct. +func (od *OperationDefinition) 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 "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + od.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + od.Name = &name + } + case "display": + if v != nil { + var display OperationDisplayDefinition + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + od.Display = &display + } + case "properties": + if v != nil { + var operationPropertiesDefinition OperationPropertiesDefinition + err = json.Unmarshal(*v, &operationPropertiesDefinition) + if err != nil { + return err + } + od.OperationPropertiesDefinition = &operationPropertiesDefinition + } + } + } + + return nil +} + +// OperationDisplayDefinition the display information for a container registry operation. +type OperationDisplayDefinition struct { + // Provider - The resource provider name: Microsoft.ContainerRegistry. + 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 the result of a request to list container registry operations. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of container registry operations. Since this list may be incomplete, the nextLink field should be used to request the next list of operations. + Value *[]OperationDefinition `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of container registry operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of OperationDefinition 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() OperationDefinition { + if !iter.page.NotDone() { + return OperationDefinition{} + } + 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 OperationDefinition 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() []OperationDefinition { + 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} +} + +// OperationMetricSpecificationDefinition the definition of Azure Monitoring metric. +type OperationMetricSpecificationDefinition struct { + // Name - Metric name. + Name *string `json:"name,omitempty"` + // DisplayName - Metric display name. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Metric description. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Metric unit. + Unit *string `json:"unit,omitempty"` + // AggregationType - Metric aggregation type. + AggregationType *string `json:"aggregationType,omitempty"` + // InternalMetricName - Internal metric name. + InternalMetricName *string `json:"internalMetricName,omitempty"` +} + +// OperationPropertiesDefinition the definition of Azure Monitoring properties. +type OperationPropertiesDefinition struct { + // ServiceSpecification - The definition of Azure Monitoring service. + ServiceSpecification *OperationServiceSpecificationDefinition `json:"serviceSpecification,omitempty"` +} + +// OperationServiceSpecificationDefinition the definition of Azure Monitoring list. +type OperationServiceSpecificationDefinition struct { + // MetricSpecifications - A list of Azure Monitoring metrics definition. + MetricSpecifications *[]OperationMetricSpecificationDefinition `json:"metricSpecifications,omitempty"` +} + +// Policies the policies for a container registry. +type Policies struct { + // QuarantinePolicy - The quarantine policy for a container registry. + QuarantinePolicy *QuarantinePolicy `json:"quarantinePolicy,omitempty"` + // TrustPolicy - The content trust policy for a container registry. + TrustPolicy *TrustPolicy `json:"trustPolicy,omitempty"` + // RetentionPolicy - The retention policy for a container registry. + RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` +} + +// QuarantinePolicy the quarantine policy for a container registry. +type QuarantinePolicy struct { + // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' + Status PolicyStatus `json:"status,omitempty"` +} + +// RegenerateCredentialParameters the parameters used to regenerate the login credential. +type RegenerateCredentialParameters struct { + // Name - Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'Password', 'Password2' + Name PasswordName `json:"name,omitempty"` +} + +// RegistriesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RegistriesCreateFuture) Result(client RegistriesClient) (r Registry, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.CreateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// RegistriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RegistriesDeleteFuture) Result(client RegistriesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RegistriesImportImageFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesImportImageFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RegistriesImportImageFuture) Result(client RegistriesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesImportImageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesImportImageFuture") + return + } + ar.Response = future.Response() + return +} + +// RegistriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RegistriesUpdateFuture) Result(client RegistriesClient) (r Registry, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.UpdateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// Registry an object that represents a container registry. +type Registry struct { + autorest.Response `json:"-"` + // Sku - The SKU of the container registry. + Sku *Sku `json:"sku,omitempty"` + // Identity - The identity of the container registry. + Identity *IdentityProperties `json:"identity,omitempty"` + // RegistryProperties - The properties of the container registry. + *RegistryProperties `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"` +} + +// MarshalJSON is the custom marshaler for Registry. +func (r Registry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Sku != nil { + objectMap["sku"] = r.Sku + } + if r.Identity != nil { + objectMap["identity"] = r.Identity + } + if r.RegistryProperties != nil { + objectMap["properties"] = r.RegistryProperties + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Registry struct. +func (r *Registry) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + r.Sku = &sku + } + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + r.Identity = &identity + } + case "properties": + if v != nil { + var registryProperties RegistryProperties + err = json.Unmarshal(*v, ®istryProperties) + if err != nil { + return err + } + r.RegistryProperties = ®istryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + } + } + + return nil +} + +// RegistryListCredentialsResult the response from the ListCredentials operation. +type RegistryListCredentialsResult struct { + autorest.Response `json:"-"` + // Username - The username for a container registry. + Username *string `json:"username,omitempty"` + // Passwords - The list of passwords for a container registry. + Passwords *[]RegistryPassword `json:"passwords,omitempty"` +} + +// RegistryListResult the result of a request to list container registries. +type RegistryListResult struct { + autorest.Response `json:"-"` + // Value - The list of container registries. Since this list may be incomplete, the nextLink field should be used to request the next list of container registries. + Value *[]Registry `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of container registries. + NextLink *string `json:"nextLink,omitempty"` +} + +// RegistryListResultIterator provides access to a complete listing of Registry values. +type RegistryListResultIterator struct { + i int + page RegistryListResultPage +} + +// 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 *RegistryListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistryListResultIterator.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 *RegistryListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RegistryListResultIterator) 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 RegistryListResultIterator) Response() RegistryListResult { + 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 RegistryListResultIterator) Value() Registry { + if !iter.page.NotDone() { + return Registry{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RegistryListResultIterator type. +func NewRegistryListResultIterator(page RegistryListResultPage) RegistryListResultIterator { + return RegistryListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr RegistryListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// registryListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr RegistryListResult) registryListResultPreparer(ctx context.Context) (*http.Request, error) { + if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// RegistryListResultPage contains a page of Registry values. +type RegistryListResultPage struct { + fn func(context.Context, RegistryListResult) (RegistryListResult, error) + rlr RegistryListResult +} + +// 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 *RegistryListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistryListResultPage.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.rlr) + if err != nil { + return err + } + page.rlr = 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 *RegistryListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RegistryListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RegistryListResultPage) Response() RegistryListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RegistryListResultPage) Values() []Registry { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// Creates a new instance of the RegistryListResultPage type. +func NewRegistryListResultPage(getNextPage func(context.Context, RegistryListResult) (RegistryListResult, error)) RegistryListResultPage { + return RegistryListResultPage{fn: getNextPage} +} + +// RegistryNameCheckRequest a request to check whether a container registry name is available. +type RegistryNameCheckRequest struct { + // Name - The name of the container registry. + Name *string `json:"name,omitempty"` + // Type - The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + Type *string `json:"type,omitempty"` +} + +// RegistryNameStatus the result of a request to check the availability of a container registry name. +type RegistryNameStatus struct { + autorest.Response `json:"-"` + // NameAvailable - The value that indicates whether the name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - If any, the reason that the name is not available. + Reason *string `json:"reason,omitempty"` + // Message - If any, the error message that provides more detail for the reason that the name is not available. + Message *string `json:"message,omitempty"` +} + +// RegistryPassword the login password for the container registry. +type RegistryPassword struct { + // Name - The password name. Possible values include: 'Password', 'Password2' + Name PasswordName `json:"name,omitempty"` + // Value - The password value. + Value *string `json:"value,omitempty"` +} + +// RegistryProperties the properties of a container registry. +type RegistryProperties struct { + // LoginServer - READ-ONLY; The URL that can be used to log into the container registry. + LoginServer *string `json:"loginServer,omitempty"` + // CreationDate - READ-ONLY; The creation date of the container registry in ISO8601 format. + CreationDate *date.Time `json:"creationDate,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; The status of the container registry at the time the operation was called. + Status *Status `json:"status,omitempty"` + // AdminUserEnabled - The value that indicates whether the admin user is enabled. + AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + // StorageAccount - The properties of the storage account for the container registry. Only applicable to Classic SKU. + StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"` + // NetworkRuleSet - The network rule set for a container registry. + NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` + // Policies - The policies for a container registry. + Policies *Policies `json:"policies,omitempty"` + // Encryption - The encryption settings of container registry. + Encryption *EncryptionProperty `json:"encryption,omitempty"` +} + +// RegistryPropertiesUpdateParameters the parameters for updating the properties of a container registry. +type RegistryPropertiesUpdateParameters struct { + // AdminUserEnabled - The value that indicates whether the admin user is enabled. + AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + // NetworkRuleSet - The network rule set for a container registry. + NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` + // Policies - The policies for a container registry. + Policies *Policies `json:"policies,omitempty"` + // Encryption - The encryption settings of container registry. + Encryption *EncryptionProperty `json:"encryption,omitempty"` +} + +// RegistryUpdateParameters the parameters for updating a container registry. +type RegistryUpdateParameters struct { + // Tags - The tags for the container registry. + Tags map[string]*string `json:"tags"` + // Sku - The SKU of the container registry. + Sku *Sku `json:"sku,omitempty"` + // Identity - The identity of the container registry. + Identity *IdentityProperties `json:"identity,omitempty"` + // RegistryPropertiesUpdateParameters - The properties that the container registry will be updated with. + *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegistryUpdateParameters. +func (rup RegistryUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + if rup.Sku != nil { + objectMap["sku"] = rup.Sku + } + if rup.Identity != nil { + objectMap["identity"] = rup.Identity + } + if rup.RegistryPropertiesUpdateParameters != nil { + objectMap["properties"] = rup.RegistryPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RegistryUpdateParameters struct. +func (rup *RegistryUpdateParameters) 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 + } + rup.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + rup.Sku = &sku + } + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + rup.Identity = &identity + } + case "properties": + if v != nil { + var registryPropertiesUpdateParameters RegistryPropertiesUpdateParameters + err = json.Unmarshal(*v, ®istryPropertiesUpdateParameters) + if err != nil { + return err + } + rup.RegistryPropertiesUpdateParameters = ®istryPropertiesUpdateParameters + } + } + } + + return nil +} + +// RegistryUsage the quota usage for a container registry. +type RegistryUsage struct { + // Name - The name of the usage. + Name *string `json:"name,omitempty"` + // Limit - The limit of the usage. + Limit *int64 `json:"limit,omitempty"` + // CurrentValue - The current value of the usage. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Unit - The unit of measurement. Possible values include: 'Count', 'Bytes' + Unit RegistryUsageUnit `json:"unit,omitempty"` +} + +// RegistryUsageListResult the result of a request to get container registry quota usages. +type RegistryUsageListResult struct { + autorest.Response `json:"-"` + // Value - The list of container registry quota usages. + Value *[]RegistryUsage `json:"value,omitempty"` +} + +// Replication an object that represents a replication for a container registry. +type Replication struct { + autorest.Response `json:"-"` + // ReplicationProperties - The properties of the replication. + *ReplicationProperties `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"` +} + +// MarshalJSON is the custom marshaler for Replication. +func (r Replication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ReplicationProperties != nil { + objectMap["properties"] = r.ReplicationProperties + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Replication struct. +func (r *Replication) 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 replicationProperties ReplicationProperties + err = json.Unmarshal(*v, &replicationProperties) + if err != nil { + return err + } + r.ReplicationProperties = &replicationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + } + } + + return nil +} + +// ReplicationListResult the result of a request to list replications for a container registry. +type ReplicationListResult struct { + autorest.Response `json:"-"` + // Value - The list of replications. Since this list may be incomplete, the nextLink field should be used to request the next list of replications. + Value *[]Replication `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of replications. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationListResultIterator provides access to a complete listing of Replication values. +type ReplicationListResultIterator struct { + i int + page ReplicationListResultPage +} + +// 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 *ReplicationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationListResultIterator.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 *ReplicationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationListResultIterator) 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 ReplicationListResultIterator) Response() ReplicationListResult { + 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 ReplicationListResultIterator) Value() Replication { + if !iter.page.NotDone() { + return Replication{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationListResultIterator type. +func NewReplicationListResultIterator(page ReplicationListResultPage) ReplicationListResultIterator { + return ReplicationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr ReplicationListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// replicationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr ReplicationListResult) replicationListResultPreparer(ctx context.Context) (*http.Request, error) { + if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// ReplicationListResultPage contains a page of Replication values. +type ReplicationListResultPage struct { + fn func(context.Context, ReplicationListResult) (ReplicationListResult, error) + rlr ReplicationListResult +} + +// 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 *ReplicationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationListResultPage.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.rlr) + if err != nil { + return err + } + page.rlr = 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 *ReplicationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationListResultPage) Response() ReplicationListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationListResultPage) Values() []Replication { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// Creates a new instance of the ReplicationListResultPage type. +func NewReplicationListResultPage(getNextPage func(context.Context, ReplicationListResult) (ReplicationListResult, error)) ReplicationListResultPage { + return ReplicationListResultPage{fn: getNextPage} +} + +// ReplicationProperties the properties of a replication. +type ReplicationProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; The status of the replication at the time the operation was called. + Status *Status `json:"status,omitempty"` +} + +// ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ReplicationsCreateFuture) Result(client ReplicationsClient) (r Replication, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.CreateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ReplicationsDeleteFuture) Result(client ReplicationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ReplicationsUpdateFuture) Result(client ReplicationsClient) (r Replication, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.UpdateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationUpdateParameters the parameters for updating a replication. +type ReplicationUpdateParameters struct { + // Tags - The tags for the replication. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ReplicationUpdateParameters. +func (rup ReplicationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + return json.Marshal(objectMap) +} + +// Request the request that generated the event. +type Request struct { + // ID - The ID of the request that initiated the event. + ID *string `json:"id,omitempty"` + // Addr - The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + Addr *string `json:"addr,omitempty"` + // Host - The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + Host *string `json:"host,omitempty"` + // Method - The request method that generated the event. + Method *string `json:"method,omitempty"` + // Useragent - The user agent header of the request. + Useragent *string `json:"useragent,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"` +} + +// 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 + } + return json.Marshal(objectMap) +} + +// RetentionPolicy the retention policy for a container registry. +type RetentionPolicy struct { + // Days - The number of days to retain an untagged manifest after which it gets purged. + Days *int32 `json:"days,omitempty"` + // LastUpdatedTime - READ-ONLY; The timestamp when the policy was last updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' + Status PolicyStatus `json:"status,omitempty"` +} + +// Sku the SKU of a container registry. +type Sku struct { + // Name - The SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium' + Name SkuName `json:"name,omitempty"` + // Tier - READ-ONLY; The SKU tier based on the SKU name. Possible values include: 'SkuTierClassic', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium' + Tier SkuTier `json:"tier,omitempty"` +} + +// Source the registry node that generated the event. Put differently, while the actor initiates the event, +// the source generates it. +type Source struct { + // Addr - The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + Addr *string `json:"addr,omitempty"` + // InstanceID - The running instance of an application. Changes after each restart. + InstanceID *string `json:"instanceID,omitempty"` +} + +// Status the status of an Azure resource at the time the operation was called. +type Status struct { + // DisplayStatus - READ-ONLY; The short label for the status. + DisplayStatus *string `json:"displayStatus,omitempty"` + // Message - READ-ONLY; The detailed message for the status, including alerts and error messages. + Message *string `json:"message,omitempty"` + // Timestamp - READ-ONLY; The timestamp when the status was changed to the current value. + Timestamp *date.Time `json:"timestamp,omitempty"` +} + +// StorageAccountProperties the properties of a storage account for a container registry. Only applicable +// to Classic SKU. +type StorageAccountProperties struct { + // ID - The resource ID of the storage account. + ID *string `json:"id,omitempty"` +} + +// Target the target of the event. +type Target struct { + // MediaType - The MIME type of the referenced object. + MediaType *string `json:"mediaType,omitempty"` + // Size - The number of bytes of the content. Same as Length field. + Size *int64 `json:"size,omitempty"` + // Digest - The digest of the content, as defined by the Registry V2 HTTP API Specification. + Digest *string `json:"digest,omitempty"` + // Length - The number of bytes of the content. Same as Size field. + Length *int64 `json:"length,omitempty"` + // Repository - The repository name. + Repository *string `json:"repository,omitempty"` + // URL - The direct URL to the content. + URL *string `json:"url,omitempty"` + // Tag - The tag name. + Tag *string `json:"tag,omitempty"` + // Name - The name of the artifact. + Name *string `json:"name,omitempty"` + // Version - The version of the artifact. + Version *string `json:"version,omitempty"` +} + +// TrustPolicy the content trust policy for a container registry. +type TrustPolicy struct { + // Type - The type of trust policy. Possible values include: 'Notary' + Type TrustPolicyType `json:"type,omitempty"` + // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' + Status PolicyStatus `json:"status,omitempty"` +} + +// UserIdentityProperties ... +type UserIdentityProperties struct { + // PrincipalID - The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// VirtualNetworkRule virtual network rule. +type VirtualNetworkRule struct { + // Action - The action of virtual network rule. Possible values include: 'Allow' + Action Action `json:"action,omitempty"` + // VirtualNetworkResourceID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + VirtualNetworkResourceID *string `json:"id,omitempty"` +} + +// Webhook an object that represents a webhook for a container registry. +type Webhook struct { + autorest.Response `json:"-"` + // WebhookProperties - The properties of the webhook. + *WebhookProperties `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"` +} + +// MarshalJSON is the custom marshaler for Webhook. +func (w Webhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WebhookProperties != nil { + objectMap["properties"] = w.WebhookProperties + } + if w.Location != nil { + objectMap["location"] = w.Location + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Webhook struct. +func (w *Webhook) 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 webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } + 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 + } + } + } + + return nil +} + +// WebhookCreateParameters the parameters for creating a webhook. +type WebhookCreateParameters struct { + // Tags - The tags for the webhook. + Tags map[string]*string `json:"tags"` + // Location - The location of the webhook. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // WebhookPropertiesCreateParameters - The properties that the webhook will be created with. + *WebhookPropertiesCreateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookCreateParameters. +func (wcp WebhookCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcp.Tags != nil { + objectMap["tags"] = wcp.Tags + } + if wcp.Location != nil { + objectMap["location"] = wcp.Location + } + if wcp.WebhookPropertiesCreateParameters != nil { + objectMap["properties"] = wcp.WebhookPropertiesCreateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookCreateParameters struct. +func (wcp *WebhookCreateParameters) 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 + } + wcp.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wcp.Location = &location + } + case "properties": + if v != nil { + var webhookPropertiesCreateParameters WebhookPropertiesCreateParameters + err = json.Unmarshal(*v, &webhookPropertiesCreateParameters) + if err != nil { + return err + } + wcp.WebhookPropertiesCreateParameters = &webhookPropertiesCreateParameters + } + } + } + + return nil +} + +// WebhookListResult the result of a request to list webhooks for a container registry. +type WebhookListResult struct { + autorest.Response `json:"-"` + // Value - The list of webhooks. Since this list may be incomplete, the nextLink field should be used to request the next list of webhooks. + Value *[]Webhook `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of webhooks. + NextLink *string `json:"nextLink,omitempty"` +} + +// WebhookListResultIterator provides access to a complete listing of Webhook values. +type WebhookListResultIterator struct { + i int + page WebhookListResultPage +} + +// 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 *WebhookListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultIterator.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 *WebhookListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WebhookListResultIterator) 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 WebhookListResultIterator) Response() WebhookListResult { + 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 WebhookListResultIterator) Value() Webhook { + if !iter.page.NotDone() { + return Webhook{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WebhookListResultIterator type. +func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator { + return WebhookListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WebhookListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// webhookListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WebhookListResult) webhookListResultPreparer(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))) +} + +// WebhookListResultPage contains a page of Webhook values. +type WebhookListResultPage struct { + fn func(context.Context, WebhookListResult) (WebhookListResult, error) + wlr WebhookListResult +} + +// 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 *WebhookListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultPage.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 *WebhookListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WebhookListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WebhookListResultPage) Response() WebhookListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WebhookListResultPage) Values() []Webhook { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// Creates a new instance of the WebhookListResultPage type. +func NewWebhookListResultPage(getNextPage func(context.Context, WebhookListResult) (WebhookListResult, error)) WebhookListResultPage { + return WebhookListResultPage{fn: getNextPage} +} + +// WebhookProperties the properties of a webhook. +type WebhookProperties struct { + // Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled' + Status WebhookStatus `json:"status,omitempty"` + // Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + Scope *string `json:"scope,omitempty"` + // Actions - The list of actions that trigger the webhook to post notifications. + Actions *[]WebhookAction `json:"actions,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the webhook at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// WebhookPropertiesCreateParameters the parameters for creating the properties of a webhook. +type WebhookPropertiesCreateParameters struct { + // ServiceURI - The service URI for the webhook to post notifications. + ServiceURI *string `json:"serviceUri,omitempty"` + // CustomHeaders - Custom headers that will be added to the webhook notifications. + CustomHeaders map[string]*string `json:"customHeaders"` + // Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled' + Status WebhookStatus `json:"status,omitempty"` + // Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + Scope *string `json:"scope,omitempty"` + // Actions - The list of actions that trigger the webhook to post notifications. + Actions *[]WebhookAction `json:"actions,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookPropertiesCreateParameters. +func (wpcp WebhookPropertiesCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpcp.ServiceURI != nil { + objectMap["serviceUri"] = wpcp.ServiceURI + } + if wpcp.CustomHeaders != nil { + objectMap["customHeaders"] = wpcp.CustomHeaders + } + if wpcp.Status != "" { + objectMap["status"] = wpcp.Status + } + if wpcp.Scope != nil { + objectMap["scope"] = wpcp.Scope + } + if wpcp.Actions != nil { + objectMap["actions"] = wpcp.Actions + } + return json.Marshal(objectMap) +} + +// WebhookPropertiesUpdateParameters the parameters for updating the properties of a webhook. +type WebhookPropertiesUpdateParameters struct { + // ServiceURI - The service URI for the webhook to post notifications. + ServiceURI *string `json:"serviceUri,omitempty"` + // CustomHeaders - Custom headers that will be added to the webhook notifications. + CustomHeaders map[string]*string `json:"customHeaders"` + // Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled' + Status WebhookStatus `json:"status,omitempty"` + // Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + Scope *string `json:"scope,omitempty"` + // Actions - The list of actions that trigger the webhook to post notifications. + Actions *[]WebhookAction `json:"actions,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookPropertiesUpdateParameters. +func (wpup WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpup.ServiceURI != nil { + objectMap["serviceUri"] = wpup.ServiceURI + } + if wpup.CustomHeaders != nil { + objectMap["customHeaders"] = wpup.CustomHeaders + } + if wpup.Status != "" { + objectMap["status"] = wpup.Status + } + if wpup.Scope != nil { + objectMap["scope"] = wpup.Scope + } + if wpup.Actions != nil { + objectMap["actions"] = wpup.Actions + } + return json.Marshal(objectMap) +} + +// WebhooksCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WebhooksCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WebhooksCreateFuture) Result(client WebhooksClient) (w Webhook, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent { + w, err = client.CreateResponder(w.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", w.Response.Response, "Failure responding to request") + } + } + return +} + +// WebhooksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WebhooksDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WebhooksDeleteFuture) Result(client WebhooksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// WebhooksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WebhooksUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WebhooksUpdateFuture) Result(client WebhooksClient) (w Webhook, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent { + w, err = client.UpdateResponder(w.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", w.Response.Response, "Failure responding to request") + } + } + return +} + +// WebhookUpdateParameters the parameters for updating a webhook. +type WebhookUpdateParameters struct { + // Tags - The tags for the webhook. + Tags map[string]*string `json:"tags"` + // WebhookPropertiesUpdateParameters - The properties that the webhook will be updated with. + *WebhookPropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookUpdateParameters. +func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Tags != nil { + objectMap["tags"] = wup.Tags + } + if wup.WebhookPropertiesUpdateParameters != nil { + objectMap["properties"] = wup.WebhookPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct. +func (wup *WebhookUpdateParameters) 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 "properties": + if v != nil { + var webhookPropertiesUpdateParameters WebhookPropertiesUpdateParameters + err = json.Unmarshal(*v, &webhookPropertiesUpdateParameters) + if err != nil { + return err + } + wup.WebhookPropertiesUpdateParameters = &webhookPropertiesUpdateParameters + } + } + } + + return nil +} diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/operations.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/operations.go new file mode 100644 index 000000000000..880c431d602c --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/operations.go @@ -0,0 +1,147 @@ +package containerregistry + +// 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 client for the Operations methods of the Containerregistry service. +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 Container Registry 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, "containerregistry.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, "containerregistry.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.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-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ContainerRegistry/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, "containerregistry.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, "containerregistry.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.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/containerregistry/mgmt/2019-12-01-preview/containerregistry/registries.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/registries.go new file mode 100644 index 000000000000..d9ceb594e336 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/registries.go @@ -0,0 +1,1078 @@ +package containerregistry + +// 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" +) + +// RegistriesClient is the client for the Registries methods of the Containerregistry service. +type RegistriesClient struct { + BaseClient +} + +// NewRegistriesClient creates an instance of the RegistriesClient client. +func NewRegistriesClient(subscriptionID string) RegistriesClient { + return NewRegistriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRegistriesClientWithBaseURI creates an instance of the RegistriesClient client. +func NewRegistriesClientWithBaseURI(baseURI string, subscriptionID string) RegistriesClient { + return RegistriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks whether the container registry name is available for use. The name must contain only +// alphanumeric characters, be globally unique, and between 5 and 50 characters in length. +// Parameters: +// registryNameCheckRequest - the object containing information for the availability request. +func (client RegistriesClient) CheckNameAvailability(ctx context.Context, registryNameCheckRequest RegistryNameCheckRequest) (result RegistryNameStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.CheckNameAvailability") + 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: registryNameCheckRequest, + Constraints: []validation.Constraint{{Target: "registryNameCheckRequest.Name", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "registryNameCheckRequest.Name", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryNameCheckRequest.Name", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryNameCheckRequest.Name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}, + }}, + {Target: "registryNameCheckRequest.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, registryNameCheckRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client RegistriesClient) CheckNameAvailabilityPreparer(ctx context.Context, registryNameCheckRequest RegistryNameCheckRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + 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.ContainerRegistry/checkNameAvailability", pathParameters), + autorest.WithJSON(registryNameCheckRequest), + 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 RegistriesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client RegistriesClient) CheckNameAvailabilityResponder(resp *http.Response) (result RegistryNameStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create creates a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// registry - the parameters for creating a container registry. +func (client RegistriesClient) Create(ctx context.Context, resourceGroupName string, registryName string, registry Registry) (result RegistriesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: registry, + Constraints: []validation.Constraint{{Target: "registry.Sku", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "registry.RegistryProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, registry) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client RegistriesClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, registry Registry) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + 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.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithJSON(registry), + 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 RegistriesClient) CreateSender(req *http.Request) (future RegistriesCreateFuture, 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 +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client RegistriesClient) CreateResponder(resp *http.Response) (result Registry, 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 container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) Delete(ctx context.Context, resourceGroupName string, registryName string) (result RegistriesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RegistriesClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", 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 RegistriesClient) DeleteSender(req *http.Request) (future RegistriesDeleteFuture, 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 RegistriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) Get(ctx context.Context, resourceGroupName string, registryName string) (result Registry, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Get") + 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RegistriesClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", 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 RegistriesClient) 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 RegistriesClient) GetResponder(resp *http.Response) (result Registry, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ImportImage copies an image to this container registry from the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// parameters - the parameters specifying the image to copy and the source container registry. +func (client RegistriesClient) ImportImage(ctx context.Context, resourceGroupName string, registryName string, parameters ImportImageParameters) (result RegistriesImportImageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ImportImage") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Source.Credentials", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Source.Credentials.Password", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Source.SourceImage", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ImportImage", err.Error()) + } + + req, err := client.ImportImagePreparer(ctx, resourceGroupName, registryName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ImportImage", nil, "Failure preparing request") + return + } + + result, err = client.ImportImageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ImportImage", result.Response(), "Failure sending request") + return + } + + return +} + +// ImportImagePreparer prepares the ImportImage request. +func (client RegistriesClient) ImportImagePreparer(ctx context.Context, resourceGroupName string, registryName string, parameters ImportImageParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ImportImageSender sends the ImportImage request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ImportImageSender(req *http.Request) (future RegistriesImportImageFuture, 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 +} + +// ImportImageResponder handles the response to the ImportImage request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ImportImageResponder(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 +} + +// List lists all the container registries under the specified subscription. +func (client RegistriesClient) List(ctx context.Context) (result RegistryListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.List") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client RegistriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries", 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 RegistriesClient) 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 RegistriesClient) ListResponder(resp *http.Response) (result RegistryListResult, 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 RegistriesClient) listNextResults(ctx context.Context, lastResults RegistryListResult) (result RegistryListResult, err error) { + req, err := lastResults.registryListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "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, "containerregistry.RegistriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegistriesClient) ListComplete(ctx context.Context) (result RegistryListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.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 container registries under the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +func (client RegistriesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result RegistryListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client RegistriesClient) 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-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries", 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 RegistriesClient) 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 RegistriesClient) ListByResourceGroupResponder(resp *http.Response) (result RegistryListResult, 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 RegistriesClient) listByResourceGroupNextResults(ctx context.Context, lastResults RegistryListResult) (result RegistryListResult, err error) { + req, err := lastResults.registryListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "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, "containerregistry.RegistriesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegistriesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result RegistryListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.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 +} + +// ListCredentials lists the login credentials for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) ListCredentials(ctx context.Context, resourceGroupName string, registryName string) (result RegistryListCredentialsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListCredentials") + 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ListCredentials", err.Error()) + } + + req, err := client.ListCredentialsPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListCredentials", resp, "Failure responding to request") + } + + return +} + +// ListCredentialsPreparer prepares the ListCredentials request. +func (client RegistriesClient) ListCredentialsPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCredentialsSender sends the ListCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListCredentialsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListCredentialsResponder handles the response to the ListCredentials request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListCredentialsResponder(resp *http.Response) (result RegistryListCredentialsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages gets the quota usages for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) ListUsages(ctx context.Context, resourceGroupName string, registryName string) (result RegistryUsageListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListUsages") + 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure responding to request") + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client RegistriesClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListUsagesResponder(resp *http.Response) (result RegistryUsageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateCredential regenerates one of the login credentials for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// regenerateCredentialParameters - specifies name of the password which should be regenerated -- password or +// password2. +func (client RegistriesClient) RegenerateCredential(ctx context.Context, resourceGroupName string, registryName string, regenerateCredentialParameters RegenerateCredentialParameters) (result RegistryListCredentialsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.RegenerateCredential") + 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "RegenerateCredential", err.Error()) + } + + req, err := client.RegenerateCredentialPreparer(ctx, resourceGroupName, registryName, regenerateCredentialParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredential", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateCredentialSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredential", resp, "Failure sending request") + return + } + + result, err = client.RegenerateCredentialResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredential", resp, "Failure responding to request") + } + + return +} + +// RegenerateCredentialPreparer prepares the RegenerateCredential request. +func (client RegistriesClient) RegenerateCredentialPreparer(ctx context.Context, resourceGroupName string, registryName string, regenerateCredentialParameters RegenerateCredentialParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential", pathParameters), + autorest.WithJSON(regenerateCredentialParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateCredentialSender sends the RegenerateCredential request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) RegenerateCredentialSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// RegenerateCredentialResponder handles the response to the RegenerateCredential request. The method always +// closes the http.Response Body. +func (client RegistriesClient) RegenerateCredentialResponder(resp *http.Response) (result RegistryListCredentialsResult, 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 a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// registryUpdateParameters - the parameters for updating a container registry. +func (client RegistriesClient) Update(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (result RegistriesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, registryUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RegistriesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + 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.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithJSON(registryUpdateParameters), + 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 RegistriesClient) UpdateSender(req *http.Request) (future RegistriesUpdateFuture, 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 RegistriesClient) UpdateResponder(resp *http.Response) (result Registry, 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 +} diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/replications.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/replications.go new file mode 100644 index 000000000000..8dd4d2d46f95 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/replications.go @@ -0,0 +1,544 @@ +package containerregistry + +// 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" +) + +// ReplicationsClient is the client for the Replications methods of the Containerregistry service. +type ReplicationsClient struct { + BaseClient +} + +// NewReplicationsClient creates an instance of the ReplicationsClient client. +func NewReplicationsClient(subscriptionID string) ReplicationsClient { + return NewReplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewReplicationsClientWithBaseURI creates an instance of the ReplicationsClient client. +func NewReplicationsClientWithBaseURI(baseURI string, subscriptionID string) ReplicationsClient { + return ReplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a replication for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// replicationName - the name of the replication. +// replication - the parameters for creating a replication. +func (client ReplicationsClient) Create(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication) (result ReplicationsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, replicationName, replication) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + 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.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithJSON(replication), + 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 ReplicationsClient) CreateSender(req *http.Request) (future ReplicationsCreateFuture, 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 +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) CreateResponder(resp *http.Response) (result Replication, 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 replication from a container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// replicationName - the name of the replication. +func (client ReplicationsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result ReplicationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, replicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", 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 ReplicationsClient) DeleteSender(req *http.Request) (future ReplicationsDeleteFuture, 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 ReplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified replication. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// replicationName - the name of the replication. +func (client ReplicationsClient) Get(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result Replication, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Get") + 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, replicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", 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 ReplicationsClient) 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 ReplicationsClient) GetResponder(resp *http.Response) (result Replication, 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 replications for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client ReplicationsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result ReplicationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.List") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationsClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications", 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 ReplicationsClient) 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 ReplicationsClient) ListResponder(resp *http.Response) (result ReplicationListResult, 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 ReplicationsClient) listNextResults(ctx context.Context, lastResults ReplicationListResult) (result ReplicationListResult, err error) { + req, err := lastResults.replicationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "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, "containerregistry.ReplicationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result ReplicationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.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, registryName) + return +} + +// Update updates a replication for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// replicationName - the name of the replication. +// replicationUpdateParameters - the parameters for updating a replication. +func (client ReplicationsClient) Update(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters) (result ReplicationsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, replicationName, replicationUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + 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.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithJSON(replicationUpdateParameters), + 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 ReplicationsClient) UpdateSender(req *http.Request) (future ReplicationsUpdateFuture, 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 ReplicationsClient) UpdateResponder(resp *http.Response) (result Replication, 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 +} diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/version.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/version.go new file mode 100644 index 000000000000..b690f0e2f67c --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/version.go @@ -0,0 +1,30 @@ +package containerregistry + +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 + " containerregistry/2019-12-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/webhooks.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/webhooks.go new file mode 100644 index 000000000000..d6b726638740 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/webhooks.go @@ -0,0 +1,867 @@ +package containerregistry + +// 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" +) + +// WebhooksClient is the client for the Webhooks methods of the Containerregistry service. +type WebhooksClient struct { + BaseClient +} + +// NewWebhooksClient creates an instance of the WebhooksClient client. +func NewWebhooksClient(subscriptionID string) WebhooksClient { + return NewWebhooksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWebhooksClientWithBaseURI creates an instance of the WebhooksClient client. +func NewWebhooksClientWithBaseURI(baseURI string, subscriptionID string) WebhooksClient { + return WebhooksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a webhook for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +// webhookCreateParameters - the parameters for creating a webhook. +func (client WebhooksClient) Create(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters) (result WebhooksCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookCreateParameters, + Constraints: []validation.Constraint{{Target: "webhookCreateParameters.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "webhookCreateParameters.WebhookPropertiesCreateParameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "webhookCreateParameters.WebhookPropertiesCreateParameters.ServiceURI", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "webhookCreateParameters.WebhookPropertiesCreateParameters.Actions", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, webhookName, webhookCreateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client WebhooksClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2019-12-01-preview" + 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.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(webhookCreateParameters), + 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 WebhooksClient) CreateSender(req *http.Request) (future WebhooksCreateFuture, 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 +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client WebhooksClient) CreateResponder(resp *http.Response) (result Webhook, 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 webhook from a container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) Delete(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result WebhooksDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WebhooksClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", 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 WebhooksClient) DeleteSender(req *http.Request) (future WebhooksDeleteFuture, 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 WebhooksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified webhook. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) Get(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result Webhook, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Get") + 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WebhooksClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", 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 WebhooksClient) 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 WebhooksClient) GetResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCallbackConfig gets the configuration of service URI and custom headers for the webhook. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) GetCallbackConfig(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result CallbackConfig, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.GetCallbackConfig") + 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "GetCallbackConfig", err.Error()) + } + + req, err := client.GetCallbackConfigPreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", nil, "Failure preparing request") + return + } + + resp, err := client.GetCallbackConfigSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", resp, "Failure sending request") + return + } + + result, err = client.GetCallbackConfigResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", resp, "Failure responding to request") + } + + return +} + +// GetCallbackConfigPreparer prepares the GetCallbackConfig request. +func (client WebhooksClient) GetCallbackConfigPreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCallbackConfigSender sends the GetCallbackConfig request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) GetCallbackConfigSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetCallbackConfigResponder handles the response to the GetCallbackConfig request. The method always +// closes the http.Response Body. +func (client WebhooksClient) GetCallbackConfigResponder(resp *http.Response) (result CallbackConfig, 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 webhooks for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client WebhooksClient) List(ctx context.Context, resourceGroupName string, registryName string) (result WebhookListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.List") + defer func() { + sc := -1 + if result.wlr.Response.Response != nil { + sc = result.wlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WebhooksClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks", 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 WebhooksClient) 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 WebhooksClient) ListResponder(resp *http.Response) (result WebhookListResult, 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 WebhooksClient) listNextResults(ctx context.Context, lastResults WebhookListResult) (result WebhookListResult, err error) { + req, err := lastResults.webhookListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "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, "containerregistry.WebhooksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WebhooksClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result WebhookListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.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, registryName) + return +} + +// ListEvents lists recent events for the specified webhook. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) ListEvents(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result EventListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.ListEvents") + defer func() { + sc := -1 + if result.elr.Response.Response != nil { + sc = result.elr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "ListEvents", err.Error()) + } + + result.fn = client.listEventsNextResults + req, err := client.ListEventsPreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", nil, "Failure preparing request") + return + } + + resp, err := client.ListEventsSender(req) + if err != nil { + result.elr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure sending request") + return + } + + result.elr, err = client.ListEventsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure responding to request") + } + + return +} + +// ListEventsPreparer prepares the ListEvents request. +func (client WebhooksClient) ListEventsPreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListEventsSender sends the ListEvents request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) ListEventsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListEventsResponder handles the response to the ListEvents request. The method always +// closes the http.Response Body. +func (client WebhooksClient) ListEventsResponder(resp *http.Response) (result EventListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listEventsNextResults retrieves the next set of results, if any. +func (client WebhooksClient) listEventsNextResults(ctx context.Context, lastResults EventListResult) (result EventListResult, err error) { + req, err := lastResults.eventListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listEventsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListEventsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listEventsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListEventsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listEventsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListEventsComplete enumerates all values, automatically crossing page boundaries as required. +func (client WebhooksClient) ListEventsComplete(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result EventListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.ListEvents") + 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.ListEvents(ctx, resourceGroupName, registryName, webhookName) + return +} + +// Ping triggers a ping event to be sent to the webhook. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) Ping(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result EventInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Ping") + 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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Ping", err.Error()) + } + + req, err := client.PingPreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", nil, "Failure preparing request") + return + } + + resp, err := client.PingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", resp, "Failure sending request") + return + } + + result, err = client.PingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", resp, "Failure responding to request") + } + + return +} + +// PingPreparer prepares the Ping request. +func (client WebhooksClient) PingPreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2019-12-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PingSender sends the Ping request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) PingSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// PingResponder handles the response to the Ping request. The method always +// closes the http.Response Body. +func (client WebhooksClient) PingResponder(resp *http.Response) (result EventInfo, 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 a webhook with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +// webhookUpdateParameters - the parameters for updating a webhook. +func (client WebhooksClient) Update(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters) (result WebhooksUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, webhookName, webhookUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WebhooksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2019-12-01-preview" + 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.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(webhookUpdateParameters), + 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 WebhooksClient) UpdateSender(req *http.Request) (future WebhooksUpdateFuture, 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 WebhooksClient) UpdateResponder(resp *http.Response) (result Webhook, 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 +} diff --git a/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/customerlockboxapi/interfaces.go b/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/customerlockboxapi/interfaces.go index a4dd8fa71c6f..f7014864856b 100644 --- a/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/customerlockboxapi/interfaces.go +++ b/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/customerlockboxapi/interfaces.go @@ -24,16 +24,16 @@ import ( // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result customerlockbox.OperationListResultPage, err error) + List(ctx context.Context, APIVersion string) (result customerlockbox.OperationListResultPage, err error) } var _ OperationsClientAPI = (*customerlockbox.OperationsClient)(nil) // RequestsClientAPI contains the set of methods on the RequestsClient type. type RequestsClientAPI interface { - Get(ctx context.Context, requestID string, subscriptionID string) (result customerlockbox.LockboxRequestResponse, err error) + Get(ctx context.Context, requestID string, subscriptionID string, APIVersion string) (result customerlockbox.LockboxRequestResponse, err error) List(ctx context.Context, subscriptionID string, filter string) (result customerlockbox.RequestListResultPage, err error) - UpdateStatus(ctx context.Context, approval customerlockbox.Approval, subscriptionID string, requestID string) (result customerlockbox.Approval, err error) + UpdateStatus(ctx context.Context, approval customerlockbox.Approval, subscriptionID string, requestID string, APIVersion string) (result customerlockbox.Approval, err error) } var _ RequestsClientAPI = (*customerlockbox.RequestsClient)(nil) diff --git a/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/operations.go b/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/operations.go index 51cb8e1d723b..2e7b18a51aa9 100644 --- a/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/operations.go +++ b/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/operations.go @@ -41,7 +41,9 @@ func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { } // List lists all the available REST API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { +// Parameters: +// APIVersion - the API version to be used with the HTTP request. +func (client OperationsClient) List(ctx context.Context, APIVersion string) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -53,7 +55,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "customerlockbox.OperationsClient", "List", nil, "Failure preparing request") return @@ -75,8 +77,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-02-28-preview" +func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +132,7 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context, APIVersion string) (result OperationListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -142,6 +143,6 @@ func (client OperationsClient) ListComplete(ctx context.Context) (result Operati tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx) + result.page, err = client.List(ctx, APIVersion) return } diff --git a/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/requests.go b/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/requests.go index f4ceaa49a32e..4c572c25fbbb 100644 --- a/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/requests.go +++ b/services/preview/customerlockbox/mgmt/2018-02-28-preview/customerlockbox/requests.go @@ -45,7 +45,8 @@ func NewRequestsClientWithBaseURI(baseURI string) RequestsClient { // requestID - the Lockbox request ID. // subscriptionID - the Azure subscription ID. This is a GUID-formatted string (e.g. // 00000000-0000-0000-0000-000000000000) -func (client RequestsClient) Get(ctx context.Context, requestID string, subscriptionID string) (result LockboxRequestResponse, err error) { +// APIVersion - the API version to be used with the HTTP request. +func (client RequestsClient) Get(ctx context.Context, requestID string, subscriptionID string, APIVersion string) (result LockboxRequestResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RequestsClient.Get") defer func() { @@ -56,7 +57,7 @@ func (client RequestsClient) Get(ctx context.Context, requestID string, subscrip tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, requestID, subscriptionID) + req, err := client.GetPreparer(ctx, requestID, subscriptionID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "customerlockbox.RequestsClient", "Get", nil, "Failure preparing request") return @@ -78,13 +79,12 @@ func (client RequestsClient) Get(ctx context.Context, requestID string, subscrip } // GetPreparer prepares the Get request. -func (client RequestsClient) GetPreparer(ctx context.Context, requestID string, subscriptionID string) (*http.Request, error) { +func (client RequestsClient) GetPreparer(ctx context.Context, requestID string, subscriptionID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "requestId": autorest.Encode("path", requestID), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2018-02-28-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,8 @@ func (client RequestsClient) ListComplete(ctx context.Context, subscriptionID st // subscriptionID - the Azure subscription ID. This is a GUID-formatted string (e.g. // 00000000-0000-0000-0000-000000000000) // requestID - the Lockbox request ID. -func (client RequestsClient) UpdateStatus(ctx context.Context, approval Approval, subscriptionID string, requestID string) (result Approval, err error) { +// APIVersion - the API version to be used with the HTTP request. +func (client RequestsClient) UpdateStatus(ctx context.Context, approval Approval, subscriptionID string, requestID string, APIVersion string) (result Approval, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RequestsClient.UpdateStatus") defer func() { @@ -249,7 +250,7 @@ func (client RequestsClient) UpdateStatus(ctx context.Context, approval Approval tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdateStatusPreparer(ctx, approval, subscriptionID, requestID) + req, err := client.UpdateStatusPreparer(ctx, approval, subscriptionID, requestID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "customerlockbox.RequestsClient", "UpdateStatus", nil, "Failure preparing request") return @@ -271,13 +272,12 @@ func (client RequestsClient) UpdateStatus(ctx context.Context, approval Approval } // UpdateStatusPreparer prepares the UpdateStatus request. -func (client RequestsClient) UpdateStatusPreparer(ctx context.Context, approval Approval, subscriptionID string, requestID string) (*http.Request, error) { +func (client RequestsClient) UpdateStatusPreparer(ctx context.Context, approval Approval, subscriptionID string, requestID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "requestId": autorest.Encode("path", requestID), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2018-02-28-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go b/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go index d4cc4f5a350d..8b411e7d999f 100644 --- a/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go +++ b/services/preview/hdinsight/mgmt/2015-03-01-preview/hdinsight/models.go @@ -586,6 +586,14 @@ func (cr CapabilitiesResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ClientGroupInfo the information of AAD security group. +type ClientGroupInfo struct { + // GroupName - The AAD security group name. + GroupName *string `json:"groupName,omitempty"` + // GroupID - The AAD security group id. + GroupID *string `json:"groupId,omitempty"` +} + // Cluster the HDInsight cluster. type Cluster struct { autorest.Response `json:"-"` @@ -684,6 +692,8 @@ type ClusterCreateProperties struct { Tier Tier `json:"tier,omitempty"` // ClusterDefinition - The cluster definition. ClusterDefinition *ClusterDefinition `json:"clusterDefinition,omitempty"` + // KafkaRestProperties - The cluster kafka rest proxy configuration. + KafkaRestProperties *KafkaRestProperties `json:"kafkaRestProperties,omitempty"` // SecurityProfile - The security profile. SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` // ComputeProfile - The compute profile. @@ -744,6 +754,8 @@ type ClusterGetProperties struct { Tier Tier `json:"tier,omitempty"` // ClusterDefinition - The cluster definition. ClusterDefinition *ClusterDefinition `json:"clusterDefinition,omitempty"` + // KafkaRestProperties - The cluster kafka rest proxy configuration. + KafkaRestProperties *KafkaRestProperties `json:"kafkaRestProperties,omitempty"` // SecurityProfile - The security profile. SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` // ComputeProfile - The compute profile. @@ -1311,6 +1323,12 @@ type HardwareProfile struct { VMSize *string `json:"vmSize,omitempty"` } +// KafkaRestProperties the kafka rest proxy configuration which contains AAD security group information. +type KafkaRestProperties struct { + // ClientGroupInfo - The information of AAD security group. + ClientGroupInfo *ClientGroupInfo `json:"clientGroupInfo,omitempty"` +} + // LinuxOperatingSystemProfile the ssh username, password, and ssh public key. type LinuxOperatingSystemProfile struct { // Username - The username. diff --git a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go index ec244d5e7a5c..41ef4a815a5c 100644 --- a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go +++ b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go @@ -586,6 +586,14 @@ func (cr CapabilitiesResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ClientGroupInfo the information of AAD security group. +type ClientGroupInfo struct { + // GroupName - The AAD security group name. + GroupName *string `json:"groupName,omitempty"` + // GroupID - The AAD security group id. + GroupID *string `json:"groupId,omitempty"` +} + // Cluster the HDInsight cluster. type Cluster struct { autorest.Response `json:"-"` @@ -684,6 +692,8 @@ type ClusterCreateProperties struct { Tier Tier `json:"tier,omitempty"` // ClusterDefinition - The cluster definition. ClusterDefinition *ClusterDefinition `json:"clusterDefinition,omitempty"` + // KafkaRestProperties - The cluster kafka rest proxy configuration. + KafkaRestProperties *KafkaRestProperties `json:"kafkaRestProperties,omitempty"` // SecurityProfile - The security profile. SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` // ComputeProfile - The compute profile. @@ -744,6 +754,8 @@ type ClusterGetProperties struct { Tier Tier `json:"tier,omitempty"` // ClusterDefinition - The cluster definition. ClusterDefinition *ClusterDefinition `json:"clusterDefinition,omitempty"` + // KafkaRestProperties - The cluster kafka rest proxy configuration. + KafkaRestProperties *KafkaRestProperties `json:"kafkaRestProperties,omitempty"` // SecurityProfile - The security profile. SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` // ComputeProfile - The compute profile. @@ -1357,6 +1369,12 @@ type HardwareProfile struct { VMSize *string `json:"vmSize,omitempty"` } +// KafkaRestProperties the kafka rest proxy configuration which contains AAD security group information. +type KafkaRestProperties struct { + // ClientGroupInfo - The information of AAD security group. + ClientGroupInfo *ClientGroupInfo `json:"clientGroupInfo,omitempty"` +} + // LinuxOperatingSystemProfile the ssh username, password, and ssh public key. type LinuxOperatingSystemProfile struct { // Username - The username. @@ -2054,7 +2072,7 @@ type StorageAccount struct { IsDefault *bool `json:"isDefault,omitempty"` // Container - The container in the storage account, only to be specified for WASB storage accounts. Container *string `json:"container,omitempty"` - // FileSystem - The filesystem, only to be specified for Azure Data Lake Storage type Gen 2. + // FileSystem - The filesystem, only to be specified for Azure Data Lake Storage Gen 2. FileSystem *string `json:"fileSystem,omitempty"` // Key - The storage account access key. Key *string `json:"key,omitempty"` diff --git a/services/preview/managedservices/mgmt/2018-06-01/managedservices/managedservicesapi/interfaces.go b/services/preview/managedservices/mgmt/2018-06-01/managedservices/managedservicesapi/interfaces.go index 27f09e749583..9f6462dce463 100644 --- a/services/preview/managedservices/mgmt/2018-06-01/managedservices/managedservicesapi/interfaces.go +++ b/services/preview/managedservices/mgmt/2018-06-01/managedservices/managedservicesapi/interfaces.go @@ -25,27 +25,27 @@ import ( // RegistrationDefinitionsClientAPI contains the set of methods on the RegistrationDefinitionsClient type. type RegistrationDefinitionsClientAPI interface { - CreateOrUpdate(ctx context.Context, registrationDefinitionID string, scope string, requestBody managedservices.RegistrationDefinition) (result managedservices.RegistrationDefinition, err error) - Delete(ctx context.Context, registrationDefinitionID string, scope string) (result autorest.Response, err error) - Get(ctx context.Context, scope string, registrationDefinitionID string) (result managedservices.RegistrationDefinition, err error) - List(ctx context.Context, scope string) (result managedservices.RegistrationDefinitionListPage, err error) + CreateOrUpdate(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string, requestBody managedservices.RegistrationDefinition) (result managedservices.RegistrationDefinition, err error) + Delete(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string) (result autorest.Response, err error) + Get(ctx context.Context, scope string, registrationDefinitionID string, APIVersion string) (result managedservices.RegistrationDefinition, err error) + List(ctx context.Context, scope string, APIVersion string) (result managedservices.RegistrationDefinitionListPage, err error) } var _ RegistrationDefinitionsClientAPI = (*managedservices.RegistrationDefinitionsClient)(nil) // RegistrationAssignmentsClientAPI contains the set of methods on the RegistrationAssignmentsClient type. type RegistrationAssignmentsClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, registrationAssignmentID string, requestBody managedservices.RegistrationAssignment) (result managedservices.RegistrationAssignment, err error) - Delete(ctx context.Context, scope string, registrationAssignmentID string) (result autorest.Response, err error) - Get(ctx context.Context, scope string, registrationAssignmentID string, expandRegistrationDefinition *bool) (result managedservices.RegistrationAssignment, err error) - List(ctx context.Context, scope string, expandRegistrationDefinition *bool) (result managedservices.RegistrationAssignmentListPage, err error) + CreateOrUpdate(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, requestBody managedservices.RegistrationAssignment) (result managedservices.RegistrationAssignment, err error) + Delete(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string) (result autorest.Response, err error) + Get(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, expandRegistrationDefinition *bool) (result managedservices.RegistrationAssignment, err error) + List(ctx context.Context, scope string, APIVersion string, expandRegistrationDefinition *bool) (result managedservices.RegistrationAssignmentListPage, err error) } var _ RegistrationAssignmentsClientAPI = (*managedservices.RegistrationAssignmentsClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result managedservices.OperationList, err error) + List(ctx context.Context, APIVersion string) (result managedservices.OperationList, err error) } var _ OperationsClientAPI = (*managedservices.OperationsClient)(nil) diff --git a/services/preview/managedservices/mgmt/2018-06-01/managedservices/operations.go b/services/preview/managedservices/mgmt/2018-06-01/managedservices/operations.go index 8a37ec68dcd1..7cca637546d7 100644 --- a/services/preview/managedservices/mgmt/2018-06-01/managedservices/operations.go +++ b/services/preview/managedservices/mgmt/2018-06-01/managedservices/operations.go @@ -41,7 +41,9 @@ func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { } // List gets a list of the operations. -func (client OperationsClient) List(ctx context.Context) (result OperationList, err error) { +// Parameters: +// APIVersion - the API version to use for this operation. +func (client OperationsClient) List(ctx context.Context, APIVersion string) (result OperationList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -52,7 +54,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationList, tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.OperationsClient", "List", nil, "Failure preparing request") return @@ -74,8 +76,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationList, } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-06-01-preview" +func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/managedservices/mgmt/2018-06-01/managedservices/registrationassignments.go b/services/preview/managedservices/mgmt/2018-06-01/managedservices/registrationassignments.go index 0f34fd552a27..92c37f0157d4 100644 --- a/services/preview/managedservices/mgmt/2018-06-01/managedservices/registrationassignments.go +++ b/services/preview/managedservices/mgmt/2018-06-01/managedservices/registrationassignments.go @@ -45,8 +45,9 @@ func NewRegistrationAssignmentsClientWithBaseURI(baseURI string) RegistrationAss // Parameters: // scope - scope of the resource. // registrationAssignmentID - guid of the registration assignment. +// APIVersion - the API version to use for this operation. // requestBody - the parameters required to create new registration assignment. -func (client RegistrationAssignmentsClient) CreateOrUpdate(ctx context.Context, scope string, registrationAssignmentID string, requestBody RegistrationAssignment) (result RegistrationAssignment, err error) { +func (client RegistrationAssignmentsClient) CreateOrUpdate(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, requestBody RegistrationAssignment) (result RegistrationAssignment, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.CreateOrUpdate") defer func() { @@ -73,7 +74,7 @@ func (client RegistrationAssignmentsClient) CreateOrUpdate(ctx context.Context, return result, validation.NewError("managedservices.RegistrationAssignmentsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, scope, registrationAssignmentID, requestBody) + req, err := client.CreateOrUpdatePreparer(ctx, scope, registrationAssignmentID, APIVersion, requestBody) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationAssignmentsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -95,13 +96,12 @@ func (client RegistrationAssignmentsClient) CreateOrUpdate(ctx context.Context, } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RegistrationAssignmentsClient) CreateOrUpdatePreparer(ctx context.Context, scope string, registrationAssignmentID string, requestBody RegistrationAssignment) (*http.Request, error) { +func (client RegistrationAssignmentsClient) CreateOrUpdatePreparer(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, requestBody RegistrationAssignment) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationAssignmentId": autorest.Encode("path", registrationAssignmentID), "scope": scope, } - const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -143,7 +143,8 @@ func (client RegistrationAssignmentsClient) CreateOrUpdateResponder(resp *http.R // Parameters: // scope - scope of the resource. // registrationAssignmentID - guid of the registration assignment. -func (client RegistrationAssignmentsClient) Delete(ctx context.Context, scope string, registrationAssignmentID string) (result autorest.Response, err error) { +// APIVersion - the API version to use for this operation. +func (client RegistrationAssignmentsClient) Delete(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.Delete") defer func() { @@ -154,7 +155,7 @@ func (client RegistrationAssignmentsClient) Delete(ctx context.Context, scope st tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, scope, registrationAssignmentID) + req, err := client.DeletePreparer(ctx, scope, registrationAssignmentID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationAssignmentsClient", "Delete", nil, "Failure preparing request") return @@ -176,13 +177,12 @@ func (client RegistrationAssignmentsClient) Delete(ctx context.Context, scope st } // DeletePreparer prepares the Delete request. -func (client RegistrationAssignmentsClient) DeletePreparer(ctx context.Context, scope string, registrationAssignmentID string) (*http.Request, error) { +func (client RegistrationAssignmentsClient) DeletePreparer(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationAssignmentId": autorest.Encode("path", registrationAssignmentID), "scope": scope, } - const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -218,9 +218,10 @@ func (client RegistrationAssignmentsClient) DeleteResponder(resp *http.Response) // Parameters: // scope - scope of the resource. // registrationAssignmentID - guid of the registration assignment. +// APIVersion - the API version to use for this operation. // expandRegistrationDefinition - tells whether to return registration definition details also along with // registration assignment details. -func (client RegistrationAssignmentsClient) Get(ctx context.Context, scope string, registrationAssignmentID string, expandRegistrationDefinition *bool) (result RegistrationAssignment, err error) { +func (client RegistrationAssignmentsClient) Get(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, expandRegistrationDefinition *bool) (result RegistrationAssignment, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.Get") defer func() { @@ -231,7 +232,7 @@ func (client RegistrationAssignmentsClient) Get(ctx context.Context, scope strin tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, scope, registrationAssignmentID, expandRegistrationDefinition) + req, err := client.GetPreparer(ctx, scope, registrationAssignmentID, APIVersion, expandRegistrationDefinition) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationAssignmentsClient", "Get", nil, "Failure preparing request") return @@ -253,13 +254,12 @@ func (client RegistrationAssignmentsClient) Get(ctx context.Context, scope strin } // GetPreparer prepares the Get request. -func (client RegistrationAssignmentsClient) GetPreparer(ctx context.Context, scope string, registrationAssignmentID string, expandRegistrationDefinition *bool) (*http.Request, error) { +func (client RegistrationAssignmentsClient) GetPreparer(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, expandRegistrationDefinition *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationAssignmentId": autorest.Encode("path", registrationAssignmentID), "scope": scope, } - const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -298,9 +298,10 @@ func (client RegistrationAssignmentsClient) GetResponder(resp *http.Response) (r // List gets a list of the registration assignments. // Parameters: // scope - scope of the resource. +// APIVersion - the API version to use for this operation. // expandRegistrationDefinition - tells whether to return registration definition details also along with // registration assignment details. -func (client RegistrationAssignmentsClient) List(ctx context.Context, scope string, expandRegistrationDefinition *bool) (result RegistrationAssignmentListPage, err error) { +func (client RegistrationAssignmentsClient) List(ctx context.Context, scope string, APIVersion string, expandRegistrationDefinition *bool) (result RegistrationAssignmentListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.List") defer func() { @@ -312,7 +313,7 @@ func (client RegistrationAssignmentsClient) List(ctx context.Context, scope stri }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, scope, expandRegistrationDefinition) + req, err := client.ListPreparer(ctx, scope, APIVersion, expandRegistrationDefinition) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationAssignmentsClient", "List", nil, "Failure preparing request") return @@ -334,12 +335,11 @@ func (client RegistrationAssignmentsClient) List(ctx context.Context, scope stri } // ListPreparer prepares the List request. -func (client RegistrationAssignmentsClient) ListPreparer(ctx context.Context, scope string, expandRegistrationDefinition *bool) (*http.Request, error) { +func (client RegistrationAssignmentsClient) ListPreparer(ctx context.Context, scope string, APIVersion string, expandRegistrationDefinition *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "scope": scope, } - const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -397,7 +397,7 @@ func (client RegistrationAssignmentsClient) listNextResults(ctx context.Context, } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RegistrationAssignmentsClient) ListComplete(ctx context.Context, scope string, expandRegistrationDefinition *bool) (result RegistrationAssignmentListIterator, err error) { +func (client RegistrationAssignmentsClient) ListComplete(ctx context.Context, scope string, APIVersion string, expandRegistrationDefinition *bool) (result RegistrationAssignmentListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.List") defer func() { @@ -408,6 +408,6 @@ func (client RegistrationAssignmentsClient) ListComplete(ctx context.Context, sc tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, scope, expandRegistrationDefinition) + result.page, err = client.List(ctx, scope, APIVersion, expandRegistrationDefinition) return } diff --git a/services/preview/managedservices/mgmt/2018-06-01/managedservices/registrationdefinitions.go b/services/preview/managedservices/mgmt/2018-06-01/managedservices/registrationdefinitions.go index 3a3c9d4f0f6a..10252bac4d07 100644 --- a/services/preview/managedservices/mgmt/2018-06-01/managedservices/registrationdefinitions.go +++ b/services/preview/managedservices/mgmt/2018-06-01/managedservices/registrationdefinitions.go @@ -44,9 +44,10 @@ func NewRegistrationDefinitionsClientWithBaseURI(baseURI string) RegistrationDef // CreateOrUpdate creates or updates a registration definition. // Parameters: // registrationDefinitionID - guid of the registration definition. +// APIVersion - the API version to use for this operation. // scope - scope of the resource. // requestBody - the parameters required to create new registration definition. -func (client RegistrationDefinitionsClient) CreateOrUpdate(ctx context.Context, registrationDefinitionID string, scope string, requestBody RegistrationDefinition) (result RegistrationDefinition, err error) { +func (client RegistrationDefinitionsClient) CreateOrUpdate(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string, requestBody RegistrationDefinition) (result RegistrationDefinition, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.CreateOrUpdate") defer func() { @@ -72,7 +73,7 @@ func (client RegistrationDefinitionsClient) CreateOrUpdate(ctx context.Context, return result, validation.NewError("managedservices.RegistrationDefinitionsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, registrationDefinitionID, scope, requestBody) + req, err := client.CreateOrUpdatePreparer(ctx, registrationDefinitionID, APIVersion, scope, requestBody) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationDefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -94,13 +95,12 @@ func (client RegistrationDefinitionsClient) CreateOrUpdate(ctx context.Context, } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RegistrationDefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, registrationDefinitionID string, scope string, requestBody RegistrationDefinition) (*http.Request, error) { +func (client RegistrationDefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string, requestBody RegistrationDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationDefinitionId": autorest.Encode("path", registrationDefinitionID), "scope": scope, } - const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -141,8 +141,9 @@ func (client RegistrationDefinitionsClient) CreateOrUpdateResponder(resp *http.R // Delete deletes the registration definition. // Parameters: // registrationDefinitionID - guid of the registration definition. +// APIVersion - the API version to use for this operation. // scope - scope of the resource. -func (client RegistrationDefinitionsClient) Delete(ctx context.Context, registrationDefinitionID string, scope string) (result autorest.Response, err error) { +func (client RegistrationDefinitionsClient) Delete(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.Delete") defer func() { @@ -153,7 +154,7 @@ func (client RegistrationDefinitionsClient) Delete(ctx context.Context, registra tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, registrationDefinitionID, scope) + req, err := client.DeletePreparer(ctx, registrationDefinitionID, APIVersion, scope) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationDefinitionsClient", "Delete", nil, "Failure preparing request") return @@ -175,13 +176,12 @@ func (client RegistrationDefinitionsClient) Delete(ctx context.Context, registra } // DeletePreparer prepares the Delete request. -func (client RegistrationDefinitionsClient) DeletePreparer(ctx context.Context, registrationDefinitionID string, scope string) (*http.Request, error) { +func (client RegistrationDefinitionsClient) DeletePreparer(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationDefinitionId": autorest.Encode("path", registrationDefinitionID), "scope": scope, } - const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -217,7 +217,8 @@ func (client RegistrationDefinitionsClient) DeleteResponder(resp *http.Response) // Parameters: // scope - scope of the resource. // registrationDefinitionID - guid of the registration definition. -func (client RegistrationDefinitionsClient) Get(ctx context.Context, scope string, registrationDefinitionID string) (result RegistrationDefinition, err error) { +// APIVersion - the API version to use for this operation. +func (client RegistrationDefinitionsClient) Get(ctx context.Context, scope string, registrationDefinitionID string, APIVersion string) (result RegistrationDefinition, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.Get") defer func() { @@ -228,7 +229,7 @@ func (client RegistrationDefinitionsClient) Get(ctx context.Context, scope strin tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, scope, registrationDefinitionID) + req, err := client.GetPreparer(ctx, scope, registrationDefinitionID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationDefinitionsClient", "Get", nil, "Failure preparing request") return @@ -250,13 +251,12 @@ func (client RegistrationDefinitionsClient) Get(ctx context.Context, scope strin } // GetPreparer prepares the Get request. -func (client RegistrationDefinitionsClient) GetPreparer(ctx context.Context, scope string, registrationDefinitionID string) (*http.Request, error) { +func (client RegistrationDefinitionsClient) GetPreparer(ctx context.Context, scope string, registrationDefinitionID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationDefinitionId": autorest.Encode("path", registrationDefinitionID), "scope": scope, } - const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -292,7 +292,8 @@ func (client RegistrationDefinitionsClient) GetResponder(resp *http.Response) (r // List gets a list of the registration definitions. // Parameters: // scope - scope of the resource. -func (client RegistrationDefinitionsClient) List(ctx context.Context, scope string) (result RegistrationDefinitionListPage, err error) { +// APIVersion - the API version to use for this operation. +func (client RegistrationDefinitionsClient) List(ctx context.Context, scope string, APIVersion string) (result RegistrationDefinitionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.List") defer func() { @@ -304,7 +305,7 @@ func (client RegistrationDefinitionsClient) List(ctx context.Context, scope stri }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, scope) + req, err := client.ListPreparer(ctx, scope, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationDefinitionsClient", "List", nil, "Failure preparing request") return @@ -326,12 +327,11 @@ func (client RegistrationDefinitionsClient) List(ctx context.Context, scope stri } // ListPreparer prepares the List request. -func (client RegistrationDefinitionsClient) ListPreparer(ctx context.Context, scope string) (*http.Request, error) { +func (client RegistrationDefinitionsClient) ListPreparer(ctx context.Context, scope string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "scope": scope, } - const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -386,7 +386,7 @@ func (client RegistrationDefinitionsClient) listNextResults(ctx context.Context, } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RegistrationDefinitionsClient) ListComplete(ctx context.Context, scope string) (result RegistrationDefinitionListIterator, err error) { +func (client RegistrationDefinitionsClient) ListComplete(ctx context.Context, scope string, APIVersion string) (result RegistrationDefinitionListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.List") defer func() { @@ -397,6 +397,6 @@ func (client RegistrationDefinitionsClient) ListComplete(ctx context.Context, sc tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, scope) + result.page, err = client.List(ctx, scope, APIVersion) return } diff --git a/services/preview/managedservices/mgmt/2019-04-01/managedservices/managedservicesapi/interfaces.go b/services/preview/managedservices/mgmt/2019-04-01/managedservices/managedservicesapi/interfaces.go index f799a8dc3794..2a77368b980d 100644 --- a/services/preview/managedservices/mgmt/2019-04-01/managedservices/managedservicesapi/interfaces.go +++ b/services/preview/managedservices/mgmt/2019-04-01/managedservices/managedservicesapi/interfaces.go @@ -25,27 +25,27 @@ import ( // RegistrationDefinitionsClientAPI contains the set of methods on the RegistrationDefinitionsClient type. type RegistrationDefinitionsClientAPI interface { - CreateOrUpdate(ctx context.Context, registrationDefinitionID string, scope string, requestBody managedservices.RegistrationDefinition) (result managedservices.RegistrationDefinitionsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, registrationDefinitionID string, scope string) (result autorest.Response, err error) - Get(ctx context.Context, scope string, registrationDefinitionID string) (result managedservices.RegistrationDefinition, err error) - List(ctx context.Context, scope string) (result managedservices.RegistrationDefinitionListPage, err error) + CreateOrUpdate(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string, requestBody managedservices.RegistrationDefinition) (result managedservices.RegistrationDefinitionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string) (result autorest.Response, err error) + Get(ctx context.Context, scope string, registrationDefinitionID string, APIVersion string) (result managedservices.RegistrationDefinition, err error) + List(ctx context.Context, scope string, APIVersion string) (result managedservices.RegistrationDefinitionListPage, err error) } var _ RegistrationDefinitionsClientAPI = (*managedservices.RegistrationDefinitionsClient)(nil) // RegistrationAssignmentsClientAPI contains the set of methods on the RegistrationAssignmentsClient type. type RegistrationAssignmentsClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, registrationAssignmentID string, requestBody managedservices.RegistrationAssignment) (result managedservices.RegistrationAssignmentsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, scope string, registrationAssignmentID string) (result managedservices.RegistrationAssignmentsDeleteFuture, err error) - Get(ctx context.Context, scope string, registrationAssignmentID string, expandRegistrationDefinition *bool) (result managedservices.RegistrationAssignment, err error) - List(ctx context.Context, scope string, expandRegistrationDefinition *bool) (result managedservices.RegistrationAssignmentListPage, err error) + CreateOrUpdate(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, requestBody managedservices.RegistrationAssignment) (result managedservices.RegistrationAssignmentsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string) (result managedservices.RegistrationAssignmentsDeleteFuture, err error) + Get(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, expandRegistrationDefinition *bool) (result managedservices.RegistrationAssignment, err error) + List(ctx context.Context, scope string, APIVersion string, expandRegistrationDefinition *bool) (result managedservices.RegistrationAssignmentListPage, err error) } var _ RegistrationAssignmentsClientAPI = (*managedservices.RegistrationAssignmentsClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result managedservices.OperationList, err error) + List(ctx context.Context, APIVersion string) (result managedservices.OperationList, err error) } var _ OperationsClientAPI = (*managedservices.OperationsClient)(nil) diff --git a/services/preview/managedservices/mgmt/2019-04-01/managedservices/operations.go b/services/preview/managedservices/mgmt/2019-04-01/managedservices/operations.go index f29cbe44b53f..7cca637546d7 100644 --- a/services/preview/managedservices/mgmt/2019-04-01/managedservices/operations.go +++ b/services/preview/managedservices/mgmt/2019-04-01/managedservices/operations.go @@ -41,7 +41,9 @@ func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { } // List gets a list of the operations. -func (client OperationsClient) List(ctx context.Context) (result OperationList, err error) { +// Parameters: +// APIVersion - the API version to use for this operation. +func (client OperationsClient) List(ctx context.Context, APIVersion string) (result OperationList, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -52,7 +54,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationList, tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.OperationsClient", "List", nil, "Failure preparing request") return @@ -74,8 +76,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationList, } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-04-01-preview" +func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/managedservices/mgmt/2019-04-01/managedservices/registrationassignments.go b/services/preview/managedservices/mgmt/2019-04-01/managedservices/registrationassignments.go index 319d6726d47d..f34c5dae9365 100644 --- a/services/preview/managedservices/mgmt/2019-04-01/managedservices/registrationassignments.go +++ b/services/preview/managedservices/mgmt/2019-04-01/managedservices/registrationassignments.go @@ -45,8 +45,9 @@ func NewRegistrationAssignmentsClientWithBaseURI(baseURI string) RegistrationAss // Parameters: // scope - scope of the resource. // registrationAssignmentID - guid of the registration assignment. +// APIVersion - the API version to use for this operation. // requestBody - the parameters required to create new registration assignment. -func (client RegistrationAssignmentsClient) CreateOrUpdate(ctx context.Context, scope string, registrationAssignmentID string, requestBody RegistrationAssignment) (result RegistrationAssignmentsCreateOrUpdateFuture, err error) { +func (client RegistrationAssignmentsClient) CreateOrUpdate(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, requestBody RegistrationAssignment) (result RegistrationAssignmentsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.CreateOrUpdate") defer func() { @@ -73,7 +74,7 @@ func (client RegistrationAssignmentsClient) CreateOrUpdate(ctx context.Context, return result, validation.NewError("managedservices.RegistrationAssignmentsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, scope, registrationAssignmentID, requestBody) + req, err := client.CreateOrUpdatePreparer(ctx, scope, registrationAssignmentID, APIVersion, requestBody) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationAssignmentsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -89,13 +90,12 @@ func (client RegistrationAssignmentsClient) CreateOrUpdate(ctx context.Context, } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RegistrationAssignmentsClient) CreateOrUpdatePreparer(ctx context.Context, scope string, registrationAssignmentID string, requestBody RegistrationAssignment) (*http.Request, error) { +func (client RegistrationAssignmentsClient) CreateOrUpdatePreparer(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, requestBody RegistrationAssignment) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationAssignmentId": autorest.Encode("path", registrationAssignmentID), "scope": scope, } - const APIVersion = "2019-04-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -143,7 +143,8 @@ func (client RegistrationAssignmentsClient) CreateOrUpdateResponder(resp *http.R // Parameters: // scope - scope of the resource. // registrationAssignmentID - guid of the registration assignment. -func (client RegistrationAssignmentsClient) Delete(ctx context.Context, scope string, registrationAssignmentID string) (result RegistrationAssignmentsDeleteFuture, err error) { +// APIVersion - the API version to use for this operation. +func (client RegistrationAssignmentsClient) Delete(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string) (result RegistrationAssignmentsDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.Delete") defer func() { @@ -154,7 +155,7 @@ func (client RegistrationAssignmentsClient) Delete(ctx context.Context, scope st tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, scope, registrationAssignmentID) + req, err := client.DeletePreparer(ctx, scope, registrationAssignmentID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationAssignmentsClient", "Delete", nil, "Failure preparing request") return @@ -170,13 +171,12 @@ func (client RegistrationAssignmentsClient) Delete(ctx context.Context, scope st } // DeletePreparer prepares the Delete request. -func (client RegistrationAssignmentsClient) DeletePreparer(ctx context.Context, scope string, registrationAssignmentID string) (*http.Request, error) { +func (client RegistrationAssignmentsClient) DeletePreparer(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationAssignmentId": autorest.Encode("path", registrationAssignmentID), "scope": scope, } - const APIVersion = "2019-04-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -218,9 +218,10 @@ func (client RegistrationAssignmentsClient) DeleteResponder(resp *http.Response) // Parameters: // scope - scope of the resource. // registrationAssignmentID - guid of the registration assignment. +// APIVersion - the API version to use for this operation. // expandRegistrationDefinition - tells whether to return registration definition details also along with // registration assignment details. -func (client RegistrationAssignmentsClient) Get(ctx context.Context, scope string, registrationAssignmentID string, expandRegistrationDefinition *bool) (result RegistrationAssignment, err error) { +func (client RegistrationAssignmentsClient) Get(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, expandRegistrationDefinition *bool) (result RegistrationAssignment, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.Get") defer func() { @@ -231,7 +232,7 @@ func (client RegistrationAssignmentsClient) Get(ctx context.Context, scope strin tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, scope, registrationAssignmentID, expandRegistrationDefinition) + req, err := client.GetPreparer(ctx, scope, registrationAssignmentID, APIVersion, expandRegistrationDefinition) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationAssignmentsClient", "Get", nil, "Failure preparing request") return @@ -253,13 +254,12 @@ func (client RegistrationAssignmentsClient) Get(ctx context.Context, scope strin } // GetPreparer prepares the Get request. -func (client RegistrationAssignmentsClient) GetPreparer(ctx context.Context, scope string, registrationAssignmentID string, expandRegistrationDefinition *bool) (*http.Request, error) { +func (client RegistrationAssignmentsClient) GetPreparer(ctx context.Context, scope string, registrationAssignmentID string, APIVersion string, expandRegistrationDefinition *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationAssignmentId": autorest.Encode("path", registrationAssignmentID), "scope": scope, } - const APIVersion = "2019-04-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -298,9 +298,10 @@ func (client RegistrationAssignmentsClient) GetResponder(resp *http.Response) (r // List gets a list of the registration assignments. // Parameters: // scope - scope of the resource. +// APIVersion - the API version to use for this operation. // expandRegistrationDefinition - tells whether to return registration definition details also along with // registration assignment details. -func (client RegistrationAssignmentsClient) List(ctx context.Context, scope string, expandRegistrationDefinition *bool) (result RegistrationAssignmentListPage, err error) { +func (client RegistrationAssignmentsClient) List(ctx context.Context, scope string, APIVersion string, expandRegistrationDefinition *bool) (result RegistrationAssignmentListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.List") defer func() { @@ -312,7 +313,7 @@ func (client RegistrationAssignmentsClient) List(ctx context.Context, scope stri }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, scope, expandRegistrationDefinition) + req, err := client.ListPreparer(ctx, scope, APIVersion, expandRegistrationDefinition) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationAssignmentsClient", "List", nil, "Failure preparing request") return @@ -334,12 +335,11 @@ func (client RegistrationAssignmentsClient) List(ctx context.Context, scope stri } // ListPreparer prepares the List request. -func (client RegistrationAssignmentsClient) ListPreparer(ctx context.Context, scope string, expandRegistrationDefinition *bool) (*http.Request, error) { +func (client RegistrationAssignmentsClient) ListPreparer(ctx context.Context, scope string, APIVersion string, expandRegistrationDefinition *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "scope": scope, } - const APIVersion = "2019-04-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -397,7 +397,7 @@ func (client RegistrationAssignmentsClient) listNextResults(ctx context.Context, } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RegistrationAssignmentsClient) ListComplete(ctx context.Context, scope string, expandRegistrationDefinition *bool) (result RegistrationAssignmentListIterator, err error) { +func (client RegistrationAssignmentsClient) ListComplete(ctx context.Context, scope string, APIVersion string, expandRegistrationDefinition *bool) (result RegistrationAssignmentListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationAssignmentsClient.List") defer func() { @@ -408,6 +408,6 @@ func (client RegistrationAssignmentsClient) ListComplete(ctx context.Context, sc tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, scope, expandRegistrationDefinition) + result.page, err = client.List(ctx, scope, APIVersion, expandRegistrationDefinition) return } diff --git a/services/preview/managedservices/mgmt/2019-04-01/managedservices/registrationdefinitions.go b/services/preview/managedservices/mgmt/2019-04-01/managedservices/registrationdefinitions.go index 6681f92b2057..df19e0ee0bc3 100644 --- a/services/preview/managedservices/mgmt/2019-04-01/managedservices/registrationdefinitions.go +++ b/services/preview/managedservices/mgmt/2019-04-01/managedservices/registrationdefinitions.go @@ -44,9 +44,10 @@ func NewRegistrationDefinitionsClientWithBaseURI(baseURI string) RegistrationDef // CreateOrUpdate creates or updates a registration definition. // Parameters: // registrationDefinitionID - guid of the registration definition. +// APIVersion - the API version to use for this operation. // scope - scope of the resource. // requestBody - the parameters required to create new registration definition. -func (client RegistrationDefinitionsClient) CreateOrUpdate(ctx context.Context, registrationDefinitionID string, scope string, requestBody RegistrationDefinition) (result RegistrationDefinitionsCreateOrUpdateFuture, err error) { +func (client RegistrationDefinitionsClient) CreateOrUpdate(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string, requestBody RegistrationDefinition) (result RegistrationDefinitionsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.CreateOrUpdate") defer func() { @@ -72,7 +73,7 @@ func (client RegistrationDefinitionsClient) CreateOrUpdate(ctx context.Context, return result, validation.NewError("managedservices.RegistrationDefinitionsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, registrationDefinitionID, scope, requestBody) + req, err := client.CreateOrUpdatePreparer(ctx, registrationDefinitionID, APIVersion, scope, requestBody) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationDefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -88,13 +89,12 @@ func (client RegistrationDefinitionsClient) CreateOrUpdate(ctx context.Context, } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RegistrationDefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, registrationDefinitionID string, scope string, requestBody RegistrationDefinition) (*http.Request, error) { +func (client RegistrationDefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string, requestBody RegistrationDefinition) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationDefinitionId": autorest.Encode("path", registrationDefinitionID), "scope": scope, } - const APIVersion = "2019-04-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -141,8 +141,9 @@ func (client RegistrationDefinitionsClient) CreateOrUpdateResponder(resp *http.R // Delete deletes the registration definition. // Parameters: // registrationDefinitionID - guid of the registration definition. +// APIVersion - the API version to use for this operation. // scope - scope of the resource. -func (client RegistrationDefinitionsClient) Delete(ctx context.Context, registrationDefinitionID string, scope string) (result autorest.Response, err error) { +func (client RegistrationDefinitionsClient) Delete(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.Delete") defer func() { @@ -153,7 +154,7 @@ func (client RegistrationDefinitionsClient) Delete(ctx context.Context, registra tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, registrationDefinitionID, scope) + req, err := client.DeletePreparer(ctx, registrationDefinitionID, APIVersion, scope) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationDefinitionsClient", "Delete", nil, "Failure preparing request") return @@ -175,13 +176,12 @@ func (client RegistrationDefinitionsClient) Delete(ctx context.Context, registra } // DeletePreparer prepares the Delete request. -func (client RegistrationDefinitionsClient) DeletePreparer(ctx context.Context, registrationDefinitionID string, scope string) (*http.Request, error) { +func (client RegistrationDefinitionsClient) DeletePreparer(ctx context.Context, registrationDefinitionID string, APIVersion string, scope string) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationDefinitionId": autorest.Encode("path", registrationDefinitionID), "scope": scope, } - const APIVersion = "2019-04-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -217,7 +217,8 @@ func (client RegistrationDefinitionsClient) DeleteResponder(resp *http.Response) // Parameters: // scope - scope of the resource. // registrationDefinitionID - guid of the registration definition. -func (client RegistrationDefinitionsClient) Get(ctx context.Context, scope string, registrationDefinitionID string) (result RegistrationDefinition, err error) { +// APIVersion - the API version to use for this operation. +func (client RegistrationDefinitionsClient) Get(ctx context.Context, scope string, registrationDefinitionID string, APIVersion string) (result RegistrationDefinition, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.Get") defer func() { @@ -228,7 +229,7 @@ func (client RegistrationDefinitionsClient) Get(ctx context.Context, scope strin tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, scope, registrationDefinitionID) + req, err := client.GetPreparer(ctx, scope, registrationDefinitionID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationDefinitionsClient", "Get", nil, "Failure preparing request") return @@ -250,13 +251,12 @@ func (client RegistrationDefinitionsClient) Get(ctx context.Context, scope strin } // GetPreparer prepares the Get request. -func (client RegistrationDefinitionsClient) GetPreparer(ctx context.Context, scope string, registrationDefinitionID string) (*http.Request, error) { +func (client RegistrationDefinitionsClient) GetPreparer(ctx context.Context, scope string, registrationDefinitionID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "registrationDefinitionId": autorest.Encode("path", registrationDefinitionID), "scope": scope, } - const APIVersion = "2019-04-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -292,7 +292,8 @@ func (client RegistrationDefinitionsClient) GetResponder(resp *http.Response) (r // List gets a list of the registration definitions. // Parameters: // scope - scope of the resource. -func (client RegistrationDefinitionsClient) List(ctx context.Context, scope string) (result RegistrationDefinitionListPage, err error) { +// APIVersion - the API version to use for this operation. +func (client RegistrationDefinitionsClient) List(ctx context.Context, scope string, APIVersion string) (result RegistrationDefinitionListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.List") defer func() { @@ -304,7 +305,7 @@ func (client RegistrationDefinitionsClient) List(ctx context.Context, scope stri }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, scope) + req, err := client.ListPreparer(ctx, scope, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "managedservices.RegistrationDefinitionsClient", "List", nil, "Failure preparing request") return @@ -326,12 +327,11 @@ func (client RegistrationDefinitionsClient) List(ctx context.Context, scope stri } // ListPreparer prepares the List request. -func (client RegistrationDefinitionsClient) ListPreparer(ctx context.Context, scope string) (*http.Request, error) { +func (client RegistrationDefinitionsClient) ListPreparer(ctx context.Context, scope string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "scope": scope, } - const APIVersion = "2019-04-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -386,7 +386,7 @@ func (client RegistrationDefinitionsClient) listNextResults(ctx context.Context, } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RegistrationDefinitionsClient) ListComplete(ctx context.Context, scope string) (result RegistrationDefinitionListIterator, err error) { +func (client RegistrationDefinitionsClient) ListComplete(ctx context.Context, scope string, APIVersion string) (result RegistrationDefinitionListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RegistrationDefinitionsClient.List") defer func() { @@ -397,6 +397,6 @@ func (client RegistrationDefinitionsClient) ListComplete(ctx context.Context, sc tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, scope) + result.page, err = client.List(ctx, scope, APIVersion) return } diff --git a/services/preview/personalizer/v1.0/personalizer/client.go b/services/preview/personalizer/v1.0/personalizer/client.go index c0ea4db966cd..134972880370 100644 --- a/services/preview/personalizer/v1.0/personalizer/client.go +++ b/services/preview/personalizer/v1.0/personalizer/client.go @@ -2,8 +2,9 @@ // // Personalizer Service is an Azure Cognitive Service that makes it easy to target content and experiences without // complex pre-analysis or cleanup of past data. Given a context and featurized content, the Personalizer Service -// returns your content in a ranked list. As rewards are sent in response to the ranked list, the reinforcement -// learning algorithm will improve the model and improve performance of future rank calls. +// returns which content item to show to users in rewardActionId. As rewards are sent in response to the use of +// rewardActionId, the reinforcement learning algorithm will improve the model and improve performance of future rank +// calls. package personalizer // Copyright (c) Microsoft and contributors. All rights reserved. @@ -51,7 +52,8 @@ func NewWithoutDefaults(endpoint string) BaseClient { } } -// Rank sends the rank request. +// Rank submit a Personalizer rank request, to get which of the provided actions should be used in the provided +// context. // Parameters: // rankRequest - a Personalizer request. func (client BaseClient) Rank(ctx context.Context, rankRequest RankRequest) (result RankResponse, err error) { diff --git a/services/preview/personalizer/v1.0/personalizer/evaluations.go b/services/preview/personalizer/v1.0/personalizer/evaluations.go new file mode 100644 index 000000000000..0a5a8407ea24 --- /dev/null +++ b/services/preview/personalizer/v1.0/personalizer/evaluations.go @@ -0,0 +1,342 @@ +package personalizer + +// 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" +) + +// EvaluationsClient is the personalizer Service is an Azure Cognitive Service that makes it easy to target content and +// experiences without complex pre-analysis or cleanup of past data. Given a context and featurized content, the +// Personalizer Service returns which content item to show to users in rewardActionId. As rewards are sent in response +// to the use of rewardActionId, the reinforcement learning algorithm will improve the model and improve performance of +// future rank calls. +type EvaluationsClient struct { + BaseClient +} + +// NewEvaluationsClient creates an instance of the EvaluationsClient client. +func NewEvaluationsClient(endpoint string) EvaluationsClient { + return EvaluationsClient{New(endpoint)} +} + +// Create submit a new evaluation job. +// Parameters: +// evaluation - the evaluation job definition. +func (client EvaluationsClient) Create(ctx context.Context, evaluation EvaluationContract) (result Evaluation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EvaluationsClient.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: evaluation, + Constraints: []validation.Constraint{{Target: "evaluation.Name", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "evaluation.Name", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "evaluation.StartTime", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "evaluation.EndTime", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "evaluation.Policies", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("personalizer.EvaluationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, evaluation) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client EvaluationsClient) CreatePreparer(ctx context.Context, evaluation EvaluationContract) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/evaluations"), + autorest.WithJSON(evaluation)) + 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 EvaluationsClient) 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 EvaluationsClient) CreateResponder(resp *http.Response) (result Evaluation, 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 delete the evaluation associated with the Id. +// Parameters: +// evaluationID - id of the evaluation to delete. +func (client EvaluationsClient) Delete(ctx context.Context, evaluationID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EvaluationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: evaluationID, + Constraints: []validation.Constraint{{Target: "evaluationID", Name: validation.MaxLength, Rule: 256, Chain: nil}}}}); err != nil { + return result, validation.NewError("personalizer.EvaluationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, evaluationID) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client EvaluationsClient) DeletePreparer(ctx context.Context, evaluationID string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "evaluationId": autorest.Encode("path", evaluationID), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPathParameters("/evaluations/{evaluationId}", pathParameters)) + 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 EvaluationsClient) 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 EvaluationsClient) 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 get the evaluation associated with the Id. +// Parameters: +// evaluationID - id of the evaluation. +func (client EvaluationsClient) Get(ctx context.Context, evaluationID string) (result Evaluation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EvaluationsClient.Get") + 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: evaluationID, + Constraints: []validation.Constraint{{Target: "evaluationID", Name: validation.MaxLength, Rule: 256, Chain: nil}}}}); err != nil { + return result, validation.NewError("personalizer.EvaluationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, evaluationID) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client EvaluationsClient) GetPreparer(ctx context.Context, evaluationID string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "evaluationId": autorest.Encode("path", evaluationID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPathParameters("/evaluations/{evaluationId}", pathParameters)) + 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 EvaluationsClient) 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 EvaluationsClient) GetResponder(resp *http.Response) (result Evaluation, 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 list all the submitted evaluations. +func (client EvaluationsClient) List(ctx context.Context) (result ListEvaluation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EvaluationsClient.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, "personalizer.EvaluationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.EvaluationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client EvaluationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/evaluations")) + 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 EvaluationsClient) 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 EvaluationsClient) ListResponder(resp *http.Response) (result ListEvaluation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/personalizer/v1.0/personalizer/events.go b/services/preview/personalizer/v1.0/personalizer/events.go index c52910c984b9..5ee3a2cbb931 100644 --- a/services/preview/personalizer/v1.0/personalizer/events.go +++ b/services/preview/personalizer/v1.0/personalizer/events.go @@ -28,8 +28,9 @@ import ( // EventsClient is the personalizer Service is an Azure Cognitive Service that makes it easy to target content and // experiences without complex pre-analysis or cleanup of past data. Given a context and featurized content, the -// Personalizer Service returns your content in a ranked list. As rewards are sent in response to the ranked list, the -// reinforcement learning algorithm will improve the model and improve performance of future rank calls. +// Personalizer Service returns which content item to show to users in rewardActionId. As rewards are sent in response +// to the use of rewardActionId, the reinforcement learning algorithm will improve the model and improve performance of +// future rank calls. type EventsClient struct { BaseClient } @@ -39,7 +40,7 @@ func NewEventsClient(endpoint string) EventsClient { return EventsClient{New(endpoint)} } -// Activate sends the activate request. +// Activate report that the specified event was actually displayed to the user and a reward should be expected for it // Parameters: // eventID - the event ID this activation applies to. func (client EventsClient) Activate(ctx context.Context, eventID string) (result autorest.Response, err error) { @@ -116,10 +117,10 @@ func (client EventsClient) ActivateResponder(resp *http.Response) (result autore return } -// Reward sends the reward request. +// Reward report reward that resulted from using the action specified in rewardActionId for the specified event. // Parameters: // eventID - the event id this reward applies to. -// reward - the reward should be a floating point number. +// reward - the reward should be a floating point number, typically between 0 and 1. func (client EventsClient) Reward(ctx context.Context, eventID string, reward RewardRequest) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EventsClient.Reward") diff --git a/services/preview/personalizer/v1.0/personalizer/log.go b/services/preview/personalizer/v1.0/personalizer/log.go new file mode 100644 index 000000000000..e923436cd246 --- /dev/null +++ b/services/preview/personalizer/v1.0/personalizer/log.go @@ -0,0 +1,171 @@ +package personalizer + +// 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" +) + +// LogClient is the personalizer Service is an Azure Cognitive Service that makes it easy to target content and +// experiences without complex pre-analysis or cleanup of past data. Given a context and featurized content, the +// Personalizer Service returns which content item to show to users in rewardActionId. As rewards are sent in response +// to the use of rewardActionId, the reinforcement learning algorithm will improve the model and improve performance of +// future rank calls. +type LogClient struct { + BaseClient +} + +// NewLogClient creates an instance of the LogClient client. +func NewLogClient(endpoint string) LogClient { + return LogClient{New(endpoint)} +} + +// Delete delete all generated logs. +func (client LogClient) Delete(ctx context.Context) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.LogClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "personalizer.LogClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.LogClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LogClient) DeletePreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/logs")) + 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 LogClient) 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 LogClient) 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 +} + +// GetProperties get properties of generated logs. +func (client LogClient) GetProperties(ctx context.Context) (result LogsProperties, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogClient.GetProperties") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPropertiesPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.LogClient", "GetProperties", nil, "Failure preparing request") + return + } + + resp, err := client.GetPropertiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.LogClient", "GetProperties", resp, "Failure sending request") + return + } + + result, err = client.GetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.LogClient", "GetProperties", resp, "Failure responding to request") + } + + return +} + +// GetPropertiesPreparer prepares the GetProperties request. +func (client LogClient) GetPropertiesPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/logs/properties")) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPropertiesSender sends the GetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client LogClient) GetPropertiesSender(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...) +} + +// GetPropertiesResponder handles the response to the GetProperties request. The method always +// closes the http.Response Body. +func (client LogClient) GetPropertiesResponder(resp *http.Response) (result LogsProperties, 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/personalizer/v1.0/personalizer/model.go b/services/preview/personalizer/v1.0/personalizer/model.go new file mode 100644 index 000000000000..3be680570beb --- /dev/null +++ b/services/preview/personalizer/v1.0/personalizer/model.go @@ -0,0 +1,236 @@ +package personalizer + +// 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" +) + +// ModelClient is the personalizer Service is an Azure Cognitive Service that makes it easy to target content and +// experiences without complex pre-analysis or cleanup of past data. Given a context and featurized content, the +// Personalizer Service returns which content item to show to users in rewardActionId. As rewards are sent in response +// to the use of rewardActionId, the reinforcement learning algorithm will improve the model and improve performance of +// future rank calls. +type ModelClient struct { + BaseClient +} + +// NewModelClient creates an instance of the ModelClient client. +func NewModelClient(endpoint string) ModelClient { + return ModelClient{New(endpoint)} +} + +// Get get the model file generated by Personalizer service. +func (client ModelClient) Get(ctx context.Context) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ModelClient) GetPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/model")) + 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 ModelClient) 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 ModelClient) GetResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProperties get properties of the model file generated by Personalizer service. +func (client ModelClient) GetProperties(ctx context.Context) (result ModelProperties, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.GetProperties") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPropertiesPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "GetProperties", nil, "Failure preparing request") + return + } + + resp, err := client.GetPropertiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "GetProperties", resp, "Failure sending request") + return + } + + result, err = client.GetPropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "GetProperties", resp, "Failure responding to request") + } + + return +} + +// GetPropertiesPreparer prepares the GetProperties request. +func (client ModelClient) GetPropertiesPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/model/properties")) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPropertiesSender sends the GetProperties request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) GetPropertiesSender(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...) +} + +// GetPropertiesResponder handles the response to the GetProperties request. The method always +// closes the http.Response Body. +func (client ModelClient) GetPropertiesResponder(resp *http.Response) (result ModelProperties, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reset resets the model file generated by Personalizer service. +func (client ModelClient) Reset(ctx context.Context) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.Reset") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "Reset", nil, "Failure preparing request") + return + } + + resp, err := client.ResetSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "Reset", resp, "Failure sending request") + return + } + + result, err = client.ResetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ModelClient", "Reset", resp, "Failure responding to request") + } + + return +} + +// ResetPreparer prepares the Reset request. +func (client ModelClient) ResetPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/model")) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetSender sends the Reset request. The method will close the +// http.Response Body if it receives an error. +func (client ModelClient) ResetSender(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...) +} + +// ResetResponder handles the response to the Reset request. The method always +// closes the http.Response Body. +func (client ModelClient) ResetResponder(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/personalizer/v1.0/personalizer/models.go b/services/preview/personalizer/v1.0/personalizer/models.go index 68789c2dff6e..19fb040054ff 100644 --- a/services/preview/personalizer/v1.0/personalizer/models.go +++ b/services/preview/personalizer/v1.0/personalizer/models.go @@ -19,6 +19,8 @@ package personalizer import ( "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "io" ) // The package's fully qualified name. @@ -30,20 +32,84 @@ type ErrorCode string const ( // BadRequest Request could not be understood by the server. BadRequest ErrorCode = "BadRequest" + // EvaluationNotFound Evaluation not found. + EvaluationNotFound ErrorCode = "EvaluationNotFound" + // FrontEndNotFound Front end not found. + FrontEndNotFound ErrorCode = "FrontEndNotFound" // InternalServerError A generic error has occurred on the server. InternalServerError ErrorCode = "InternalServerError" + // InvalidContainer SAS Uri must be the Uri to a container that has write permissions. + InvalidContainer ErrorCode = "InvalidContainer" + // InvalidEvaluationContract Invalid evaluation contract. + InvalidEvaluationContract ErrorCode = "InvalidEvaluationContract" + // InvalidEventIDToActivate Invalid activate event request. + InvalidEventIDToActivate ErrorCode = "InvalidEventIdToActivate" + // InvalidExportLogsRequest Invalid export logs request. + InvalidExportLogsRequest ErrorCode = "InvalidExportLogsRequest" + // InvalidPolicyConfiguration Invalid policy configuration. + InvalidPolicyConfiguration ErrorCode = "InvalidPolicyConfiguration" + // InvalidPolicyContract Invalid policy contract. + InvalidPolicyContract ErrorCode = "InvalidPolicyContract" + // InvalidRankRequest Invalid rank request. + InvalidRankRequest ErrorCode = "InvalidRankRequest" + // InvalidRewardRequest Invalid reward request. + InvalidRewardRequest ErrorCode = "InvalidRewardRequest" + // InvalidServiceConfiguration Invalid service configuration. + InvalidServiceConfiguration ErrorCode = "InvalidServiceConfiguration" + // LogsPropertiesNotFound Logs properties not found. + LogsPropertiesNotFound ErrorCode = "LogsPropertiesNotFound" + // ModelResetFailed Model reset failed. + ModelResetFailed ErrorCode = "ModelResetFailed" + // RankNullResponse Rank call returned null response. + RankNullResponse ErrorCode = "RankNullResponse" // ResourceNotFound Requested resource does not exist on the server. ResourceNotFound ErrorCode = "ResourceNotFound" + // UpdateConfigurationFailed Failed to update configuration. + UpdateConfigurationFailed ErrorCode = "UpdateConfigurationFailed" ) // PossibleErrorCodeValues returns an array of possible values for the ErrorCode const type. func PossibleErrorCodeValues() []ErrorCode { - return []ErrorCode{BadRequest, InternalServerError, ResourceNotFound} + return []ErrorCode{BadRequest, EvaluationNotFound, FrontEndNotFound, InternalServerError, InvalidContainer, InvalidEvaluationContract, InvalidEventIDToActivate, InvalidExportLogsRequest, InvalidPolicyConfiguration, InvalidPolicyContract, InvalidRankRequest, InvalidRewardRequest, InvalidServiceConfiguration, LogsPropertiesNotFound, ModelResetFailed, RankNullResponse, ResourceNotFound, UpdateConfigurationFailed} +} + +// EvaluationJobStatus enumerates the values for evaluation job status. +type EvaluationJobStatus string + +const ( + // Completed ... + Completed EvaluationJobStatus = "completed" + // Failed ... + Failed EvaluationJobStatus = "failed" + // NotSubmitted ... + NotSubmitted EvaluationJobStatus = "notSubmitted" + // Pending ... + Pending EvaluationJobStatus = "pending" +) + +// PossibleEvaluationJobStatusValues returns an array of possible values for the EvaluationJobStatus const type. +func PossibleEvaluationJobStatusValues() []EvaluationJobStatus { + return []EvaluationJobStatus{Completed, Failed, NotSubmitted, Pending} +} + +// ContainerStatus ... +type ContainerStatus struct { + Service *string `json:"service,omitempty"` + APIStatus *string `json:"apiStatus,omitempty"` + APIStatusMessage *string `json:"apiStatusMessage,omitempty"` +} + +// DateRange ... +type DateRange struct { + // From - READ-ONLY + From *date.Time `json:"from,omitempty"` + // To - READ-ONLY + To *date.Time `json:"to,omitempty"` } // Error the error object. type Error struct { - // Code - High level error code. Possible values include: 'BadRequest', 'ResourceNotFound', 'InternalServerError' + // Code - High level error code. Possible values include: 'BadRequest', 'ResourceNotFound', 'InternalServerError', 'InvalidServiceConfiguration', 'InvalidPolicyConfiguration', 'InvalidPolicyContract', 'InvalidEvaluationContract', 'InvalidRewardRequest', 'InvalidEventIDToActivate', 'InvalidRankRequest', 'InvalidExportLogsRequest', 'InvalidContainer', 'FrontEndNotFound', 'EvaluationNotFound', 'LogsPropertiesNotFound', 'RankNullResponse', 'UpdateConfigurationFailed', 'ModelResetFailed' Code ErrorCode `json:"code,omitempty"` // Message - A message explaining the error reported by the service. Message *string `json:"message,omitempty"` @@ -61,6 +127,39 @@ type ErrorResponse struct { Error *Error `json:"error,omitempty"` } +// Evaluation ... +type Evaluation struct { + autorest.Response `json:"-"` + // ID - READ-ONLY + ID *string `json:"id,omitempty"` + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // StartTime - READ-ONLY + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY + EndTime *date.Time `json:"endTime,omitempty"` + // JobID - READ-ONLY + JobID *string `json:"jobId,omitempty"` + // Status - READ-ONLY; Possible values include: 'Completed', 'Pending', 'Failed', 'NotSubmitted' + Status EvaluationJobStatus `json:"status,omitempty"` + PolicyResults *[]PolicyResult `json:"policyResults,omitempty"` + FeatureImportance *[][]string `json:"featureImportance,omitempty"` +} + +// EvaluationContract a counterfactual evaluation. +type EvaluationContract struct { + // EnableOfflineExperimentation - True if the evaluation should explore for a more optimal Learning settings. + EnableOfflineExperimentation *bool `json:"enableOfflineExperimentation,omitempty"` + // Name - The name of the evaluation. + Name *string `json:"name,omitempty"` + // StartTime - The start time of the evaluation. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time of the evaluation. + EndTime *date.Time `json:"endTime,omitempty"` + // Policies - Additional Learning settings to evaluate. + Policies *[]PolicyContract `json:"policies,omitempty"` +} + // InternalError an object containing more specific information than the parent object about the error. type InternalError struct { // Code - Detailed error code. @@ -69,6 +168,95 @@ type InternalError struct { Innererror *InternalError `json:"innererror,omitempty"` } +// ListEvaluation ... +type ListEvaluation struct { + autorest.Response `json:"-"` + Value *[]Evaluation `json:"value,omitempty"` +} + +// LogsProperties ... +type LogsProperties struct { + autorest.Response `json:"-"` + // DateRange - READ-ONLY + DateRange *LogsPropertiesDateRange `json:"dateRange,omitempty"` +} + +// LogsPropertiesDateRange ... +type LogsPropertiesDateRange struct { + // From - READ-ONLY + From *date.Time `json:"from,omitempty"` + // To - READ-ONLY + To *date.Time `json:"to,omitempty"` +} + +// ModelProperties ... +type ModelProperties struct { + autorest.Response `json:"-"` + // CreationTime - READ-ONLY + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - READ-ONLY + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` +} + +// PolicyContract learning settings specifying how to train the model. +type PolicyContract struct { + autorest.Response `json:"-"` + // Name - Name of the Learning settings. + Name *string `json:"name,omitempty"` + // Arguments - Arguments of the Learning settings. + Arguments *string `json:"arguments,omitempty"` +} + +// PolicyResult ... +type PolicyResult struct { + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Arguments - READ-ONLY + Arguments *string `json:"arguments,omitempty"` + // Summary - READ-ONLY + Summary *[]PolicyResultSummary `json:"summary,omitempty"` + // TotalSummary - READ-ONLY + TotalSummary *PolicyResultTotalSummary `json:"totalSummary,omitempty"` +} + +// PolicyResultSummary ... +type PolicyResultSummary struct { + // TimeStamp - READ-ONLY + TimeStamp *date.Time `json:"timeStamp,omitempty"` + // IpsEstimatorNumerator - READ-ONLY + IpsEstimatorNumerator *float64 `json:"ipsEstimatorNumerator,omitempty"` + // IpsEstimatorDenominator - READ-ONLY + IpsEstimatorDenominator *float64 `json:"ipsEstimatorDenominator,omitempty"` + // SnipsEstimatorDenominator - READ-ONLY + SnipsEstimatorDenominator *float64 `json:"snipsEstimatorDenominator,omitempty"` + // AggregateTimeWindow - READ-ONLY + AggregateTimeWindow *string `json:"aggregateTimeWindow,omitempty"` + NonZeroProbability *float64 `json:"nonZeroProbability,omitempty"` + // ConfidenceInterval - READ-ONLY + ConfidenceInterval *float64 `json:"confidenceInterval,omitempty"` + // SumOfSquares - READ-ONLY + SumOfSquares *float64 `json:"sumOfSquares,omitempty"` +} + +// PolicyResultTotalSummary ... +type PolicyResultTotalSummary struct { + // TimeStamp - READ-ONLY + TimeStamp *date.Time `json:"timeStamp,omitempty"` + // IpsEstimatorNumerator - READ-ONLY + IpsEstimatorNumerator *float64 `json:"ipsEstimatorNumerator,omitempty"` + // IpsEstimatorDenominator - READ-ONLY + IpsEstimatorDenominator *float64 `json:"ipsEstimatorDenominator,omitempty"` + // SnipsEstimatorDenominator - READ-ONLY + SnipsEstimatorDenominator *float64 `json:"snipsEstimatorDenominator,omitempty"` + // AggregateTimeWindow - READ-ONLY + AggregateTimeWindow *string `json:"aggregateTimeWindow,omitempty"` + NonZeroProbability *float64 `json:"nonZeroProbability,omitempty"` + // ConfidenceInterval - READ-ONLY + ConfidenceInterval *float64 `json:"confidenceInterval,omitempty"` + // SumOfSquares - READ-ONLY + SumOfSquares *float64 `json:"sumOfSquares,omitempty"` +} + // RankableAction an action with it's associated features used for ranking. type RankableAction struct { // ID - Id of the action. @@ -90,12 +278,15 @@ type RankRequest struct { // ContextFeatures - Features of the context used for Personalizer as a // dictionary of dictionaries. This depends on the application, and // typically includes features about the current user, their - // device, profile information, data about time and date, etc. + // device, profile information, aggregated data about time and date, etc. + // Features should not include personally identifiable information (PII), + // unique UserIDs, or precise timestamps. ContextFeatures *[]interface{} `json:"contextFeatures,omitempty"` // Actions - The set of actions the Personalizer service can pick from. // The set should not contain more than 50 actions. // The order of the actions does not affect the rank result but the order // should match the sequence your application would have used to display them. + // The first item in the array will be used as Baseline item in Offline evaluations. Actions *[]RankableAction `json:"actions,omitempty"` // ExcludedActions - The set of action ids to exclude from ranking. ExcludedActions *[]string `json:"excludedActions,omitempty"` @@ -104,28 +295,60 @@ type RankRequest struct { // associating this request with its reward, as well as seeding the pseudo-random // generator when making a Personalizer call. EventID *string `json:"eventId,omitempty"` - // DeferActivation - Send false if the user will see the rank results, therefore + // DeferActivation - Send false if it is certain the rewardActionId in rank results will be shown to the user, therefore // Personalizer will expect a Reward call, otherwise it will assign the default // Reward to the event. Send true if it is possible the user will not see the - // rank results, because the page is rendering later, or the Rank results may be + // action specified in the rank results, because the page is rendering later, or the Rank results may be // overridden by code further downstream. DeferActivation *bool `json:"deferActivation,omitempty"` } -// RankResponse a resulting ordered list of actions that result from a rank request. +// RankResponse returns which action to use as rewardActionId, and additional information about each action +// as a result of a Rank request. type RankResponse struct { autorest.Response `json:"-"` // Ranking - READ-ONLY; The calculated ranking for the current request. Ranking *[]RankedAction `json:"ranking,omitempty"` // EventID - READ-ONLY; The eventId for the round trip from request to response. EventID *string `json:"eventId,omitempty"` - // RewardActionID - READ-ONLY; The action chosen by the Personalizer service. This is the action for which to report the reward. This might not be the + // RewardActionID - READ-ONLY; The action chosen by the Personalizer service. This is the action your application should display, and for which to report the reward. This might not be the // first found in 'ranking' if an action in the request in first position was part of the excluded ids. RewardActionID *string `json:"rewardActionId,omitempty"` } +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} + // RewardRequest reward given to a rank response. type RewardRequest struct { // Value - Reward to be assigned to an action. Value should be between -1 and 1 inclusive. Value *float64 `json:"value,omitempty"` } + +// ServiceConfiguration the configuration of the service. +type ServiceConfiguration struct { + autorest.Response `json:"-"` + // RewardWaitTime - The time span waited until a request is marked with the default reward. + // For example, PT5M (5 mins). For information about the time format, + // see http://en.wikipedia.org/wiki/ISO_8601#Durations + RewardWaitTime *string `json:"rewardWaitTime,omitempty"` + // DefaultReward - The reward given if a reward is not received within the specified wait time. + DefaultReward *float64 `json:"defaultReward,omitempty"` + // RewardAggregation - The function used to process rewards, if multiple reward scores are received before rewardWaitTime is over. + RewardAggregation *string `json:"rewardAggregation,omitempty"` + // ExplorationPercentage - The percentage of rank responses that will use exploration. + ExplorationPercentage *float64 `json:"explorationPercentage,omitempty"` + // ModelExportFrequency - Personalizer will start using the most updated trained model for online ranks automatically every specified time period. + // For example, PT5M (5 mins). For information about the time format, + // see http://en.wikipedia.org/wiki/ISO_8601#Durations + ModelExportFrequency *string `json:"modelExportFrequency,omitempty"` + // LogMirrorEnabled - Flag indicates whether log mirroring is enabled. + LogMirrorEnabled *bool `json:"logMirrorEnabled,omitempty"` + // LogMirrorSasURI - Azure storage account container SAS URI for log mirroring. + LogMirrorSasURI *string `json:"logMirrorSasUri,omitempty"` + // LogRetentionDays - Number of days historical logs are to be maintained. -1 implies the logs will never be deleted. + LogRetentionDays *int32 `json:"logRetentionDays,omitempty"` +} diff --git a/services/preview/personalizer/v1.0/personalizer/personalizerapi/interfaces.go b/services/preview/personalizer/v1.0/personalizer/personalizerapi/interfaces.go index a8e1396828da..bfe516203ef8 100644 --- a/services/preview/personalizer/v1.0/personalizer/personalizerapi/interfaces.go +++ b/services/preview/personalizer/v1.0/personalizer/personalizerapi/interfaces.go @@ -30,6 +30,33 @@ type BaseClientAPI interface { var _ BaseClientAPI = (*personalizer.BaseClient)(nil) +// ServiceConfigurationClientAPI contains the set of methods on the ServiceConfigurationClient type. +type ServiceConfigurationClientAPI interface { + Get(ctx context.Context) (result personalizer.ServiceConfiguration, err error) + Update(ctx context.Context, config personalizer.ServiceConfiguration) (result personalizer.ServiceConfiguration, err error) +} + +var _ ServiceConfigurationClientAPI = (*personalizer.ServiceConfigurationClient)(nil) + +// PolicyClientAPI contains the set of methods on the PolicyClient type. +type PolicyClientAPI interface { + Get(ctx context.Context) (result personalizer.PolicyContract, err error) + Reset(ctx context.Context) (result personalizer.PolicyContract, err error) + Update(ctx context.Context, policy personalizer.PolicyContract) (result personalizer.PolicyContract, err error) +} + +var _ PolicyClientAPI = (*personalizer.PolicyClient)(nil) + +// EvaluationsClientAPI contains the set of methods on the EvaluationsClient type. +type EvaluationsClientAPI interface { + Create(ctx context.Context, evaluation personalizer.EvaluationContract) (result personalizer.Evaluation, err error) + Delete(ctx context.Context, evaluationID string) (result autorest.Response, err error) + Get(ctx context.Context, evaluationID string) (result personalizer.Evaluation, err error) + List(ctx context.Context) (result personalizer.ListEvaluation, err error) +} + +var _ EvaluationsClientAPI = (*personalizer.EvaluationsClient)(nil) + // EventsClientAPI contains the set of methods on the EventsClient type. type EventsClientAPI interface { Activate(ctx context.Context, eventID string) (result autorest.Response, err error) @@ -37,3 +64,20 @@ type EventsClientAPI interface { } var _ EventsClientAPI = (*personalizer.EventsClient)(nil) + +// LogClientAPI contains the set of methods on the LogClient type. +type LogClientAPI interface { + Delete(ctx context.Context) (result autorest.Response, err error) + GetProperties(ctx context.Context) (result personalizer.LogsProperties, err error) +} + +var _ LogClientAPI = (*personalizer.LogClient)(nil) + +// ModelClientAPI contains the set of methods on the ModelClient type. +type ModelClientAPI interface { + Get(ctx context.Context) (result personalizer.ReadCloser, err error) + GetProperties(ctx context.Context) (result personalizer.ModelProperties, err error) + Reset(ctx context.Context) (result autorest.Response, err error) +} + +var _ ModelClientAPI = (*personalizer.ModelClient)(nil) diff --git a/services/preview/personalizer/v1.0/personalizer/policy.go b/services/preview/personalizer/v1.0/personalizer/policy.go new file mode 100644 index 000000000000..a6bb7e4665ed --- /dev/null +++ b/services/preview/personalizer/v1.0/personalizer/policy.go @@ -0,0 +1,252 @@ +package personalizer + +// 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" +) + +// PolicyClient is the personalizer Service is an Azure Cognitive Service that makes it easy to target content and +// experiences without complex pre-analysis or cleanup of past data. Given a context and featurized content, the +// Personalizer Service returns which content item to show to users in rewardActionId. As rewards are sent in response +// to the use of rewardActionId, the reinforcement learning algorithm will improve the model and improve performance of +// future rank calls. +type PolicyClient struct { + BaseClient +} + +// NewPolicyClient creates an instance of the PolicyClient client. +func NewPolicyClient(endpoint string) PolicyClient { + return PolicyClient{New(endpoint)} +} + +// Get get the Learning settings currently used by the Personalizer service. +func (client PolicyClient) Get(ctx context.Context) (result PolicyContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PolicyClient) GetPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/configurations/policy")) + 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 PolicyClient) 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 PolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Reset resets the Learning settings of the Personalizer service to default. +func (client PolicyClient) Reset(ctx context.Context) (result PolicyContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.Reset") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResetPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Reset", nil, "Failure preparing request") + return + } + + resp, err := client.ResetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Reset", resp, "Failure sending request") + return + } + + result, err = client.ResetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Reset", resp, "Failure responding to request") + } + + return +} + +// ResetPreparer prepares the Reset request. +func (client PolicyClient) ResetPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/configurations/policy")) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetSender sends the Reset request. The method will close the +// http.Response Body if it receives an error. +func (client PolicyClient) ResetSender(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...) +} + +// ResetResponder handles the response to the Reset request. The method always +// closes the http.Response Body. +func (client PolicyClient) ResetResponder(resp *http.Response) (result PolicyContract, 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 update the Learning settings that the Personalizer service will use to train models. +// Parameters: +// policy - the Learning settings. +func (client PolicyClient) Update(ctx context.Context, policy PolicyContract) (result PolicyContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.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: policy, + Constraints: []validation.Constraint{{Target: "policy.Name", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "policy.Name", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "policy.Arguments", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "policy.Arguments", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("personalizer.PolicyClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, policy) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.PolicyClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PolicyClient) UpdatePreparer(ctx context.Context, policy PolicyContract) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/configurations/policy"), + autorest.WithJSON(policy)) + 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 PolicyClient) 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 PolicyClient) UpdateResponder(resp *http.Response) (result PolicyContract, 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/personalizer/v1.0/personalizer/serviceconfiguration.go b/services/preview/personalizer/v1.0/personalizer/serviceconfiguration.go new file mode 100644 index 000000000000..e9e5c7161100 --- /dev/null +++ b/services/preview/personalizer/v1.0/personalizer/serviceconfiguration.go @@ -0,0 +1,198 @@ +package personalizer + +// 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" +) + +// ServiceConfigurationClient is the personalizer Service is an Azure Cognitive Service that makes it easy to target +// content and experiences without complex pre-analysis or cleanup of past data. Given a context and featurized +// content, the Personalizer Service returns which content item to show to users in rewardActionId. As rewards are sent +// in response to the use of rewardActionId, the reinforcement learning algorithm will improve the model and improve +// performance of future rank calls. +type ServiceConfigurationClient struct { + BaseClient +} + +// NewServiceConfigurationClient creates an instance of the ServiceConfigurationClient client. +func NewServiceConfigurationClient(endpoint string) ServiceConfigurationClient { + return ServiceConfigurationClient{New(endpoint)} +} + +// Get get the Personalizer service configuration. +func (client ServiceConfigurationClient) Get(ctx context.Context) (result ServiceConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceConfigurationClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ServiceConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.ServiceConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ServiceConfigurationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServiceConfigurationClient) GetPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/configurations/service")) + 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 ServiceConfigurationClient) 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 ServiceConfigurationClient) GetResponder(resp *http.Response) (result ServiceConfiguration, 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 update the Personalizer service configuration. +// Parameters: +// config - the personalizer service configuration. +func (client ServiceConfigurationClient) Update(ctx context.Context, config ServiceConfiguration) (result ServiceConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceConfigurationClient.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: config, + Constraints: []validation.Constraint{{Target: "config.RewardWaitTime", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "config.DefaultReward", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "config.DefaultReward", Name: validation.InclusiveMaximum, Rule: int64(1), Chain: nil}, + {Target: "config.DefaultReward", Name: validation.InclusiveMinimum, Rule: int64(-1), Chain: nil}, + }}, + {Target: "config.RewardAggregation", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "config.RewardAggregation", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "config.ExplorationPercentage", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "config.ExplorationPercentage", Name: validation.InclusiveMaximum, Rule: int64(1), Chain: nil}, + {Target: "config.ExplorationPercentage", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "config.ModelExportFrequency", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "config.LogRetentionDays", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "config.LogRetentionDays", Name: validation.InclusiveMaximum, Rule: int64(2147483647), Chain: nil}, + {Target: "config.LogRetentionDays", Name: validation.InclusiveMinimum, Rule: int64(-1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("personalizer.ServiceConfigurationClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, config) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ServiceConfigurationClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "personalizer.ServiceConfigurationClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "personalizer.ServiceConfigurationClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServiceConfigurationClient) UpdatePreparer(ctx context.Context, config ServiceConfiguration) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithCustomBaseURL("{Endpoint}/personalizer/v1.0", urlParameters), + autorest.WithPath("/configurations/service"), + autorest.WithJSON(config)) + 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 ServiceConfigurationClient) 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 ServiceConfigurationClient) UpdateResponder(resp *http.Response) (result ServiceConfiguration, 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/security/mgmt/v1.0/security/automations.go b/services/preview/security/mgmt/v1.0/security/automations.go new file mode 100644 index 000000000000..605cb35a072d --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/automations.go @@ -0,0 +1,643 @@ +package security + +// 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" +) + +// AutomationsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AutomationsClient struct { + BaseClient +} + +// NewAutomationsClient creates an instance of the AutomationsClient client. +func NewAutomationsClient(subscriptionID string, ascLocation string) AutomationsClient { + return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAutomationsClientWithBaseURI creates an instance of the AutomationsClient client. +func NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutomationsClient { + return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// CreateOrUpdate creates or updates a security automation. If a security automation is already created and a +// subsequent request is issued for the same automation id, then it will be updated. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +// automation - the security automation resource +func (client AutomationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (result Automation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationName, automation) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AutomationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + 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.Security/automations/{automationName}", pathParameters), + autorest.WithJSON(automation), + 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 AutomationsClient) 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 AutomationsClient) CreateOrUpdateResponder(resp *http.Response) (result Automation, 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 security automation. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +func (client AutomationsClient) Delete(ctx context.Context, resourceGroupName string, automationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AutomationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}", 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 AutomationsClient) 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 AutomationsClient) 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 retrieves information about the model of a security automation. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +func (client AutomationsClient) Get(ctx context.Context, resourceGroupName string, automationName string) (result Automation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Get") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AutomationsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}", 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 AutomationsClient) 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 AutomationsClient) GetResponder(resp *http.Response) (result Automation, 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 security automations in the specified subscription. Use the 'nextLink' property in the response +// to get the next page of security automations for the specified subscription. +func (client AutomationsClient) List(ctx context.Context) (result AutomationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.List") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", resp, "Failure sending request") + return + } + + result.al, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AutomationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations", 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 AutomationsClient) 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 AutomationsClient) ListResponder(resp *http.Response) (result AutomationList, 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 AutomationsClient) listNextResults(ctx context.Context, lastResults AutomationList) (result AutomationList, err error) { + req, err := lastResults.automationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AutomationsClient", "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, "security.AutomationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AutomationsClient) ListComplete(ctx context.Context) (result AutomationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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 security automations in the specified resource group. Use the 'nextLink' property +// in the response to get the next page of security automations for the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client AutomationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AutomationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.al, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AutomationsClient) 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-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations", 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 AutomationsClient) 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 AutomationsClient) ListByResourceGroupResponder(resp *http.Response) (result AutomationList, 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 AutomationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AutomationList) (result AutomationList, err error) { + req, err := lastResults.automationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AutomationsClient", "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, "security.AutomationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AutomationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AutomationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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 +} + +// Validate validates the security automation model before create or update. Any validation errors are returned to the +// client. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +// automation - the security automation resource +func (client AutomationsClient) Validate(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (result AutomationValidationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Validate") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Validate", err.Error()) + } + + req, err := client.ValidatePreparer(ctx, resourceGroupName, automationName, automation) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", resp, "Failure sending request") + return + } + + result, err = client.ValidateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", resp, "Failure responding to request") + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client AutomationsClient) ValidatePreparer(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate", pathParameters), + autorest.WithJSON(automation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateSender sends the Validate request. The method will close the +// http.Response Body if it receives an error. +func (client AutomationsClient) ValidateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client AutomationsClient) ValidateResponder(resp *http.Response) (result AutomationValidationStatus, 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/security/mgmt/v1.0/security/models.go b/services/preview/security/mgmt/v1.0/security/models.go index b7968b0584ce..49f752621d6a 100644 --- a/services/preview/security/mgmt/v1.0/security/models.go +++ b/services/preview/security/mgmt/v1.0/security/models.go @@ -66,6 +66,25 @@ func PossibleActionValues() []Action { return []Action{Add, Recommended, Remove} } +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // ActionTypeAutomationAction ... + ActionTypeAutomationAction ActionType = "AutomationAction" + // ActionTypeEventHub ... + ActionTypeEventHub ActionType = "EventHub" + // ActionTypeLogicApp ... + ActionTypeLogicApp ActionType = "LogicApp" + // ActionTypeWorkspace ... + ActionTypeWorkspace ActionType = "Workspace" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ActionTypeAutomationAction, ActionTypeEventHub, ActionTypeLogicApp, ActionTypeWorkspace} +} + // AlertNotifications enumerates the values for alert notifications. type AlertNotifications string @@ -257,6 +276,21 @@ func PossibleEnforcementMode1Values() []EnforcementMode1 { return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce, EnforcementMode1None} } +// EventSource enumerates the values for event source. +type EventSource string + +const ( + // Alerts ... + Alerts EventSource = "Alerts" + // Assessments ... + Assessments EventSource = "Assessments" +) + +// PossibleEventSourceValues returns an array of possible values for the EventSource const type. +func PossibleEventSourceValues() []EventSource { + return []EventSource{Alerts, Assessments} +} + // Exe enumerates the values for exe. type Exe string @@ -409,6 +443,35 @@ func PossibleMsiValues() []Msi { return []Msi{MsiAudit, MsiEnforce, MsiNone} } +// Operator enumerates the values for operator. +type Operator string + +const ( + // Contains ... + Contains Operator = "Contains" + // EndsWith ... + EndsWith Operator = "EndsWith" + // Equals ... + Equals Operator = "Equals" + // GreaterThan ... + GreaterThan Operator = "GreaterThan" + // GreaterThanOrEqualTo ... + GreaterThanOrEqualTo Operator = "GreaterThanOrEqualTo" + // LesserThan ... + LesserThan Operator = "LesserThan" + // LesserThanOrEqualTo ... + LesserThanOrEqualTo Operator = "LesserThanOrEqualTo" + // NotEquals ... + NotEquals Operator = "NotEquals" + // StartsWith ... + StartsWith Operator = "StartsWith" +) + +// PossibleOperatorValues returns an array of possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{Contains, EndsWith, Equals, GreaterThan, GreaterThanOrEqualTo, LesserThan, LesserThanOrEqualTo, NotEquals, StartsWith} +} + // PricingTier enumerates the values for pricing tier. type PricingTier string @@ -424,6 +487,25 @@ func PossiblePricingTierValues() []PricingTier { return []PricingTier{Free, Standard} } +// PropertyType enumerates the values for property type. +type PropertyType string + +const ( + // Boolean ... + Boolean PropertyType = "Boolean" + // Integer ... + Integer PropertyType = "Integer" + // Number ... + Number PropertyType = "Number" + // String ... + String PropertyType = "String" +) + +// PossiblePropertyTypeValues returns an array of possible values for the PropertyType const type. +func PossiblePropertyTypeValues() []PropertyType { + return []PropertyType{Boolean, Integer, Number, String} +} + // Protocol enumerates the values for protocol. type Protocol string @@ -711,15 +793,15 @@ func PossibleTypeValues() []Type { type ValueType string const ( - // IPCidr An IP range in CIDR format (e.g. '192.168.0.1/8'). - IPCidr ValueType = "IpCidr" - // String Any string value. - String ValueType = "String" + // ValueTypeIPCidr An IP range in CIDR format (e.g. '192.168.0.1/8'). + ValueTypeIPCidr ValueType = "IpCidr" + // ValueTypeString Any string value. + ValueTypeString ValueType = "String" ) // PossibleValueTypeValues returns an array of possible values for the ValueType const type. func PossibleValueTypeValues() []ValueType { - return []ValueType{IPCidr, String} + return []ValueType{ValueTypeIPCidr, ValueTypeString} } // AadConnectivityState1 describes an Azure resource with kind @@ -1809,7 +1891,7 @@ type AllowedConnectionsResourceProperties struct { type AllowlistCustomAlertRule struct { // AllowlistValues - The values to allow. The format of the values depends on the rule type. AllowlistValues *[]string `json:"allowlistValues,omitempty"` - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` @@ -2251,6 +2333,648 @@ func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { return nil } +// Automation the security automation resource. +type Automation struct { + autorest.Response `json:"-"` + // AutomationProperties - Security automation data + *AutomationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` + // Tags - A list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Automation. +func (a Automation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AutomationProperties != nil { + objectMap["properties"] = a.AutomationProperties + } + if a.Kind != nil { + objectMap["kind"] = a.Kind + } + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Automation struct. +func (a *Automation) 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 automationProperties AutomationProperties + err = json.Unmarshal(*v, &automationProperties) + if err != nil { + return err + } + a.AutomationProperties = &automationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + a.Kind = &kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + } + } + + return nil +} + +// BasicAutomationAction the action that should be triggered. +type BasicAutomationAction interface { + AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) + AsAutomationActionEventHub() (*AutomationActionEventHub, bool) + AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) + AsAutomationAction() (*AutomationAction, bool) +} + +// AutomationAction the action that should be triggered. +type AutomationAction struct { + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +func unmarshalBasicAutomationAction(body []byte) (BasicAutomationAction, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["actionType"] { + case string(ActionTypeLogicApp): + var aala AutomationActionLogicApp + err := json.Unmarshal(body, &aala) + return aala, err + case string(ActionTypeEventHub): + var aaeh AutomationActionEventHub + err := json.Unmarshal(body, &aaeh) + return aaeh, err + case string(ActionTypeWorkspace): + var aaw AutomationActionWorkspace + err := json.Unmarshal(body, &aaw) + return aaw, err + default: + var aa AutomationAction + err := json.Unmarshal(body, &aa) + return aa, err + } +} +func unmarshalBasicAutomationActionArray(body []byte) ([]BasicAutomationAction, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aaArray := make([]BasicAutomationAction, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aa, err := unmarshalBasicAutomationAction(*rawMessage) + if err != nil { + return nil, err + } + aaArray[index] = aa + } + return aaArray, nil +} + +// MarshalJSON is the custom marshaler for AutomationAction. +func (aa AutomationAction) MarshalJSON() ([]byte, error) { + aa.ActionType = ActionTypeAutomationAction + objectMap := make(map[string]interface{}) + if aa.ActionType != "" { + objectMap["actionType"] = aa.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationAction() (*AutomationAction, bool) { + return &aa, true +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aa, true +} + +// AutomationActionEventHub the target Event Hub to which event data will be exported. +type AutomationActionEventHub struct { + // EventHubResourceID - The target Event Hub Azure Resource ID. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // SasPolicyName - READ-ONLY; The target Event Hub SAS policy name. + SasPolicyName *string `json:"sasPolicyName,omitempty"` + // ConnectionString - The target Event Hub connection string (it will not be included in any response). + ConnectionString *string `json:"connectionString,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) MarshalJSON() ([]byte, error) { + aaeh.ActionType = ActionTypeEventHub + objectMap := make(map[string]interface{}) + if aaeh.EventHubResourceID != nil { + objectMap["eventHubResourceId"] = aaeh.EventHubResourceID + } + if aaeh.ConnectionString != nil { + objectMap["connectionString"] = aaeh.ConnectionString + } + if aaeh.ActionType != "" { + objectMap["actionType"] = aaeh.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return &aaeh, true +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaeh, true +} + +// AutomationActionLogicApp the logic app action that should be triggered. +type AutomationActionLogicApp struct { + // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App + LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` + // URI - The Logic App trigger URI endpoint (it will not be included in any response). + URI *string `json:"uri,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) MarshalJSON() ([]byte, error) { + aala.ActionType = ActionTypeLogicApp + objectMap := make(map[string]interface{}) + if aala.LogicAppResourceID != nil { + objectMap["logicAppResourceId"] = aala.LogicAppResourceID + } + if aala.URI != nil { + objectMap["uri"] = aala.URI + } + if aala.ActionType != "" { + objectMap["actionType"] = aala.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return &aala, true +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aala, true +} + +// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security +// alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the +// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order +// to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be +// enabled on that workspace. +type AutomationActionWorkspace struct { + // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. + WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) MarshalJSON() ([]byte, error) { + aaw.ActionType = ActionTypeWorkspace + objectMap := make(map[string]interface{}) + if aaw.WorkspaceResourceID != nil { + objectMap["workspaceResourceId"] = aaw.WorkspaceResourceID + } + if aaw.ActionType != "" { + objectMap["actionType"] = aaw.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return &aaw, true +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaw, true +} + +// AutomationList list of security automations response. +type AutomationList struct { + autorest.Response `json:"-"` + // Value - The list of security automations under the given scope. + Value *[]Automation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AutomationListIterator provides access to a complete listing of Automation values. +type AutomationListIterator struct { + i int + page AutomationListPage +} + +// 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 *AutomationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListIterator.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 *AutomationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AutomationListIterator) 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 AutomationListIterator) Response() AutomationList { + 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 AutomationListIterator) Value() Automation { + if !iter.page.NotDone() { + return Automation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AutomationListIterator type. +func NewAutomationListIterator(page AutomationListPage) AutomationListIterator { + return AutomationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AutomationList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// automationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AutomationList) automationListPreparer(ctx context.Context) (*http.Request, error) { + if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// AutomationListPage contains a page of Automation values. +type AutomationListPage struct { + fn func(context.Context, AutomationList) (AutomationList, error) + al AutomationList +} + +// 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 *AutomationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListPage.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.al) + if err != nil { + return err + } + page.al = 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 *AutomationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AutomationListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AutomationListPage) Response() AutomationList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AutomationListPage) Values() []Automation { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AutomationListPage type. +func NewAutomationListPage(getNextPage func(context.Context, AutomationList) (AutomationList, error)) AutomationListPage { + return AutomationListPage{fn: getNextPage} +} + +// AutomationProperties a set of properties that defines the behavior of the automation configuration. To +// learn more about the supported security events data models schemas - please visit +// https://aka.ms/ASCAutomationSchemas. +type AutomationProperties struct { + // Description - The security automation description. + Description *string `json:"description,omitempty"` + // IsEnabled - Indicates whether the security automation is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` + // Scopes - A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. + Scopes *[]AutomationScope `json:"scopes,omitempty"` + // Sources - A collection of the source event types which evaluate the security automation set of rules. + Sources *[]AutomationSource `json:"sources,omitempty"` + // Actions - A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. + Actions *[]BasicAutomationAction `json:"actions,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AutomationProperties struct. +func (ap *AutomationProperties) 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 "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ap.Description = &description + } + case "isEnabled": + if v != nil { + var isEnabled bool + err = json.Unmarshal(*v, &isEnabled) + if err != nil { + return err + } + ap.IsEnabled = &isEnabled + } + case "scopes": + if v != nil { + var scopes []AutomationScope + err = json.Unmarshal(*v, &scopes) + if err != nil { + return err + } + ap.Scopes = &scopes + } + case "sources": + if v != nil { + var sources []AutomationSource + err = json.Unmarshal(*v, &sources) + if err != nil { + return err + } + ap.Sources = &sources + } + case "actions": + if v != nil { + actions, err := unmarshalBasicAutomationActionArray(*v) + if err != nil { + return err + } + ap.Actions = &actions + } + } + } + + return nil +} + +// AutomationRuleSet a rule set which evaluates all its rules upon an event interception. Only when all the +// included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions. +type AutomationRuleSet struct { + Rules *[]AutomationTriggeringRule `json:"rules,omitempty"` +} + +// AutomationScope a single automation scope. +type AutomationScope struct { + // Description - The resources scope description. + Description *string `json:"description,omitempty"` + // ScopePath - The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs). + ScopePath *string `json:"scopePath,omitempty"` +} + +// AutomationSource the source event types which evaluate the security automation set of rules. For example +// - security alerts and security assessments. To learn more about the supported security events data +// models schemas - please visit https://aka.ms/ASCAutomationSchemas. +type AutomationSource struct { + // EventSource - A valid event source type. Possible values include: 'Assessments', 'Alerts' + EventSource EventSource `json:"eventSource,omitempty"` + // RuleSets - A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). + RuleSets *[]AutomationRuleSet `json:"ruleSets,omitempty"` +} + +// AutomationTriggeringRule a rule which is evaluated upon event interception. The rule is configured by +// comparing a specific value from the event model to an expected value. This comparison is done by using +// one of the supported operators set. +type AutomationTriggeringRule struct { + // PropertyJPath - The JPath of the entity model property that should be checked. + PropertyJPath *string `json:"propertyJPath,omitempty"` + // PropertyType - The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. Possible values include: 'String', 'Integer', 'Number', 'Boolean' + PropertyType PropertyType `json:"propertyType,omitempty"` + // ExpectedValue - The expected value. + ExpectedValue *string `json:"expectedValue,omitempty"` + // Operator - A valid comparer operator to use. Possible values include: 'Equals', 'GreaterThan', 'GreaterThanOrEqualTo', 'LesserThan', 'LesserThanOrEqualTo', 'NotEquals', 'Contains', 'StartsWith', 'EndsWith' + Operator Operator `json:"operator,omitempty"` +} + +// AutomationValidationStatus the security automation model state property bag. +type AutomationValidationStatus struct { + autorest.Response `json:"-"` + // IsValid - Indicates whether the model is valid or not. + IsValid *bool `json:"isValid,omitempty"` + // Message - The validation message. + Message *string `json:"message,omitempty"` +} + // AutoProvisioningSetting auto provisioning setting type AutoProvisioningSetting struct { autorest.Response `json:"-"` @@ -3452,7 +4176,7 @@ type DataExportSettingProperties struct { type DenylistCustomAlertRule struct { // DenylistValues - The values to deny. The format of the values depends on the rule type. DenylistValues *[]string `json:"denylistValues,omitempty"` - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` @@ -4952,7 +5676,7 @@ type Kind struct { // ListCustomAlertRule a List custom alert rule type ListCustomAlertRule struct { - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` diff --git a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go index f5068b92147a..9cb2574b8476 100644 --- a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go @@ -23,6 +23,18 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// AutomationsClientAPI contains the set of methods on the AutomationsClient type. +type AutomationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation security.Automation) (result security.Automation, err error) + Delete(ctx context.Context, resourceGroupName string, automationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationName string) (result security.Automation, err error) + List(ctx context.Context) (result security.AutomationListPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.AutomationListPage, err error) + Validate(ctx context.Context, resourceGroupName string, automationName string, automation security.Automation) (result security.AutomationValidationStatus, err error) +} + +var _ AutomationsClientAPI = (*security.AutomationsClient)(nil) + // SubAssessmentsClientAPI contains the set of methods on the SubAssessmentsClient type. type SubAssessmentsClientAPI interface { Get(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (result security.SubAssessment, err error) diff --git a/services/preview/security/mgmt/v2.0/security/automations.go b/services/preview/security/mgmt/v2.0/security/automations.go new file mode 100644 index 000000000000..605cb35a072d --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/automations.go @@ -0,0 +1,643 @@ +package security + +// 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" +) + +// AutomationsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AutomationsClient struct { + BaseClient +} + +// NewAutomationsClient creates an instance of the AutomationsClient client. +func NewAutomationsClient(subscriptionID string, ascLocation string) AutomationsClient { + return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAutomationsClientWithBaseURI creates an instance of the AutomationsClient client. +func NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutomationsClient { + return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// CreateOrUpdate creates or updates a security automation. If a security automation is already created and a +// subsequent request is issued for the same automation id, then it will be updated. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +// automation - the security automation resource +func (client AutomationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (result Automation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationName, automation) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AutomationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + 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.Security/automations/{automationName}", pathParameters), + autorest.WithJSON(automation), + 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 AutomationsClient) 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 AutomationsClient) CreateOrUpdateResponder(resp *http.Response) (result Automation, 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 security automation. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +func (client AutomationsClient) Delete(ctx context.Context, resourceGroupName string, automationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AutomationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}", 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 AutomationsClient) 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 AutomationsClient) 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 retrieves information about the model of a security automation. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +func (client AutomationsClient) Get(ctx context.Context, resourceGroupName string, automationName string) (result Automation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Get") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AutomationsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}", 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 AutomationsClient) 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 AutomationsClient) GetResponder(resp *http.Response) (result Automation, 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 security automations in the specified subscription. Use the 'nextLink' property in the response +// to get the next page of security automations for the specified subscription. +func (client AutomationsClient) List(ctx context.Context) (result AutomationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.List") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", resp, "Failure sending request") + return + } + + result.al, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AutomationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations", 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 AutomationsClient) 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 AutomationsClient) ListResponder(resp *http.Response) (result AutomationList, 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 AutomationsClient) listNextResults(ctx context.Context, lastResults AutomationList) (result AutomationList, err error) { + req, err := lastResults.automationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AutomationsClient", "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, "security.AutomationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AutomationsClient) ListComplete(ctx context.Context) (result AutomationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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 security automations in the specified resource group. Use the 'nextLink' property +// in the response to get the next page of security automations for the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client AutomationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AutomationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.al, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AutomationsClient) 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-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations", 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 AutomationsClient) 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 AutomationsClient) ListByResourceGroupResponder(resp *http.Response) (result AutomationList, 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 AutomationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AutomationList) (result AutomationList, err error) { + req, err := lastResults.automationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AutomationsClient", "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, "security.AutomationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AutomationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AutomationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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 +} + +// Validate validates the security automation model before create or update. Any validation errors are returned to the +// client. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +// automation - the security automation resource +func (client AutomationsClient) Validate(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (result AutomationValidationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Validate") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Validate", err.Error()) + } + + req, err := client.ValidatePreparer(ctx, resourceGroupName, automationName, automation) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", resp, "Failure sending request") + return + } + + result, err = client.ValidateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", resp, "Failure responding to request") + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client AutomationsClient) ValidatePreparer(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate", pathParameters), + autorest.WithJSON(automation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateSender sends the Validate request. The method will close the +// http.Response Body if it receives an error. +func (client AutomationsClient) ValidateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client AutomationsClient) ValidateResponder(resp *http.Response) (result AutomationValidationStatus, 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/security/mgmt/v2.0/security/models.go b/services/preview/security/mgmt/v2.0/security/models.go index a2cbf07902a2..a0ddbe702991 100644 --- a/services/preview/security/mgmt/v2.0/security/models.go +++ b/services/preview/security/mgmt/v2.0/security/models.go @@ -66,6 +66,25 @@ func PossibleActionValues() []Action { return []Action{Add, Recommended, Remove} } +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // ActionTypeAutomationAction ... + ActionTypeAutomationAction ActionType = "AutomationAction" + // ActionTypeEventHub ... + ActionTypeEventHub ActionType = "EventHub" + // ActionTypeLogicApp ... + ActionTypeLogicApp ActionType = "LogicApp" + // ActionTypeWorkspace ... + ActionTypeWorkspace ActionType = "Workspace" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ActionTypeAutomationAction, ActionTypeEventHub, ActionTypeLogicApp, ActionTypeWorkspace} +} + // AlertNotifications enumerates the values for alert notifications. type AlertNotifications string @@ -270,6 +289,21 @@ func PossibleEnforcementMode1Values() []EnforcementMode1 { return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce, EnforcementMode1None} } +// EventSource enumerates the values for event source. +type EventSource string + +const ( + // Alerts ... + Alerts EventSource = "Alerts" + // Assessments ... + Assessments EventSource = "Assessments" +) + +// PossibleEventSourceValues returns an array of possible values for the EventSource const type. +func PossibleEventSourceValues() []EventSource { + return []EventSource{Alerts, Assessments} +} + // Exe enumerates the values for exe. type Exe string @@ -435,6 +469,35 @@ func PossibleMsiValues() []Msi { return []Msi{MsiAudit, MsiEnforce, MsiNone} } +// Operator enumerates the values for operator. +type Operator string + +const ( + // Contains ... + Contains Operator = "Contains" + // EndsWith ... + EndsWith Operator = "EndsWith" + // Equals ... + Equals Operator = "Equals" + // GreaterThan ... + GreaterThan Operator = "GreaterThan" + // GreaterThanOrEqualTo ... + GreaterThanOrEqualTo Operator = "GreaterThanOrEqualTo" + // LesserThan ... + LesserThan Operator = "LesserThan" + // LesserThanOrEqualTo ... + LesserThanOrEqualTo Operator = "LesserThanOrEqualTo" + // NotEquals ... + NotEquals Operator = "NotEquals" + // StartsWith ... + StartsWith Operator = "StartsWith" +) + +// PossibleOperatorValues returns an array of possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{Contains, EndsWith, Equals, GreaterThan, GreaterThanOrEqualTo, LesserThan, LesserThanOrEqualTo, NotEquals, StartsWith} +} + // PricingTier enumerates the values for pricing tier. type PricingTier string @@ -450,6 +513,25 @@ func PossiblePricingTierValues() []PricingTier { return []PricingTier{Free, Standard} } +// PropertyType enumerates the values for property type. +type PropertyType string + +const ( + // Boolean ... + Boolean PropertyType = "Boolean" + // Integer ... + Integer PropertyType = "Integer" + // Number ... + Number PropertyType = "Number" + // String ... + String PropertyType = "String" +) + +// PossiblePropertyTypeValues returns an array of possible values for the PropertyType const type. +func PossiblePropertyTypeValues() []PropertyType { + return []PropertyType{Boolean, Integer, Number, String} +} + // Protocol enumerates the values for protocol. type Protocol string @@ -822,15 +904,15 @@ func PossibleTypeValues() []Type { type ValueType string const ( - // IPCidr An IP range in CIDR format (e.g. '192.168.0.1/8'). - IPCidr ValueType = "IpCidr" - // String Any string value. - String ValueType = "String" + // ValueTypeIPCidr An IP range in CIDR format (e.g. '192.168.0.1/8'). + ValueTypeIPCidr ValueType = "IpCidr" + // ValueTypeString Any string value. + ValueTypeString ValueType = "String" ) // PossibleValueTypeValues returns an array of possible values for the ValueType const type. func PossibleValueTypeValues() []ValueType { - return []ValueType{IPCidr, String} + return []ValueType{ValueTypeIPCidr, ValueTypeString} } // AadConnectivityState1 describes an Azure resource with kind @@ -1920,7 +2002,7 @@ type AllowedConnectionsResourceProperties struct { type AllowlistCustomAlertRule struct { // AllowlistValues - The values to allow. The format of the values depends on the rule type. AllowlistValues *[]string `json:"allowlistValues,omitempty"` - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` @@ -2362,6 +2444,648 @@ func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { return nil } +// Automation the security automation resource. +type Automation struct { + autorest.Response `json:"-"` + // AutomationProperties - Security automation data + *AutomationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` + // Tags - A list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Automation. +func (a Automation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AutomationProperties != nil { + objectMap["properties"] = a.AutomationProperties + } + if a.Kind != nil { + objectMap["kind"] = a.Kind + } + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Automation struct. +func (a *Automation) 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 automationProperties AutomationProperties + err = json.Unmarshal(*v, &automationProperties) + if err != nil { + return err + } + a.AutomationProperties = &automationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + a.Kind = &kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + } + } + + return nil +} + +// BasicAutomationAction the action that should be triggered. +type BasicAutomationAction interface { + AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) + AsAutomationActionEventHub() (*AutomationActionEventHub, bool) + AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) + AsAutomationAction() (*AutomationAction, bool) +} + +// AutomationAction the action that should be triggered. +type AutomationAction struct { + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +func unmarshalBasicAutomationAction(body []byte) (BasicAutomationAction, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["actionType"] { + case string(ActionTypeLogicApp): + var aala AutomationActionLogicApp + err := json.Unmarshal(body, &aala) + return aala, err + case string(ActionTypeEventHub): + var aaeh AutomationActionEventHub + err := json.Unmarshal(body, &aaeh) + return aaeh, err + case string(ActionTypeWorkspace): + var aaw AutomationActionWorkspace + err := json.Unmarshal(body, &aaw) + return aaw, err + default: + var aa AutomationAction + err := json.Unmarshal(body, &aa) + return aa, err + } +} +func unmarshalBasicAutomationActionArray(body []byte) ([]BasicAutomationAction, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aaArray := make([]BasicAutomationAction, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aa, err := unmarshalBasicAutomationAction(*rawMessage) + if err != nil { + return nil, err + } + aaArray[index] = aa + } + return aaArray, nil +} + +// MarshalJSON is the custom marshaler for AutomationAction. +func (aa AutomationAction) MarshalJSON() ([]byte, error) { + aa.ActionType = ActionTypeAutomationAction + objectMap := make(map[string]interface{}) + if aa.ActionType != "" { + objectMap["actionType"] = aa.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationAction() (*AutomationAction, bool) { + return &aa, true +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aa, true +} + +// AutomationActionEventHub the target Event Hub to which event data will be exported. +type AutomationActionEventHub struct { + // EventHubResourceID - The target Event Hub Azure Resource ID. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // SasPolicyName - READ-ONLY; The target Event Hub SAS policy name. + SasPolicyName *string `json:"sasPolicyName,omitempty"` + // ConnectionString - The target Event Hub connection string (it will not be included in any response). + ConnectionString *string `json:"connectionString,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) MarshalJSON() ([]byte, error) { + aaeh.ActionType = ActionTypeEventHub + objectMap := make(map[string]interface{}) + if aaeh.EventHubResourceID != nil { + objectMap["eventHubResourceId"] = aaeh.EventHubResourceID + } + if aaeh.ConnectionString != nil { + objectMap["connectionString"] = aaeh.ConnectionString + } + if aaeh.ActionType != "" { + objectMap["actionType"] = aaeh.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return &aaeh, true +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaeh, true +} + +// AutomationActionLogicApp the logic app action that should be triggered. +type AutomationActionLogicApp struct { + // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App + LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` + // URI - The Logic App trigger URI endpoint (it will not be included in any response). + URI *string `json:"uri,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) MarshalJSON() ([]byte, error) { + aala.ActionType = ActionTypeLogicApp + objectMap := make(map[string]interface{}) + if aala.LogicAppResourceID != nil { + objectMap["logicAppResourceId"] = aala.LogicAppResourceID + } + if aala.URI != nil { + objectMap["uri"] = aala.URI + } + if aala.ActionType != "" { + objectMap["actionType"] = aala.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return &aala, true +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aala, true +} + +// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security +// alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the +// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order +// to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be +// enabled on that workspace. +type AutomationActionWorkspace struct { + // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. + WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) MarshalJSON() ([]byte, error) { + aaw.ActionType = ActionTypeWorkspace + objectMap := make(map[string]interface{}) + if aaw.WorkspaceResourceID != nil { + objectMap["workspaceResourceId"] = aaw.WorkspaceResourceID + } + if aaw.ActionType != "" { + objectMap["actionType"] = aaw.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return &aaw, true +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaw, true +} + +// AutomationList list of security automations response. +type AutomationList struct { + autorest.Response `json:"-"` + // Value - The list of security automations under the given scope. + Value *[]Automation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AutomationListIterator provides access to a complete listing of Automation values. +type AutomationListIterator struct { + i int + page AutomationListPage +} + +// 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 *AutomationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListIterator.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 *AutomationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AutomationListIterator) 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 AutomationListIterator) Response() AutomationList { + 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 AutomationListIterator) Value() Automation { + if !iter.page.NotDone() { + return Automation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AutomationListIterator type. +func NewAutomationListIterator(page AutomationListPage) AutomationListIterator { + return AutomationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AutomationList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// automationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AutomationList) automationListPreparer(ctx context.Context) (*http.Request, error) { + if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// AutomationListPage contains a page of Automation values. +type AutomationListPage struct { + fn func(context.Context, AutomationList) (AutomationList, error) + al AutomationList +} + +// 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 *AutomationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListPage.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.al) + if err != nil { + return err + } + page.al = 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 *AutomationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AutomationListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AutomationListPage) Response() AutomationList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AutomationListPage) Values() []Automation { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AutomationListPage type. +func NewAutomationListPage(getNextPage func(context.Context, AutomationList) (AutomationList, error)) AutomationListPage { + return AutomationListPage{fn: getNextPage} +} + +// AutomationProperties a set of properties that defines the behavior of the automation configuration. To +// learn more about the supported security events data models schemas - please visit +// https://aka.ms/ASCAutomationSchemas. +type AutomationProperties struct { + // Description - The security automation description. + Description *string `json:"description,omitempty"` + // IsEnabled - Indicates whether the security automation is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` + // Scopes - A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. + Scopes *[]AutomationScope `json:"scopes,omitempty"` + // Sources - A collection of the source event types which evaluate the security automation set of rules. + Sources *[]AutomationSource `json:"sources,omitempty"` + // Actions - A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. + Actions *[]BasicAutomationAction `json:"actions,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AutomationProperties struct. +func (ap *AutomationProperties) 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 "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ap.Description = &description + } + case "isEnabled": + if v != nil { + var isEnabled bool + err = json.Unmarshal(*v, &isEnabled) + if err != nil { + return err + } + ap.IsEnabled = &isEnabled + } + case "scopes": + if v != nil { + var scopes []AutomationScope + err = json.Unmarshal(*v, &scopes) + if err != nil { + return err + } + ap.Scopes = &scopes + } + case "sources": + if v != nil { + var sources []AutomationSource + err = json.Unmarshal(*v, &sources) + if err != nil { + return err + } + ap.Sources = &sources + } + case "actions": + if v != nil { + actions, err := unmarshalBasicAutomationActionArray(*v) + if err != nil { + return err + } + ap.Actions = &actions + } + } + } + + return nil +} + +// AutomationRuleSet a rule set which evaluates all its rules upon an event interception. Only when all the +// included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions. +type AutomationRuleSet struct { + Rules *[]AutomationTriggeringRule `json:"rules,omitempty"` +} + +// AutomationScope a single automation scope. +type AutomationScope struct { + // Description - The resources scope description. + Description *string `json:"description,omitempty"` + // ScopePath - The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs). + ScopePath *string `json:"scopePath,omitempty"` +} + +// AutomationSource the source event types which evaluate the security automation set of rules. For example +// - security alerts and security assessments. To learn more about the supported security events data +// models schemas - please visit https://aka.ms/ASCAutomationSchemas. +type AutomationSource struct { + // EventSource - A valid event source type. Possible values include: 'Assessments', 'Alerts' + EventSource EventSource `json:"eventSource,omitempty"` + // RuleSets - A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). + RuleSets *[]AutomationRuleSet `json:"ruleSets,omitempty"` +} + +// AutomationTriggeringRule a rule which is evaluated upon event interception. The rule is configured by +// comparing a specific value from the event model to an expected value. This comparison is done by using +// one of the supported operators set. +type AutomationTriggeringRule struct { + // PropertyJPath - The JPath of the entity model property that should be checked. + PropertyJPath *string `json:"propertyJPath,omitempty"` + // PropertyType - The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. Possible values include: 'String', 'Integer', 'Number', 'Boolean' + PropertyType PropertyType `json:"propertyType,omitempty"` + // ExpectedValue - The expected value. + ExpectedValue *string `json:"expectedValue,omitempty"` + // Operator - A valid comparer operator to use. Possible values include: 'Equals', 'GreaterThan', 'GreaterThanOrEqualTo', 'LesserThan', 'LesserThanOrEqualTo', 'NotEquals', 'Contains', 'StartsWith', 'EndsWith' + Operator Operator `json:"operator,omitempty"` +} + +// AutomationValidationStatus the security automation model state property bag. +type AutomationValidationStatus struct { + autorest.Response `json:"-"` + // IsValid - Indicates whether the model is valid or not. + IsValid *bool `json:"isValid,omitempty"` + // Message - The validation message. + Message *string `json:"message,omitempty"` +} + // AutoProvisioningSetting auto provisioning setting type AutoProvisioningSetting struct { autorest.Response `json:"-"` @@ -3563,7 +4287,7 @@ type DataExportSettingProperties struct { type DenylistCustomAlertRule struct { // DenylistValues - The values to deny. The format of the values depends on the rule type. DenylistValues *[]string `json:"denylistValues,omitempty"` - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` @@ -6023,7 +6747,7 @@ type Kind struct { // ListCustomAlertRule a List custom alert rule type ListCustomAlertRule struct { - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` diff --git a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go index d644808b3439..aae9e052ab7e 100644 --- a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go @@ -23,6 +23,18 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// AutomationsClientAPI contains the set of methods on the AutomationsClient type. +type AutomationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation security.Automation) (result security.Automation, err error) + Delete(ctx context.Context, resourceGroupName string, automationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationName string) (result security.Automation, err error) + List(ctx context.Context) (result security.AutomationListPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.AutomationListPage, err error) + Validate(ctx context.Context, resourceGroupName string, automationName string, automation security.Automation) (result security.AutomationValidationStatus, err error) +} + +var _ AutomationsClientAPI = (*security.AutomationsClient)(nil) + // SubAssessmentsClientAPI contains the set of methods on the SubAssessmentsClient type. type SubAssessmentsClientAPI interface { Get(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (result security.SubAssessment, err error) diff --git a/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go b/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go new file mode 100644 index 000000000000..86370dbcd2a6 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go @@ -0,0 +1,221 @@ +package security + +// 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" +) + +// AssessmentsMetadataClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AssessmentsMetadataClient struct { + BaseClient +} + +// NewAssessmentsMetadataClient creates an instance of the AssessmentsMetadataClient client. +func NewAssessmentsMetadataClient(subscriptionID string, ascLocation string) AssessmentsMetadataClient { + return NewAssessmentsMetadataClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAssessmentsMetadataClientWithBaseURI creates an instance of the AssessmentsMetadataClient client. +func NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataClient { + return AssessmentsMetadataClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get get metadata information on an assessment type +// Parameters: +// assessmentMetadataName - the Assessment Key - Unique key for the assessment type +func (client AssessmentsMetadataClient) Get(ctx context.Context, assessmentMetadataName string) (result AssessmentMetadata, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.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, assessmentMetadataName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AssessmentsMetadataClient) GetPreparer(ctx context.Context, assessmentMetadataName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", 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 AssessmentsMetadataClient) 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 AssessmentsMetadataClient) GetResponder(resp *http.Response) (result AssessmentMetadata, 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 get metadata information on all assessment types +func (client AssessmentsMetadataClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.List") + defer func() { + sc := -1 + if result.aml.Response.Response != nil { + sc = result.aml.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aml.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure sending request") + return + } + + result.aml, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AssessmentsMetadataClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Security/assessmentMetadata"), + 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 AssessmentsMetadataClient) 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 AssessmentsMetadataClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, 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 AssessmentsMetadataClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { + req, err := lastResults.assessmentMetadataListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "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, "security.AssessmentsMetadataClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AssessmentsMetadataClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.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/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go b/services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go new file mode 100644 index 000000000000..6196ed904798 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go @@ -0,0 +1,409 @@ +package security + +// 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" +) + +// AssessmentsMetadataSubscriptionClient is the API spec for Microsoft.Security (Azure Security Center) resource +// provider +type AssessmentsMetadataSubscriptionClient struct { + BaseClient +} + +// NewAssessmentsMetadataSubscriptionClient creates an instance of the AssessmentsMetadataSubscriptionClient client. +func NewAssessmentsMetadataSubscriptionClient(subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { + return NewAssessmentsMetadataSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAssessmentsMetadataSubscriptionClientWithBaseURI creates an instance of the AssessmentsMetadataSubscriptionClient +// client. +func NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { + return AssessmentsMetadataSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Create create metadata information on an assessment type in a specific subscription +// Parameters: +// assessmentMetadataName - the Assessment Key - Unique key for the assessment type +// assessmentMetadata - assessmentMetadata object +func (client AssessmentsMetadataSubscriptionClient) Create(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadata) (result AssessmentMetadata, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: assessmentMetadata, + Constraints: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, assessmentMetadataName, assessmentMetadata) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client AssessmentsMetadataSubscriptionClient) CreatePreparer(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadata) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + 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}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", pathParameters), + autorest.WithJSON(assessmentMetadata), + 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 AssessmentsMetadataSubscriptionClient) 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 AssessmentsMetadataSubscriptionClient) CreateResponder(resp *http.Response) (result AssessmentMetadata, 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 delete metadata information on an assessment type in a specific subscription, will cause the deletion of all +// the assessments of that type in that subscription +// Parameters: +// assessmentMetadataName - the Assessment Key - Unique key for the assessment type +func (client AssessmentsMetadataSubscriptionClient) Delete(ctx context.Context, assessmentMetadataName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, assessmentMetadataName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AssessmentsMetadataSubscriptionClient) DeletePreparer(ctx context.Context, assessmentMetadataName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", 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 AssessmentsMetadataSubscriptionClient) 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 AssessmentsMetadataSubscriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get metadata information on an assessment type in a specific subscription +// Parameters: +// assessmentMetadataName - the Assessment Key - Unique key for the assessment type +func (client AssessmentsMetadataSubscriptionClient) Get(ctx context.Context, assessmentMetadataName string) (result AssessmentMetadata, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.Get") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, assessmentMetadataName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AssessmentsMetadataSubscriptionClient) GetPreparer(ctx context.Context, assessmentMetadataName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", 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 AssessmentsMetadataSubscriptionClient) 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 AssessmentsMetadataSubscriptionClient) GetResponder(resp *http.Response) (result AssessmentMetadata, 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 get metadata information on all assessment types in a specific subscription +func (client AssessmentsMetadataSubscriptionClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.List") + defer func() { + sc := -1 + if result.aml.Response.Response != nil { + sc = result.aml.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aml.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure sending request") + return + } + + result.aml, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AssessmentsMetadataSubscriptionClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata", 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 AssessmentsMetadataSubscriptionClient) 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 AssessmentsMetadataSubscriptionClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, 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 AssessmentsMetadataSubscriptionClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { + req, err := lastResults.assessmentMetadataListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "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, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AssessmentsMetadataSubscriptionClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.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/security/mgmt/v3.0/security/automations.go b/services/preview/security/mgmt/v3.0/security/automations.go new file mode 100644 index 000000000000..605cb35a072d --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/automations.go @@ -0,0 +1,643 @@ +package security + +// 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" +) + +// AutomationsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AutomationsClient struct { + BaseClient +} + +// NewAutomationsClient creates an instance of the AutomationsClient client. +func NewAutomationsClient(subscriptionID string, ascLocation string) AutomationsClient { + return NewAutomationsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAutomationsClientWithBaseURI creates an instance of the AutomationsClient client. +func NewAutomationsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AutomationsClient { + return AutomationsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// CreateOrUpdate creates or updates a security automation. If a security automation is already created and a +// subsequent request is issued for the same automation id, then it will be updated. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +// automation - the security automation resource +func (client AutomationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (result Automation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationName, automation) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AutomationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + 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.Security/automations/{automationName}", pathParameters), + autorest.WithJSON(automation), + 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 AutomationsClient) 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 AutomationsClient) CreateOrUpdateResponder(resp *http.Response) (result Automation, 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 security automation. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +func (client AutomationsClient) Delete(ctx context.Context, resourceGroupName string, automationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AutomationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}", 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 AutomationsClient) 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 AutomationsClient) 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 retrieves information about the model of a security automation. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +func (client AutomationsClient) Get(ctx context.Context, resourceGroupName string, automationName string) (result Automation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Get") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AutomationsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}", 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 AutomationsClient) 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 AutomationsClient) GetResponder(resp *http.Response) (result Automation, 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 security automations in the specified subscription. Use the 'nextLink' property in the response +// to get the next page of security automations for the specified subscription. +func (client AutomationsClient) List(ctx context.Context) (result AutomationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.List") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", resp, "Failure sending request") + return + } + + result.al, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AutomationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations", 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 AutomationsClient) 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 AutomationsClient) ListResponder(resp *http.Response) (result AutomationList, 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 AutomationsClient) listNextResults(ctx context.Context, lastResults AutomationList) (result AutomationList, err error) { + req, err := lastResults.automationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AutomationsClient", "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, "security.AutomationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AutomationsClient) ListComplete(ctx context.Context) (result AutomationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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 security automations in the specified resource group. Use the 'nextLink' property +// in the response to get the next page of security automations for the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client AutomationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AutomationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.al, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AutomationsClient) 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-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations", 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 AutomationsClient) 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 AutomationsClient) ListByResourceGroupResponder(resp *http.Response) (result AutomationList, 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 AutomationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AutomationList) (result AutomationList, err error) { + req, err := lastResults.automationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AutomationsClient", "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, "security.AutomationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AutomationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AutomationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.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 +} + +// Validate validates the security automation model before create or update. Any validation errors are returned to the +// client. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// automationName - the security automation name. +// automation - the security automation resource +func (client AutomationsClient) Validate(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (result AutomationValidationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationsClient.Validate") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AutomationsClient", "Validate", err.Error()) + } + + req, err := client.ValidatePreparer(ctx, resourceGroupName, automationName, automation) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", resp, "Failure sending request") + return + } + + result, err = client.ValidateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AutomationsClient", "Validate", resp, "Failure responding to request") + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client AutomationsClient) ValidatePreparer(ctx context.Context, resourceGroupName string, automationName string, automation Automation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationName": autorest.Encode("path", automationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate", pathParameters), + autorest.WithJSON(automation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateSender sends the Validate request. The method will close the +// http.Response Body if it receives an error. +func (client AutomationsClient) ValidateSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client AutomationsClient) ValidateResponder(resp *http.Response) (result AutomationValidationStatus, 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/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 673e41e438de..b0387bb0f382 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -65,6 +65,25 @@ func PossibleActionValues() []Action { return []Action{Add, Recommended, Remove} } +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // ActionTypeAutomationAction ... + ActionTypeAutomationAction ActionType = "AutomationAction" + // ActionTypeEventHub ... + ActionTypeEventHub ActionType = "EventHub" + // ActionTypeLogicApp ... + ActionTypeLogicApp ActionType = "LogicApp" + // ActionTypeWorkspace ... + ActionTypeWorkspace ActionType = "Workspace" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ActionTypeAutomationAction, ActionTypeEventHub, ActionTypeLogicApp, ActionTypeWorkspace} +} + // AlertNotifications enumerates the values for alert notifications. type AlertNotifications string @@ -114,6 +133,25 @@ func PossibleAssessedResourceTypeValues() []AssessedResourceType { return []AssessedResourceType{AssessedResourceTypeAdditionalData, AssessedResourceTypeContainerRegistryVulnerability, AssessedResourceTypeServerVulnerabilityAssessment, AssessedResourceTypeSQLServerVulnerability} } +// AssessmentType enumerates the values for assessment type. +type AssessmentType string + +const ( + // BuiltIn Azure Security Center managed assessments + BuiltIn AssessmentType = "BuiltIn" + // CustomerManaged User assessments pushed directly by the user or other third party to Azure Security + // Center + CustomerManaged AssessmentType = "CustomerManaged" + // CustomPolicy User defined policies that are automatically ingested from Azure Policy to Azure Security + // Center + CustomPolicy AssessmentType = "CustomPolicy" +) + +// PossibleAssessmentTypeValues returns an array of possible values for the AssessmentType const type. +func PossibleAssessmentTypeValues() []AssessmentType { + return []AssessmentType{BuiltIn, CustomerManaged, CustomPolicy} +} + // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -129,6 +167,27 @@ func PossibleAutoProvisionValues() []AutoProvision { return []AutoProvision{AutoProvisionOff, AutoProvisionOn} } +// Category enumerates the values for category. +type Category string + +const ( + // Compute ... + Compute Category = "Compute" + // Data ... + Data Category = "Data" + // IdentityAndAccess ... + IdentityAndAccess Category = "IdentityAndAccess" + // IoT ... + IoT Category = "IoT" + // Networking ... + Networking Category = "Networking" +) + +// PossibleCategoryValues returns an array of possible values for the Category const type. +func PossibleCategoryValues() []Category { + return []Category{Compute, Data, IdentityAndAccess, IoT, Networking} +} + // ConfigurationStatus enumerates the values for configuration status. type ConfigurationStatus string @@ -254,6 +313,21 @@ func PossibleEnforcementMode1Values() []EnforcementMode1 { return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce, EnforcementMode1None} } +// EventSource enumerates the values for event source. +type EventSource string + +const ( + // Alerts ... + Alerts EventSource = "Alerts" + // Assessments ... + Assessments EventSource = "Assessments" +) + +// PossibleEventSourceValues returns an array of possible values for the EventSource const type. +func PossibleEventSourceValues() []EventSource { + return []EventSource{Alerts, Assessments} +} + // Exe enumerates the values for exe. type Exe string @@ -360,6 +434,23 @@ func PossibleFileTypeValues() []FileType { return []FileType{FileTypeDll, FileTypeExe, FileTypeExecutable, FileTypeMsi, FileTypeScript, FileTypeUnknown} } +// ImplementationEffort enumerates the values for implementation effort. +type ImplementationEffort string + +const ( + // High ... + High ImplementationEffort = "High" + // Low ... + Low ImplementationEffort = "Low" + // Moderate ... + Moderate ImplementationEffort = "Moderate" +) + +// PossibleImplementationEffortValues returns an array of possible values for the ImplementationEffort const type. +func PossibleImplementationEffortValues() []ImplementationEffort { + return []ImplementationEffort{High, Low, Moderate} +} + // Issue enumerates the values for issue. type Issue string @@ -419,6 +510,35 @@ func PossibleMsiValues() []Msi { return []Msi{MsiAudit, MsiEnforce, MsiNone} } +// Operator enumerates the values for operator. +type Operator string + +const ( + // Contains ... + Contains Operator = "Contains" + // EndsWith ... + EndsWith Operator = "EndsWith" + // Equals ... + Equals Operator = "Equals" + // GreaterThan ... + GreaterThan Operator = "GreaterThan" + // GreaterThanOrEqualTo ... + GreaterThanOrEqualTo Operator = "GreaterThanOrEqualTo" + // LesserThan ... + LesserThan Operator = "LesserThan" + // LesserThanOrEqualTo ... + LesserThanOrEqualTo Operator = "LesserThanOrEqualTo" + // NotEquals ... + NotEquals Operator = "NotEquals" + // StartsWith ... + StartsWith Operator = "StartsWith" +) + +// PossibleOperatorValues returns an array of possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{Contains, EndsWith, Equals, GreaterThan, GreaterThanOrEqualTo, LesserThan, LesserThanOrEqualTo, NotEquals, StartsWith} +} + // PricingTier enumerates the values for pricing tier. type PricingTier string @@ -434,6 +554,25 @@ func PossiblePricingTierValues() []PricingTier { return []PricingTier{Free, Standard} } +// PropertyType enumerates the values for property type. +type PropertyType string + +const ( + // Boolean ... + Boolean PropertyType = "Boolean" + // Integer ... + Integer PropertyType = "Integer" + // Number ... + Number PropertyType = "Number" + // String ... + String PropertyType = "String" +) + +// PossiblePropertyTypeValues returns an array of possible values for the PropertyType const type. +func PossiblePropertyTypeValues() []PropertyType { + return []PropertyType{Boolean, Integer, Number, String} +} + // Protocol enumerates the values for protocol. type Protocol string @@ -599,19 +738,19 @@ func PossibleRecommendationTypeValues() []RecommendationType { type ReportedSeverity string const ( - // High ... - High ReportedSeverity = "High" - // Informational ... - Informational ReportedSeverity = "Informational" - // Low ... - Low ReportedSeverity = "Low" - // Medium ... - Medium ReportedSeverity = "Medium" + // ReportedSeverityHigh ... + ReportedSeverityHigh ReportedSeverity = "High" + // ReportedSeverityInformational ... + ReportedSeverityInformational ReportedSeverity = "Informational" + // ReportedSeverityLow ... + ReportedSeverityLow ReportedSeverity = "Low" + // ReportedSeverityMedium ... + ReportedSeverityMedium ReportedSeverity = "Medium" ) // PossibleReportedSeverityValues returns an array of possible values for the ReportedSeverity const type. func PossibleReportedSeverityValues() []ReportedSeverity { - return []ReportedSeverity{High, Informational, Low, Medium} + return []ReportedSeverity{ReportedSeverityHigh, ReportedSeverityInformational, ReportedSeverityLow, ReportedSeverityMedium} } // ResourceStatus enumerates the values for resource status. @@ -804,6 +943,33 @@ func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { return []SubAssessmentStatusCode{SubAssessmentStatusCodeHealthy, SubAssessmentStatusCodeNotApplicable, SubAssessmentStatusCodeUnhealthy} } +// Threats enumerates the values for threats. +type Threats string + +const ( + // AccountBreach ... + AccountBreach Threats = "accountBreach" + // DataExfiltration ... + DataExfiltration Threats = "dataExfiltration" + // DataSpillage ... + DataSpillage Threats = "dataSpillage" + // DenialOfService ... + DenialOfService Threats = "denialOfService" + // ElevationOfPrivilege ... + ElevationOfPrivilege Threats = "elevationOfPrivilege" + // MaliciousInsider ... + MaliciousInsider Threats = "maliciousInsider" + // MissingCoverage ... + MissingCoverage Threats = "missingCoverage" + // ThreatResistance ... + ThreatResistance Threats = "threatResistance" +) + +// PossibleThreatsValues returns an array of possible values for the Threats const type. +func PossibleThreatsValues() []Threats { + return []Threats{AccountBreach, DataExfiltration, DataSpillage, DenialOfService, ElevationOfPrivilege, MaliciousInsider, MissingCoverage, ThreatResistance} +} + // Type enumerates the values for type. type Type string @@ -842,19 +1008,36 @@ func PossibleUnmaskedIPLoggingStatusValues() []UnmaskedIPLoggingStatus { return []UnmaskedIPLoggingStatus{UnmaskedIPLoggingStatusDisabled, UnmaskedIPLoggingStatusEnabled} } +// UserImpact enumerates the values for user impact. +type UserImpact string + +const ( + // UserImpactHigh ... + UserImpactHigh UserImpact = "High" + // UserImpactLow ... + UserImpactLow UserImpact = "Low" + // UserImpactModerate ... + UserImpactModerate UserImpact = "Moderate" +) + +// PossibleUserImpactValues returns an array of possible values for the UserImpact const type. +func PossibleUserImpactValues() []UserImpact { + return []UserImpact{UserImpactHigh, UserImpactLow, UserImpactModerate} +} + // ValueType enumerates the values for value type. type ValueType string const ( - // IPCidr An IP range in CIDR format (e.g. '192.168.0.1/8'). - IPCidr ValueType = "IpCidr" - // String Any string value. - String ValueType = "String" + // ValueTypeIPCidr An IP range in CIDR format (e.g. '192.168.0.1/8'). + ValueTypeIPCidr ValueType = "IpCidr" + // ValueTypeString Any string value. + ValueTypeString ValueType = "String" ) // PossibleValueTypeValues returns an array of possible values for the ValueType const type. func PossibleValueTypeValues() []ValueType { - return []ValueType{IPCidr, String} + return []ValueType{ValueTypeIPCidr, ValueTypeString} } // AadConnectivityState1 describes an Azure resource with kind @@ -1396,7 +1579,7 @@ type AlertProperties struct { RemediationSteps *string `json:"remediationSteps,omitempty"` // ActionTaken - READ-ONLY; The action that was taken as a response to the alert (Active, Blocked etc.) ActionTaken *string `json:"actionTaken,omitempty"` - // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'ReportedSeverityInformational', 'ReportedSeverityLow', 'ReportedSeverityMedium', 'ReportedSeverityHigh' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // CompromisedEntity - READ-ONLY; The entity that the incident happened on CompromisedEntity *string `json:"compromisedEntity,omitempty"` @@ -1682,7 +1865,7 @@ type AllowedConnectionsResourceProperties struct { type AllowlistCustomAlertRule struct { // AllowlistValues - The values to allow. The format of the values depends on the rule type. AllowlistValues *[]string `json:"allowlistValues,omitempty"` - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` @@ -1977,6 +2160,248 @@ func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) ( return AscLocationListPage{fn: getNextPage} } +// AssessmentMetadata security assessment metadata +type AssessmentMetadata struct { + autorest.Response `json:"-"` + *AssessmentMetadataProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AssessmentMetadata. +func (am AssessmentMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if am.AssessmentMetadataProperties != nil { + objectMap["properties"] = am.AssessmentMetadataProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AssessmentMetadata struct. +func (am *AssessmentMetadata) 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 assessmentMetadataProperties AssessmentMetadataProperties + err = json.Unmarshal(*v, &assessmentMetadataProperties) + if err != nil { + return err + } + am.AssessmentMetadataProperties = &assessmentMetadataProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + am.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + am.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + am.Type = &typeVar + } + } + } + + return nil +} + +// AssessmentMetadataList list of security assessment metadata +type AssessmentMetadataList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY + Value *[]AssessmentMetadata `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AssessmentMetadataListIterator provides access to a complete listing of AssessmentMetadata values. +type AssessmentMetadataListIterator struct { + i int + page AssessmentMetadataListPage +} + +// 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 *AssessmentMetadataListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListIterator.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 *AssessmentMetadataListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AssessmentMetadataListIterator) 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 AssessmentMetadataListIterator) Response() AssessmentMetadataList { + 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 AssessmentMetadataListIterator) Value() AssessmentMetadata { + if !iter.page.NotDone() { + return AssessmentMetadata{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AssessmentMetadataListIterator type. +func NewAssessmentMetadataListIterator(page AssessmentMetadataListPage) AssessmentMetadataListIterator { + return AssessmentMetadataListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aml AssessmentMetadataList) IsEmpty() bool { + return aml.Value == nil || len(*aml.Value) == 0 +} + +// assessmentMetadataListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aml AssessmentMetadataList) assessmentMetadataListPreparer(ctx context.Context) (*http.Request, error) { + if aml.NextLink == nil || len(to.String(aml.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aml.NextLink))) +} + +// AssessmentMetadataListPage contains a page of AssessmentMetadata values. +type AssessmentMetadataListPage struct { + fn func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error) + aml AssessmentMetadataList +} + +// 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 *AssessmentMetadataListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentMetadataListPage.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.aml) + if err != nil { + return err + } + page.aml = 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 *AssessmentMetadataListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AssessmentMetadataListPage) NotDone() bool { + return !page.aml.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AssessmentMetadataListPage) Response() AssessmentMetadataList { + return page.aml +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AssessmentMetadataListPage) Values() []AssessmentMetadata { + if page.aml.IsEmpty() { + return nil + } + return *page.aml.Value +} + +// Creates a new instance of the AssessmentMetadataListPage type. +func NewAssessmentMetadataListPage(getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { + return AssessmentMetadataListPage{fn: getNextPage} +} + +// AssessmentMetadataProperties describes properties of an assessment metadata. +type AssessmentMetadataProperties struct { + // DisplayName - User friendly display name of the assessment + DisplayName *string `json:"displayName,omitempty"` + // PolicyDefinitionID - READ-ONLY; Azure resource ID of the policy definition that turns this assessment calculation on + PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"` + // Description - Human readable description of the assessment + Description *string `json:"description,omitempty"` + // RemediationDescription - Human readable description of what you should do to mitigate this security issue + RemediationDescription *string `json:"remediationDescription,omitempty"` + Category *[]Category `json:"category,omitempty"` + // Severity - The severity level of the assessment. Possible values include: 'SeverityLow', 'SeverityMedium', 'SeverityHigh' + Severity Severity `json:"severity,omitempty"` + // UserImpact - The user impact of the assessment. Possible values include: 'UserImpactLow', 'UserImpactModerate', 'UserImpactHigh' + UserImpact UserImpact `json:"userImpact,omitempty"` + // ImplementationEffort - The implementation effort required to remediate this assessment. Possible values include: 'Low', 'Moderate', 'High' + ImplementationEffort ImplementationEffort `json:"implementationEffort,omitempty"` + Threats *[]Threats `json:"threats,omitempty"` + // Preview - True if this assessment is in preview release status + Preview *bool `json:"preview,omitempty"` + // AssessmentType - BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'CustomPolicy', 'CustomerManaged' + AssessmentType AssessmentType `json:"assessmentType,omitempty"` +} + // AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace type AtaExternalSecuritySolution struct { Properties *AtaSolutionProperties `json:"properties,omitempty"` @@ -2124,6 +2549,648 @@ func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { return nil } +// Automation the security automation resource. +type Automation struct { + autorest.Response `json:"-"` + // AutomationProperties - Security automation data + *AutomationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` + // Tags - A list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Automation. +func (a Automation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AutomationProperties != nil { + objectMap["properties"] = a.AutomationProperties + } + if a.Kind != nil { + objectMap["kind"] = a.Kind + } + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Automation struct. +func (a *Automation) 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 automationProperties AutomationProperties + err = json.Unmarshal(*v, &automationProperties) + if err != nil { + return err + } + a.AutomationProperties = &automationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + a.Kind = &kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + } + } + + return nil +} + +// BasicAutomationAction the action that should be triggered. +type BasicAutomationAction interface { + AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) + AsAutomationActionEventHub() (*AutomationActionEventHub, bool) + AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) + AsAutomationAction() (*AutomationAction, bool) +} + +// AutomationAction the action that should be triggered. +type AutomationAction struct { + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +func unmarshalBasicAutomationAction(body []byte) (BasicAutomationAction, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["actionType"] { + case string(ActionTypeLogicApp): + var aala AutomationActionLogicApp + err := json.Unmarshal(body, &aala) + return aala, err + case string(ActionTypeEventHub): + var aaeh AutomationActionEventHub + err := json.Unmarshal(body, &aaeh) + return aaeh, err + case string(ActionTypeWorkspace): + var aaw AutomationActionWorkspace + err := json.Unmarshal(body, &aaw) + return aaw, err + default: + var aa AutomationAction + err := json.Unmarshal(body, &aa) + return aa, err + } +} +func unmarshalBasicAutomationActionArray(body []byte) ([]BasicAutomationAction, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aaArray := make([]BasicAutomationAction, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aa, err := unmarshalBasicAutomationAction(*rawMessage) + if err != nil { + return nil, err + } + aaArray[index] = aa + } + return aaArray, nil +} + +// MarshalJSON is the custom marshaler for AutomationAction. +func (aa AutomationAction) MarshalJSON() ([]byte, error) { + aa.ActionType = ActionTypeAutomationAction + objectMap := make(map[string]interface{}) + if aa.ActionType != "" { + objectMap["actionType"] = aa.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationAction() (*AutomationAction, bool) { + return &aa, true +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aa, true +} + +// AutomationActionEventHub the target Event Hub to which event data will be exported. +type AutomationActionEventHub struct { + // EventHubResourceID - The target Event Hub Azure Resource ID. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // SasPolicyName - READ-ONLY; The target Event Hub SAS policy name. + SasPolicyName *string `json:"sasPolicyName,omitempty"` + // ConnectionString - The target Event Hub connection string (it will not be included in any response). + ConnectionString *string `json:"connectionString,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) MarshalJSON() ([]byte, error) { + aaeh.ActionType = ActionTypeEventHub + objectMap := make(map[string]interface{}) + if aaeh.EventHubResourceID != nil { + objectMap["eventHubResourceId"] = aaeh.EventHubResourceID + } + if aaeh.ConnectionString != nil { + objectMap["connectionString"] = aaeh.ConnectionString + } + if aaeh.ActionType != "" { + objectMap["actionType"] = aaeh.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return &aaeh, true +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaeh, true +} + +// AutomationActionLogicApp the logic app action that should be triggered. +type AutomationActionLogicApp struct { + // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App + LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` + // URI - The Logic App trigger URI endpoint (it will not be included in any response). + URI *string `json:"uri,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) MarshalJSON() ([]byte, error) { + aala.ActionType = ActionTypeLogicApp + objectMap := make(map[string]interface{}) + if aala.LogicAppResourceID != nil { + objectMap["logicAppResourceId"] = aala.LogicAppResourceID + } + if aala.URI != nil { + objectMap["uri"] = aala.URI + } + if aala.ActionType != "" { + objectMap["actionType"] = aala.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return &aala, true +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aala, true +} + +// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security +// alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the +// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order +// to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be +// enabled on that workspace. +type AutomationActionWorkspace struct { + // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. + WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) MarshalJSON() ([]byte, error) { + aaw.ActionType = ActionTypeWorkspace + objectMap := make(map[string]interface{}) + if aaw.WorkspaceResourceID != nil { + objectMap["workspaceResourceId"] = aaw.WorkspaceResourceID + } + if aaw.ActionType != "" { + objectMap["actionType"] = aaw.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return &aaw, true +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaw, true +} + +// AutomationList list of security automations response. +type AutomationList struct { + autorest.Response `json:"-"` + // Value - The list of security automations under the given scope. + Value *[]Automation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AutomationListIterator provides access to a complete listing of Automation values. +type AutomationListIterator struct { + i int + page AutomationListPage +} + +// 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 *AutomationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListIterator.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 *AutomationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AutomationListIterator) 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 AutomationListIterator) Response() AutomationList { + 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 AutomationListIterator) Value() Automation { + if !iter.page.NotDone() { + return Automation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AutomationListIterator type. +func NewAutomationListIterator(page AutomationListPage) AutomationListIterator { + return AutomationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AutomationList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// automationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AutomationList) automationListPreparer(ctx context.Context) (*http.Request, error) { + if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// AutomationListPage contains a page of Automation values. +type AutomationListPage struct { + fn func(context.Context, AutomationList) (AutomationList, error) + al AutomationList +} + +// 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 *AutomationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListPage.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.al) + if err != nil { + return err + } + page.al = 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 *AutomationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AutomationListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AutomationListPage) Response() AutomationList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AutomationListPage) Values() []Automation { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AutomationListPage type. +func NewAutomationListPage(getNextPage func(context.Context, AutomationList) (AutomationList, error)) AutomationListPage { + return AutomationListPage{fn: getNextPage} +} + +// AutomationProperties a set of properties that defines the behavior of the automation configuration. To +// learn more about the supported security events data models schemas - please visit +// https://aka.ms/ASCAutomationSchemas. +type AutomationProperties struct { + // Description - The security automation description. + Description *string `json:"description,omitempty"` + // IsEnabled - Indicates whether the security automation is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` + // Scopes - A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. + Scopes *[]AutomationScope `json:"scopes,omitempty"` + // Sources - A collection of the source event types which evaluate the security automation set of rules. + Sources *[]AutomationSource `json:"sources,omitempty"` + // Actions - A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. + Actions *[]BasicAutomationAction `json:"actions,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AutomationProperties struct. +func (ap *AutomationProperties) 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 "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ap.Description = &description + } + case "isEnabled": + if v != nil { + var isEnabled bool + err = json.Unmarshal(*v, &isEnabled) + if err != nil { + return err + } + ap.IsEnabled = &isEnabled + } + case "scopes": + if v != nil { + var scopes []AutomationScope + err = json.Unmarshal(*v, &scopes) + if err != nil { + return err + } + ap.Scopes = &scopes + } + case "sources": + if v != nil { + var sources []AutomationSource + err = json.Unmarshal(*v, &sources) + if err != nil { + return err + } + ap.Sources = &sources + } + case "actions": + if v != nil { + actions, err := unmarshalBasicAutomationActionArray(*v) + if err != nil { + return err + } + ap.Actions = &actions + } + } + } + + return nil +} + +// AutomationRuleSet a rule set which evaluates all its rules upon an event interception. Only when all the +// included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions. +type AutomationRuleSet struct { + Rules *[]AutomationTriggeringRule `json:"rules,omitempty"` +} + +// AutomationScope a single automation scope. +type AutomationScope struct { + // Description - The resources scope description. + Description *string `json:"description,omitempty"` + // ScopePath - The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs). + ScopePath *string `json:"scopePath,omitempty"` +} + +// AutomationSource the source event types which evaluate the security automation set of rules. For example +// - security alerts and security assessments. To learn more about the supported security events data +// models schemas - please visit https://aka.ms/ASCAutomationSchemas. +type AutomationSource struct { + // EventSource - A valid event source type. Possible values include: 'Assessments', 'Alerts' + EventSource EventSource `json:"eventSource,omitempty"` + // RuleSets - A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). + RuleSets *[]AutomationRuleSet `json:"ruleSets,omitempty"` +} + +// AutomationTriggeringRule a rule which is evaluated upon event interception. The rule is configured by +// comparing a specific value from the event model to an expected value. This comparison is done by using +// one of the supported operators set. +type AutomationTriggeringRule struct { + // PropertyJPath - The JPath of the entity model property that should be checked. + PropertyJPath *string `json:"propertyJPath,omitempty"` + // PropertyType - The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. Possible values include: 'String', 'Integer', 'Number', 'Boolean' + PropertyType PropertyType `json:"propertyType,omitempty"` + // ExpectedValue - The expected value. + ExpectedValue *string `json:"expectedValue,omitempty"` + // Operator - A valid comparer operator to use. Possible values include: 'Equals', 'GreaterThan', 'GreaterThanOrEqualTo', 'LesserThan', 'LesserThanOrEqualTo', 'NotEquals', 'Contains', 'StartsWith', 'EndsWith' + Operator Operator `json:"operator,omitempty"` +} + +// AutomationValidationStatus the security automation model state property bag. +type AutomationValidationStatus struct { + autorest.Response `json:"-"` + // IsValid - Indicates whether the model is valid or not. + IsValid *bool `json:"isValid,omitempty"` + // Message - The validation message. + Message *string `json:"message,omitempty"` +} + // AutoProvisioningSetting auto provisioning setting type AutoProvisioningSetting struct { autorest.Response `json:"-"` @@ -3550,7 +4617,7 @@ type DataExportSettingProperties struct { type DenylistCustomAlertRule struct { // DenylistValues - The values to deny. The format of the values depends on the rule type. DenylistValues *[]string `json:"denylistValues,omitempty"` - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` @@ -4941,7 +6008,7 @@ type IoTSecurityAggregatedAlertProperties struct { AggregatedDateUtc *date.Date `json:"aggregatedDateUtc,omitempty"` // VendorName - READ-ONLY; Name of the organization that raised the alert. VendorName *string `json:"vendorName,omitempty"` - // ReportedSeverity - READ-ONLY; Assessed alert severity. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Assessed alert severity. Possible values include: 'ReportedSeverityInformational', 'ReportedSeverityLow', 'ReportedSeverityMedium', 'ReportedSeverityHigh' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // RemediationSteps - READ-ONLY; Recommended steps for remediation. RemediationSteps *string `json:"remediationSteps,omitempty"` @@ -5221,7 +6288,7 @@ type IoTSecurityAggregatedRecommendationProperties struct { DetectedBy *string `json:"detectedBy,omitempty"` // RemediationSteps - READ-ONLY; Recommended steps for remediation RemediationSteps *string `json:"remediationSteps,omitempty"` - // ReportedSeverity - READ-ONLY; Assessed recommendation severity. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Assessed recommendation severity. Possible values include: 'ReportedSeverityInformational', 'ReportedSeverityLow', 'ReportedSeverityMedium', 'ReportedSeverityHigh' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // HealthyDevices - READ-ONLY; Number of healthy devices within the IoT Security solution. HealthyDevices *int32 `json:"healthyDevices,omitempty"` @@ -5245,7 +6312,7 @@ type IoTSecurityAlertedDevice struct { type IoTSecurityDeviceAlert struct { // AlertDisplayName - READ-ONLY; Display name of the alert AlertDisplayName *string `json:"alertDisplayName,omitempty"` - // ReportedSeverity - READ-ONLY; Assessed Alert severity. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Assessed Alert severity. Possible values include: 'ReportedSeverityInformational', 'ReportedSeverityLow', 'ReportedSeverityMedium', 'ReportedSeverityHigh' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // AlertsCount - READ-ONLY; Number of alerts raised for this alert type. AlertsCount *int32 `json:"alertsCount,omitempty"` @@ -5256,7 +6323,7 @@ type IoTSecurityDeviceAlert struct { type IoTSecurityDeviceRecommendation struct { // RecommendationDisplayName - READ-ONLY; Display name of the recommendation. RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` - // ReportedSeverity - READ-ONLY; Assessed recommendation severity. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - READ-ONLY; Assessed recommendation severity. Possible values include: 'ReportedSeverityInformational', 'ReportedSeverityLow', 'ReportedSeverityMedium', 'ReportedSeverityHigh' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // DevicesCount - READ-ONLY; Number of devices with this recommendation. DevicesCount *int32 `json:"devicesCount,omitempty"` @@ -5993,7 +7060,7 @@ type Kind struct { // ListCustomAlertRule a List custom alert rule. type ListCustomAlertRule struct { - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' ValueType ValueType `json:"valueType,omitempty"` // DisplayName - READ-ONLY; The display name of the custom alert. DisplayName *string `json:"displayName,omitempty"` diff --git a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go index 22e5109dcd51..bbf35bd7838e 100644 --- a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go @@ -297,3 +297,33 @@ type SubAssessmentsClientAPI interface { } var _ SubAssessmentsClientAPI = (*security.SubAssessmentsClient)(nil) + +// AutomationsClientAPI contains the set of methods on the AutomationsClient type. +type AutomationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation security.Automation) (result security.Automation, err error) + Delete(ctx context.Context, resourceGroupName string, automationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationName string) (result security.Automation, err error) + List(ctx context.Context) (result security.AutomationListPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.AutomationListPage, err error) + Validate(ctx context.Context, resourceGroupName string, automationName string, automation security.Automation) (result security.AutomationValidationStatus, err error) +} + +var _ AutomationsClientAPI = (*security.AutomationsClient)(nil) + +// AssessmentsMetadataClientAPI contains the set of methods on the AssessmentsMetadataClient type. +type AssessmentsMetadataClientAPI interface { + Get(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadata, err error) + List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) +} + +var _ AssessmentsMetadataClientAPI = (*security.AssessmentsMetadataClient)(nil) + +// AssessmentsMetadataSubscriptionClientAPI contains the set of methods on the AssessmentsMetadataSubscriptionClient type. +type AssessmentsMetadataSubscriptionClientAPI interface { + Create(ctx context.Context, assessmentMetadataName string, assessmentMetadata security.AssessmentMetadata) (result security.AssessmentMetadata, err error) + Delete(ctx context.Context, assessmentMetadataName string) (result autorest.Response, err error) + Get(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadata, err error) + List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) +} + +var _ AssessmentsMetadataSubscriptionClientAPI = (*security.AssessmentsMetadataSubscriptionClient)(nil) diff --git a/services/preview/servicebus/mgmt/2018-01-01-preview/servicebus/models.go b/services/preview/servicebus/mgmt/2018-01-01-preview/servicebus/models.go index 37ddb40bbe16..3b6d7397d184 100644 --- a/services/preview/servicebus/mgmt/2018-01-01-preview/servicebus/models.go +++ b/services/preview/servicebus/mgmt/2018-01-01-preview/servicebus/models.go @@ -46,6 +46,19 @@ func PossibleDefaultActionValues() []DefaultAction { return []DefaultAction{Allow, Deny} } +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // SystemAssigned ... + SystemAssigned IdentityType = "SystemAssigned" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{SystemAssigned} +} + // IPAction enumerates the values for ip action. type IPAction string @@ -61,6 +74,19 @@ func PossibleIPActionValues() []IPAction { return []IPAction{Accept, Reject} } +// KeySource enumerates the values for key source. +type KeySource string + +const ( + // MicrosoftKeyVault ... + MicrosoftKeyVault KeySource = "Microsoft.KeyVault" +) + +// PossibleKeySourceValues returns an array of possible values for the KeySource const type. +func PossibleKeySourceValues() []KeySource { + return []KeySource{MicrosoftKeyVault} +} + // NetworkRuleIPAction enumerates the values for network rule ip action. type NetworkRuleIPAction string @@ -108,6 +134,14 @@ func PossibleSkuTierValues() []SkuTier { return []SkuTier{SkuTierBasic, SkuTierPremium, SkuTierStandard} } +// Encryption properties to configure Encryption +type Encryption struct { + // KeyVaultProperties - Properties of KeyVault + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + // KeySource - Enumerates the possible value of keySource for Encryption. Possible values include: 'MicrosoftKeyVault' + KeySource KeySource `json:"keySource,omitempty"` +} + // ErrorResponse error response indicates ServiceBus service is not able to process the incoming request. // The reason is provided in the error message. type ErrorResponse struct { @@ -117,6 +151,16 @@ type ErrorResponse struct { Message *string `json:"message,omitempty"` } +// Identity properties to configure Identity for Bring your Own Keys +type Identity struct { + // PrincipalID - ObjectId from the KeyVault + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - TenantId from the KeyVault + TenantID *string `json:"tenantId,omitempty"` + // Type - Enumerates the possible value Identity type, which currently supports only 'SystemAssigned'. Possible values include: 'SystemAssigned' + Type IdentityType `json:"type,omitempty"` +} + // IPFilterRule single item in a List or Get IpFilterRules operation type IPFilterRule struct { autorest.Response `json:"-"` @@ -346,6 +390,14 @@ type IPFilterRuleProperties struct { FilterName *string `json:"filterName,omitempty"` } +// KeyVaultProperties properties to configure keyVault Properties +type KeyVaultProperties struct { + // KeyName - Name of the Key from KeyVault + KeyName *string `json:"keyName,omitempty"` + // KeyVaultURI - Uri of KeyVault + KeyVaultURI *string `json:"keyVaultUri,omitempty"` +} + // NamespacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type NamespacesCreateOrUpdateFuture struct { @@ -973,6 +1025,10 @@ type SBNamespaceProperties struct { MetricID *string `json:"metricId,omitempty"` // ZoneRedundant - Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + // Identity - Properties of BYOK Identity description + Identity *Identity `json:"identity,omitempty"` + // Encryption - Properties of BYOK Encryption description + Encryption *Encryption `json:"encryption,omitempty"` } // SBNamespaceUpdateParameters description of a namespace resource. diff --git a/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/clusters.go b/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/clusters.go index 929e09a004e0..ad582f7b9ca5 100644 --- a/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/clusters.go +++ b/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/clusters.go @@ -45,9 +45,10 @@ func NewClustersClientWithBaseURI(baseURI string) ClustersClient { // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster resource +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier // parameters - the cluster resource. -func (client ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters Cluster) (result ClustersCreateFuture, err error) { +func (client ClustersClient) Create(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string, parameters Cluster) (result ClustersCreateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Create") defer func() { @@ -110,7 +111,7 @@ func (client ClustersClient) Create(ctx context.Context, resourceGroupName strin return result, validation.NewError("servicefabric.ClustersClient", "Create", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, subscriptionID, parameters) + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterName, APIVersion, subscriptionID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Create", nil, "Failure preparing request") return @@ -126,14 +127,13 @@ func (client ClustersClient) Create(ctx context.Context, resourceGroupName strin } // CreatePreparer prepares the Create request. -func (client ClustersClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters Cluster) (*http.Request, error) { +func (client ClustersClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string, parameters Cluster) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,8 +178,9 @@ func (client ClustersClient) CreateResponder(resp *http.Response) (result Cluste // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster resource +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier -func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (result autorest.Response, err error) { +func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Delete") defer func() { @@ -190,7 +191,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, subscriptionID) + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, APIVersion, subscriptionID) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Delete", nil, "Failure preparing request") return @@ -212,14 +213,13 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin } // DeletePreparer prepares the Delete request. -func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (*http.Request, error) { +func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -255,8 +255,9 @@ func (client ClustersClient) DeleteResponder(resp *http.Response) (result autore // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster resource +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier -func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (result Cluster, err error) { +func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string) (result Cluster, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Get") defer func() { @@ -267,7 +268,7 @@ func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, subscriptionID) + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, APIVersion, subscriptionID) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Get", nil, "Failure preparing request") return @@ -289,14 +290,13 @@ func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client ClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (*http.Request, error) { +func (client ClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -331,8 +331,9 @@ func (client ClustersClient) GetResponder(resp *http.Response) (result Cluster, // List list cluster resource // Parameters: +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier -func (client ClustersClient) List(ctx context.Context, subscriptionID string) (result ClusterListResult, err error) { +func (client ClustersClient) List(ctx context.Context, APIVersion string, subscriptionID string) (result ClusterListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.List") defer func() { @@ -343,7 +344,7 @@ func (client ClustersClient) List(ctx context.Context, subscriptionID string) (r tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListPreparer(ctx, subscriptionID) + req, err := client.ListPreparer(ctx, APIVersion, subscriptionID) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "List", nil, "Failure preparing request") return @@ -365,12 +366,11 @@ func (client ClustersClient) List(ctx context.Context, subscriptionID string) (r } // ListPreparer prepares the List request. -func (client ClustersClient) ListPreparer(ctx context.Context, subscriptionID string) (*http.Request, error) { +func (client ClustersClient) ListPreparer(ctx context.Context, APIVersion string, subscriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -406,8 +406,9 @@ func (client ClustersClient) ListResponder(resp *http.Response) (result ClusterL // ListByResourceGroup list cluster resource by resource group // Parameters: // resourceGroupName - the name of the resource group. +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier -func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, subscriptionID string) (result ClusterListResult, err error) { +func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, APIVersion string, subscriptionID string) (result ClusterListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") defer func() { @@ -418,7 +419,7 @@ func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGr tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, subscriptionID) + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, APIVersion, subscriptionID) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") return @@ -440,13 +441,12 @@ func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGr } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, subscriptionID string) (*http.Request, error) { +func (client ClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, APIVersion string, subscriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -483,10 +483,11 @@ func (client ClustersClient) ListByResourceGroupResponder(resp *http.Response) ( // Parameters: // resourceGroupName - the name of the resource group. // clusterName - the name of the cluster resource +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier // parameters - the parameters which contains the property value and property name which used to update the // cluster configuration. -func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters ClusterUpdateParameters) (result ClustersUpdateFuture, err error) { +func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string, parameters ClusterUpdateParameters) (result ClustersUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Update") defer func() { @@ -497,7 +498,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, subscriptionID, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, APIVersion, subscriptionID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClustersClient", "Update", nil, "Failure preparing request") return @@ -513,14 +514,13 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin } // UpdatePreparer prepares the Update request. -func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters ClusterUpdateParameters) (*http.Request, error) { +func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string, parameters ClusterUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/clusterversions.go b/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/clusterversions.go index 894d9a11097f..03d03e36e52e 100644 --- a/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/clusterversions.go +++ b/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/clusterversions.go @@ -43,9 +43,10 @@ func NewClusterVersionsClientWithBaseURI(baseURI string) ClusterVersionsClient { // Get get cluster code versions by location // Parameters: // location - the location for the cluster code versions, this is different from cluster location +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier // clusterVersion - the cluster code version -func (client ClusterVersionsClient) Get(ctx context.Context, location string, subscriptionID string, clusterVersion string) (result ClusterCodeVersionsListResult, err error) { +func (client ClusterVersionsClient) Get(ctx context.Context, location string, APIVersion string, subscriptionID string, clusterVersion string) (result ClusterCodeVersionsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClusterVersionsClient.Get") defer func() { @@ -56,7 +57,7 @@ func (client ClusterVersionsClient) Get(ctx context.Context, location string, su tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, location, subscriptionID, clusterVersion) + req, err := client.GetPreparer(ctx, location, APIVersion, subscriptionID, clusterVersion) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "Get", nil, "Failure preparing request") return @@ -78,14 +79,13 @@ func (client ClusterVersionsClient) Get(ctx context.Context, location string, su } // GetPreparer prepares the Get request. -func (client ClusterVersionsClient) GetPreparer(ctx context.Context, location string, subscriptionID string, clusterVersion string) (*http.Request, error) { +func (client ClusterVersionsClient) GetPreparer(ctx context.Context, location string, APIVersion string, subscriptionID string, clusterVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterVersion": autorest.Encode("path", clusterVersion), "location": autorest.Encode("path", location), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -122,9 +122,10 @@ func (client ClusterVersionsClient) GetResponder(resp *http.Response) (result Cl // Parameters: // location - the location for the cluster code versions, this is different from cluster location // environment - cluster operating system, the default means all +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier // clusterVersion - the cluster code version -func (client ClusterVersionsClient) GetByEnvironment(ctx context.Context, location string, environment string, subscriptionID string, clusterVersion string) (result ClusterCodeVersionsListResult, err error) { +func (client ClusterVersionsClient) GetByEnvironment(ctx context.Context, location string, environment string, APIVersion string, subscriptionID string, clusterVersion string) (result ClusterCodeVersionsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClusterVersionsClient.GetByEnvironment") defer func() { @@ -135,7 +136,7 @@ func (client ClusterVersionsClient) GetByEnvironment(ctx context.Context, locati tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetByEnvironmentPreparer(ctx, location, environment, subscriptionID, clusterVersion) + req, err := client.GetByEnvironmentPreparer(ctx, location, environment, APIVersion, subscriptionID, clusterVersion) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "GetByEnvironment", nil, "Failure preparing request") return @@ -157,7 +158,7 @@ func (client ClusterVersionsClient) GetByEnvironment(ctx context.Context, locati } // GetByEnvironmentPreparer prepares the GetByEnvironment request. -func (client ClusterVersionsClient) GetByEnvironmentPreparer(ctx context.Context, location string, environment string, subscriptionID string, clusterVersion string) (*http.Request, error) { +func (client ClusterVersionsClient) GetByEnvironmentPreparer(ctx context.Context, location string, environment string, APIVersion string, subscriptionID string, clusterVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterVersion": autorest.Encode("path", clusterVersion), "environment": autorest.Encode("path", environment), @@ -165,7 +166,6 @@ func (client ClusterVersionsClient) GetByEnvironmentPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -201,8 +201,9 @@ func (client ClusterVersionsClient) GetByEnvironmentResponder(resp *http.Respons // List list cluster code versions by location // Parameters: // location - the location for the cluster code versions, this is different from cluster location +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier -func (client ClusterVersionsClient) List(ctx context.Context, location string, subscriptionID string) (result ClusterCodeVersionsListResult, err error) { +func (client ClusterVersionsClient) List(ctx context.Context, location string, APIVersion string, subscriptionID string) (result ClusterCodeVersionsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClusterVersionsClient.List") defer func() { @@ -213,7 +214,7 @@ func (client ClusterVersionsClient) List(ctx context.Context, location string, s tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListPreparer(ctx, location, subscriptionID) + req, err := client.ListPreparer(ctx, location, APIVersion, subscriptionID) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "List", nil, "Failure preparing request") return @@ -235,13 +236,12 @@ func (client ClusterVersionsClient) List(ctx context.Context, location string, s } // ListPreparer prepares the List request. -func (client ClusterVersionsClient) ListPreparer(ctx context.Context, location string, subscriptionID string) (*http.Request, error) { +func (client ClusterVersionsClient) ListPreparer(ctx context.Context, location string, APIVersion string, subscriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "location": autorest.Encode("path", location), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -278,8 +278,9 @@ func (client ClusterVersionsClient) ListResponder(resp *http.Response) (result C // Parameters: // location - the location for the cluster code versions, this is different from cluster location // environment - cluster operating system, the default means all +// APIVersion - the version of the API. // subscriptionID - the customer subscription identifier -func (client ClusterVersionsClient) ListByEnvironment(ctx context.Context, location string, environment string, subscriptionID string) (result ClusterCodeVersionsListResult, err error) { +func (client ClusterVersionsClient) ListByEnvironment(ctx context.Context, location string, environment string, APIVersion string, subscriptionID string) (result ClusterCodeVersionsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClusterVersionsClient.ListByEnvironment") defer func() { @@ -290,7 +291,7 @@ func (client ClusterVersionsClient) ListByEnvironment(ctx context.Context, locat tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListByEnvironmentPreparer(ctx, location, environment, subscriptionID) + req, err := client.ListByEnvironmentPreparer(ctx, location, environment, APIVersion, subscriptionID) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.ClusterVersionsClient", "ListByEnvironment", nil, "Failure preparing request") return @@ -312,14 +313,13 @@ func (client ClusterVersionsClient) ListByEnvironment(ctx context.Context, locat } // ListByEnvironmentPreparer prepares the ListByEnvironment request. -func (client ClusterVersionsClient) ListByEnvironmentPreparer(ctx context.Context, location string, environment string, subscriptionID string) (*http.Request, error) { +func (client ClusterVersionsClient) ListByEnvironmentPreparer(ctx context.Context, location string, environment string, APIVersion string, subscriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "environment": autorest.Encode("path", environment), "location": autorest.Encode("path", location), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2017-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/operations.go b/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/operations.go index 3c700ab3382e..c3671febb225 100644 --- a/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/operations.go +++ b/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/operations.go @@ -41,7 +41,9 @@ func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { } // List sends the list request. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { +// Parameters: +// APIVersion - the version of the ServiceFabric resource provider api +func (client OperationsClient) List(ctx context.Context, APIVersion string) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -53,7 +55,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", nil, "Failure preparing request") return @@ -75,8 +77,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2017-07-01-preview" +func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +132,7 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context, APIVersion string) (result OperationListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -142,6 +143,6 @@ func (client OperationsClient) ListComplete(ctx context.Context) (result Operati tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx) + result.page, err = client.List(ctx, APIVersion) return } diff --git a/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/servicefabricapi/interfaces.go b/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/servicefabricapi/interfaces.go index c4bfd581f871..2eb7a1fbed02 100644 --- a/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/servicefabricapi/interfaces.go +++ b/services/preview/servicefabric/mgmt/2017-07-01-preview/servicefabric/servicefabricapi/interfaces.go @@ -25,29 +25,29 @@ import ( // ClustersClientAPI contains the set of methods on the ClustersClient type. type ClustersClientAPI interface { - Create(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters servicefabric.Cluster) (result servicefabric.ClustersCreateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string) (result servicefabric.Cluster, err error) - List(ctx context.Context, subscriptionID string) (result servicefabric.ClusterListResult, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, subscriptionID string) (result servicefabric.ClusterListResult, err error) - Update(ctx context.Context, resourceGroupName string, clusterName string, subscriptionID string, parameters servicefabric.ClusterUpdateParameters) (result servicefabric.ClustersUpdateFuture, err error) + Create(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string, parameters servicefabric.Cluster) (result servicefabric.ClustersCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string) (result servicefabric.Cluster, err error) + List(ctx context.Context, APIVersion string, subscriptionID string) (result servicefabric.ClusterListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, APIVersion string, subscriptionID string) (result servicefabric.ClusterListResult, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, APIVersion string, subscriptionID string, parameters servicefabric.ClusterUpdateParameters) (result servicefabric.ClustersUpdateFuture, err error) } var _ ClustersClientAPI = (*servicefabric.ClustersClient)(nil) // ClusterVersionsClientAPI contains the set of methods on the ClusterVersionsClient type. type ClusterVersionsClientAPI interface { - Get(ctx context.Context, location string, subscriptionID string, clusterVersion string) (result servicefabric.ClusterCodeVersionsListResult, err error) - GetByEnvironment(ctx context.Context, location string, environment string, subscriptionID string, clusterVersion string) (result servicefabric.ClusterCodeVersionsListResult, err error) - List(ctx context.Context, location string, subscriptionID string) (result servicefabric.ClusterCodeVersionsListResult, err error) - ListByEnvironment(ctx context.Context, location string, environment string, subscriptionID string) (result servicefabric.ClusterCodeVersionsListResult, err error) + Get(ctx context.Context, location string, APIVersion string, subscriptionID string, clusterVersion string) (result servicefabric.ClusterCodeVersionsListResult, err error) + GetByEnvironment(ctx context.Context, location string, environment string, APIVersion string, subscriptionID string, clusterVersion string) (result servicefabric.ClusterCodeVersionsListResult, err error) + List(ctx context.Context, location string, APIVersion string, subscriptionID string) (result servicefabric.ClusterCodeVersionsListResult, err error) + ListByEnvironment(ctx context.Context, location string, environment string, APIVersion string, subscriptionID string) (result servicefabric.ClusterCodeVersionsListResult, err error) } var _ ClusterVersionsClientAPI = (*servicefabric.ClusterVersionsClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result servicefabric.OperationListResultPage, err error) + List(ctx context.Context, APIVersion string) (result servicefabric.OperationListResultPage, err error) } var _ OperationsClientAPI = (*servicefabric.OperationsClient)(nil) diff --git a/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/operations.go b/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/operations.go index 212b6ff8ee34..82ccc3f0bf26 100644 --- a/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/operations.go +++ b/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/operations.go @@ -41,7 +41,9 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera } // List get the list of available Service Fabric resource provider API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { +// Parameters: +// APIVersion - the version of the Service Fabric resource provider API +func (client OperationsClient) List(ctx context.Context, APIVersion string) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -53,7 +55,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", nil, "Failure preparing request") return @@ -75,8 +77,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-03-01-preview" +func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +132,7 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context, APIVersion string) (result OperationListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -142,6 +143,6 @@ func (client OperationsClient) ListComplete(ctx context.Context) (result Operati tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx) + result.page, err = client.List(ctx, APIVersion) return } diff --git a/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/servicefabricapi/interfaces.go b/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/servicefabricapi/interfaces.go index 623e813daddf..de94bcef3706 100644 --- a/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/servicefabricapi/interfaces.go +++ b/services/preview/servicefabric/mgmt/2019-03-01-preview/servicefabric/servicefabricapi/interfaces.go @@ -47,7 +47,7 @@ var _ ClusterVersionsClientAPI = (*servicefabric.ClusterVersionsClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result servicefabric.OperationListResultPage, err error) + List(ctx context.Context, APIVersion string) (result servicefabric.OperationListResultPage, err error) } var _ OperationsClientAPI = (*servicefabric.OperationsClient)(nil) diff --git a/services/preview/sql/mgmt/v3.0/sql/capabilities.go b/services/preview/sql/mgmt/v3.0/sql/capabilities.go index 964106affd24..18f2ca74ed1f 100644 --- a/services/preview/sql/mgmt/v3.0/sql/capabilities.go +++ b/services/preview/sql/mgmt/v3.0/sql/capabilities.go @@ -85,7 +85,7 @@ func (client CapabilitiesClient) ListByLocationPreparer(ctx context.Context, loc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01-preview" + const APIVersion = "2018-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v3.0/sql/models.go b/services/preview/sql/mgmt/v3.0/sql/models.go index 07520c189f18..90e639369cd5 100644 --- a/services/preview/sql/mgmt/v3.0/sql/models.go +++ b/services/preview/sql/mgmt/v3.0/sql/models.go @@ -180,13 +180,17 @@ const ( SupportedEditions CapabilityGroup = "supportedEditions" // SupportedElasticPoolEditions ... SupportedElasticPoolEditions CapabilityGroup = "supportedElasticPoolEditions" + // SupportedInstancePoolEditions ... + SupportedInstancePoolEditions CapabilityGroup = "supportedInstancePoolEditions" + // SupportedManagedInstanceEditions ... + SupportedManagedInstanceEditions CapabilityGroup = "supportedManagedInstanceEditions" // SupportedManagedInstanceVersions ... SupportedManagedInstanceVersions CapabilityGroup = "supportedManagedInstanceVersions" ) // PossibleCapabilityGroupValues returns an array of possible values for the CapabilityGroup const type. func PossibleCapabilityGroupValues() []CapabilityGroup { - return []CapabilityGroup{SupportedEditions, SupportedElasticPoolEditions, SupportedManagedInstanceVersions} + return []CapabilityGroup{SupportedEditions, SupportedElasticPoolEditions, SupportedInstancePoolEditions, SupportedManagedInstanceEditions, SupportedManagedInstanceVersions} } // CapabilityStatus enumerates the values for capability status. @@ -898,6 +902,19 @@ func PossibleOperationOriginValues() []OperationOrigin { return []OperationOrigin{OperationOriginSystem, OperationOriginUser} } +// PauseDelayTimeUnit enumerates the values for pause delay time unit. +type PauseDelayTimeUnit string + +const ( + // Minutes ... + Minutes PauseDelayTimeUnit = "Minutes" +) + +// PossiblePauseDelayTimeUnitValues returns an array of possible values for the PauseDelayTimeUnit const type. +func PossiblePauseDelayTimeUnitValues() []PauseDelayTimeUnit { + return []PauseDelayTimeUnit{Minutes} +} + // PerformanceLevelUnit enumerates the values for performance level unit. type PerformanceLevelUnit string @@ -1378,6 +1395,23 @@ func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { return []ServiceObjectiveName{ServiceObjectiveNameBasic, ServiceObjectiveNameDS100, ServiceObjectiveNameDS1000, ServiceObjectiveNameDS1200, ServiceObjectiveNameDS1500, ServiceObjectiveNameDS200, ServiceObjectiveNameDS2000, ServiceObjectiveNameDS300, ServiceObjectiveNameDS400, ServiceObjectiveNameDS500, ServiceObjectiveNameDS600, ServiceObjectiveNameDW100, ServiceObjectiveNameDW1000, ServiceObjectiveNameDW10000c, ServiceObjectiveNameDW1000c, ServiceObjectiveNameDW1200, ServiceObjectiveNameDW1500, ServiceObjectiveNameDW15000c, ServiceObjectiveNameDW1500c, ServiceObjectiveNameDW200, ServiceObjectiveNameDW2000, ServiceObjectiveNameDW2000c, ServiceObjectiveNameDW2500c, ServiceObjectiveNameDW300, ServiceObjectiveNameDW3000, ServiceObjectiveNameDW30000c, ServiceObjectiveNameDW3000c, ServiceObjectiveNameDW400, ServiceObjectiveNameDW500, ServiceObjectiveNameDW5000c, ServiceObjectiveNameDW600, ServiceObjectiveNameDW6000, ServiceObjectiveNameDW6000c, ServiceObjectiveNameDW7500c, ServiceObjectiveNameElasticPool, ServiceObjectiveNameFree, ServiceObjectiveNameP1, ServiceObjectiveNameP11, ServiceObjectiveNameP15, ServiceObjectiveNameP2, ServiceObjectiveNameP3, ServiceObjectiveNameP4, ServiceObjectiveNameP6, ServiceObjectiveNamePRS1, ServiceObjectiveNamePRS2, ServiceObjectiveNamePRS4, ServiceObjectiveNamePRS6, ServiceObjectiveNameS0, ServiceObjectiveNameS1, ServiceObjectiveNameS12, ServiceObjectiveNameS2, ServiceObjectiveNameS3, ServiceObjectiveNameS4, ServiceObjectiveNameS6, ServiceObjectiveNameS7, ServiceObjectiveNameS9, ServiceObjectiveNameSystem, ServiceObjectiveNameSystem0, ServiceObjectiveNameSystem1, ServiceObjectiveNameSystem2, ServiceObjectiveNameSystem2L, ServiceObjectiveNameSystem3, ServiceObjectiveNameSystem3L, ServiceObjectiveNameSystem4, ServiceObjectiveNameSystem4L} } +// StorageAccountType enumerates the values for storage account type. +type StorageAccountType string + +const ( + // GRS ... + GRS StorageAccountType = "GRS" + // LRS ... + LRS StorageAccountType = "LRS" + // ZRS ... + ZRS StorageAccountType = "ZRS" +) + +// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. +func PossibleStorageAccountTypeValues() []StorageAccountType { + return []StorageAccountType{GRS, LRS, ZRS} +} + // StorageKeyType enumerates the values for storage key type. type StorageKeyType string @@ -1897,6 +1931,22 @@ func (atsp AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AutoPauseDelayTimeRange supported auto pause delay time range +type AutoPauseDelayTimeRange struct { + // MinValue - READ-ONLY; Minimum value + MinValue *int32 `json:"minValue,omitempty"` + // MaxValue - READ-ONLY; Maximum value + MaxValue *int32 `json:"maxValue,omitempty"` + // StepSize - READ-ONLY; Step value for discrete values between the minimum value and the maximum value. + StepSize *int32 `json:"stepSize,omitempty"` + // Default - READ-ONLY; Default value is no value is provided + Default *int32 `json:"default,omitempty"` + // Unit - READ-ONLY; Unit of time that delay is expressed in. Possible values include: 'Minutes' + Unit PauseDelayTimeUnit `json:"unit,omitempty"` + // DoNotPauseValue - READ-ONLY; Value that is used to not pause (infinite delay before pause) + DoNotPauseValue *int32 `json:"doNotPauseValue,omitempty"` +} + // BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct { @@ -4507,6 +4557,10 @@ type EditionCapability struct { SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"` // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + // ReadScale - READ-ONLY; The read scale capability for the edition. + ReadScale *ReadScaleCapability `json:"readScale,omitempty"` + // SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition + SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"` // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' Status CapabilityStatus `json:"status,omitempty"` // Reason - The reason for the capability not being available. @@ -5374,6 +5428,8 @@ type ElasticPoolPerformanceLevelCapability struct { SupportedPerDatabaseMaxSizes *[]MaxSizeRangeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"` // SupportedPerDatabaseMaxPerformanceLevels - READ-ONLY; The list of supported per database max performance levels. SupportedPerDatabaseMaxPerformanceLevels *[]ElasticPoolPerDatabaseMaxPerformanceLevelCapability `json:"supportedPerDatabaseMaxPerformanceLevels,omitempty"` + // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the performance level. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' Status CapabilityStatus `json:"status,omitempty"` // Reason - The reason for the capability not being available. @@ -7645,6 +7701,32 @@ func (IP *InstancePool) UnmarshalJSON(body []byte) error { return nil } +// InstancePoolEditionCapability the instance pool capability +type InstancePoolEditionCapability struct { + // Name - READ-ONLY; The instance pool version name. + Name *string `json:"name,omitempty"` + // SupportedFamilies - READ-ONLY; The supported families. + SupportedFamilies *[]InstancePoolFamilyCapability `json:"supportedFamilies,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + +// InstancePoolFamilyCapability the instance pool family capability. +type InstancePoolFamilyCapability struct { + // Name - READ-ONLY; Family name. + Name *string `json:"name,omitempty"` + // SupportedLicenseTypes - READ-ONLY; List of supported license types. + SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"` + // SupportedVcoresValues - READ-ONLY; List of supported virtual cores values. + SupportedVcoresValues *[]InstancePoolVcoresCapability `json:"supportedVcoresValues,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + // InstancePoolListResult a list of Azure SQL instance pools. type InstancePoolListResult struct { autorest.Response `json:"-"` @@ -7897,6 +7979,20 @@ func (ipu InstancePoolUpdate) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// InstancePoolVcoresCapability the managed instance virtual cores capability. +type InstancePoolVcoresCapability struct { + // Name - READ-ONLY; The virtual cores identifier. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; The virtual cores value. + Value *int32 `json:"value,omitempty"` + // StorageLimit - READ-ONLY; Storage limit. + StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + // Job a job. type Job struct { autorest.Response `json:"-"` @@ -11996,10 +12092,6 @@ type ManagedInstanceFamilyCapability struct { SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"` // SupportedVcoresValues - READ-ONLY; List of supported virtual cores values. SupportedVcoresValues *[]ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty"` - // IncludedMaxSize - READ-ONLY; Included size. - IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` - // SupportedStorageSizes - READ-ONLY; Storage size ranges. - SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"` // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' Status CapabilityStatus `json:"status,omitempty"` // Reason - The reason for the capability not being available. @@ -12680,6 +12772,14 @@ type ManagedInstanceVcoresCapability struct { Name *string `json:"name,omitempty"` // Value - READ-ONLY; The virtual cores value. Value *int32 `json:"value,omitempty"` + // IncludedMaxSize - READ-ONLY; Included size. + IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` + // SupportedStorageSizes - READ-ONLY; Storage size ranges. + SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"` + // InstancePoolSupported - READ-ONLY; True if this service objective is supported for managed instances in an instance pool. + InstancePoolSupported *bool `json:"instancePoolSupported,omitempty"` + // StandaloneSupported - READ-ONLY; True if this service objective is supported for standalone managed instances. + StandaloneSupported *bool `json:"standaloneSupported,omitempty"` // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' Status CapabilityStatus `json:"status,omitempty"` // Reason - The reason for the capability not being available. @@ -12692,6 +12792,8 @@ type ManagedInstanceVersionCapability struct { Name *string `json:"name,omitempty"` // SupportedEditions - READ-ONLY; The list of supported managed instance editions. SupportedEditions *[]ManagedInstanceEditionCapability `json:"supportedEditions,omitempty"` + // SupportedInstancePoolEditions - READ-ONLY; The list of supported instance pool editions. + SupportedInstancePoolEditions *[]InstancePoolEditionCapability `json:"supportedInstancePoolEditions,omitempty"` // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' Status CapabilityStatus `json:"status,omitempty"` // Reason - The reason for the capability not being available. @@ -13341,6 +13443,16 @@ type MetricValue struct { Total *float64 `json:"total,omitempty"` } +// MinCapacityCapability the min capacity capability +type MinCapacityCapability struct { + // Value - READ-ONLY; Min capacity value + Value *float64 `json:"value,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + // Name ARM Usage Name type Name struct { // Value - Usage name value @@ -14039,6 +14151,16 @@ type ProxyResource struct { Type *string `json:"type,omitempty"` } +// ReadScaleCapability the read scale capability. +type ReadScaleCapability struct { + // MaxNumberOfReplicas - READ-ONLY; The maximum number of read scale replicas. + MaxNumberOfReplicas *int32 `json:"maxNumberOfReplicas,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + // RecommendedElasticPool represents a recommended elastic pool. type RecommendedElasticPool struct { autorest.Response `json:"-"` @@ -17798,6 +17920,14 @@ type ServiceObjectiveCapability struct { SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"` // IncludedMaxSize - READ-ONLY; The included (free) max size. IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"` + // ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the service objective. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + // SupportedAutoPauseDelay - READ-ONLY; Supported time range for auto pause delay + SupportedAutoPauseDelay *AutoPauseDelayTimeRange `json:"supportedAutoPauseDelay,omitempty"` + // SupportedMinCapacities - READ-ONLY; List of supported min capacities + SupportedMinCapacities *[]MinCapacityCapability `json:"supportedMinCapacities,omitempty"` + // ComputeModel - READ-ONLY; The compute model + ComputeModel *string `json:"computeModel,omitempty"` // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' Status CapabilityStatus `json:"status,omitempty"` // Reason - The reason for the capability not being available. @@ -17968,6 +18098,16 @@ type SloUsageMetric struct { InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"` } +// StorageCapability the storage account type capability. +type StorageCapability struct { + // StorageAccountType - READ-ONLY; The storage account type for the database's backups. Possible values include: 'GRS', 'LRS', 'ZRS' + StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + // Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled' + Status CapabilityStatus `json:"status,omitempty"` + // Reason - The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` +} + // SubscriptionUsage usage Metric of a Subscription in a Location. type SubscriptionUsage struct { autorest.Response `json:"-"` diff --git a/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go index 1b844ab2f946..16571c46a476 100644 --- a/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go @@ -640,13 +640,6 @@ type ElasticPoolOperationsClientAPI interface { var _ ElasticPoolOperationsClientAPI = (*sql.ElasticPoolOperationsClient)(nil) -// CapabilitiesClientAPI contains the set of methods on the CapabilitiesClient type. -type CapabilitiesClientAPI interface { - ListByLocation(ctx context.Context, locationName string, include sql.CapabilityGroup) (result sql.LocationCapabilities, err error) -} - -var _ CapabilitiesClientAPI = (*sql.CapabilitiesClient)(nil) - // DatabaseVulnerabilityAssessmentScansClientAPI contains the set of methods on the DatabaseVulnerabilityAssessmentScansClient type. type DatabaseVulnerabilityAssessmentScansClientAPI interface { Export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, scanID string) (result sql.DatabaseVulnerabilityAssessmentScansExport, err error) @@ -862,6 +855,13 @@ type ServerAzureADAdministratorsClientAPI interface { var _ ServerAzureADAdministratorsClientAPI = (*sql.ServerAzureADAdministratorsClient)(nil) +// CapabilitiesClientAPI contains the set of methods on the CapabilitiesClient type. +type CapabilitiesClientAPI interface { + ListByLocation(ctx context.Context, locationName string, include sql.CapabilityGroup) (result sql.LocationCapabilities, err error) +} + +var _ CapabilitiesClientAPI = (*sql.CapabilitiesClient)(nil) + // WorkloadGroupsClientAPI contains the set of methods on the WorkloadGroupsClient type. type WorkloadGroupsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, parameters sql.WorkloadGroup) (result sql.WorkloadGroupsCreateOrUpdateFuture, err error) diff --git a/services/preview/windowsesu/2019-09-16-preview/windowsesu/client.go b/services/preview/windowsesu/2019-09-16-preview/windowsesu/client.go new file mode 100644 index 000000000000..a905cd7e3db0 --- /dev/null +++ b/services/preview/windowsesu/2019-09-16-preview/windowsesu/client.go @@ -0,0 +1,51 @@ +// Package windowsesu implements the Azure ARM Windowsesu service API version 2019-09-16-preview. +// +// Manage Multi-Access Keys (MAK) that enable Windows Extended Security Updates (ESU). +package windowsesu + +// 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 Windowsesu + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Windowsesu. +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/preview/windowsesu/2019-09-16-preview/windowsesu/models.go b/services/preview/windowsesu/2019-09-16-preview/windowsesu/models.go new file mode 100644 index 000000000000..9e9cd6b0759f --- /dev/null +++ b/services/preview/windowsesu/2019-09-16-preview/windowsesu/models.go @@ -0,0 +1,632 @@ +package windowsesu + +// 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/windowsesu/2019-09-16-preview/windowsesu" + +// OsType enumerates the values for os type. +type OsType string + +const ( + // Windows7 ... + Windows7 OsType = "Windows7" + // WindowsServer2008 ... + WindowsServer2008 OsType = "WindowsServer2008" + // WindowsServer2008R2 ... + WindowsServer2008R2 OsType = "WindowsServer2008R2" +) + +// PossibleOsTypeValues returns an array of possible values for the OsType const type. +func PossibleOsTypeValues() []OsType { + return []OsType{Windows7, WindowsServer2008, WindowsServer2008R2} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Accepted ... + Accepted ProvisioningState = "Accepted" + // Canceled ... + Canceled ProvisioningState = "Canceled" + // Failed ... + Failed ProvisioningState = "Failed" + // Provisioning ... + Provisioning ProvisioningState = "Provisioning" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Accepted, Canceled, Failed, Provisioning, Succeeded} +} + +// SupportType enumerates the values for support type. +type SupportType string + +const ( + // PremiumAssurance ... + PremiumAssurance SupportType = "PremiumAssurance" + // SupplementalServicing ... + SupplementalServicing SupportType = "SupplementalServicing" +) + +// PossibleSupportTypeValues returns an array of possible values for the SupportType const type. +func PossibleSupportTypeValues() []SupportType { + return []SupportType{PremiumAssurance, SupplementalServicing} +} + +// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// ErrorDefinition error definition. +type ErrorDefinition struct { + // Code - READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Description of the error. + Message *string `json:"message,omitempty"` + // Details - READ-ONLY; Internal error details. + Details *[]ErrorDefinition `json:"details,omitempty"` +} + +// ErrorResponse error response. +type ErrorResponse struct { + // Error - The error details. + Error *ErrorDefinition `json:"error,omitempty"` +} + +// MultipleActivationKey MAK key details. +type MultipleActivationKey struct { + autorest.Response `json:"-"` + // MultipleActivationKeyProperties - MAK key specific properties. + *MultipleActivationKeyProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MultipleActivationKey. +func (mak MultipleActivationKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mak.MultipleActivationKeyProperties != nil { + objectMap["properties"] = mak.MultipleActivationKeyProperties + } + if mak.Tags != nil { + objectMap["tags"] = mak.Tags + } + if mak.Location != nil { + objectMap["location"] = mak.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MultipleActivationKey struct. +func (mak *MultipleActivationKey) 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 multipleActivationKeyProperties MultipleActivationKeyProperties + err = json.Unmarshal(*v, &multipleActivationKeyProperties) + if err != nil { + return err + } + mak.MultipleActivationKeyProperties = &multipleActivationKeyProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mak.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mak.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mak.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mak.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mak.Type = &typeVar + } + } + } + + return nil +} + +// MultipleActivationKeyList list of MAK keys. +type MultipleActivationKeyList struct { + autorest.Response `json:"-"` + // Value - List of MAK keys. + Value *[]MultipleActivationKey `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MultipleActivationKeyListIterator provides access to a complete listing of MultipleActivationKey values. +type MultipleActivationKeyListIterator struct { + i int + page MultipleActivationKeyListPage +} + +// 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 *MultipleActivationKeyListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeyListIterator.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 *MultipleActivationKeyListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MultipleActivationKeyListIterator) 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 MultipleActivationKeyListIterator) Response() MultipleActivationKeyList { + 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 MultipleActivationKeyListIterator) Value() MultipleActivationKey { + if !iter.page.NotDone() { + return MultipleActivationKey{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MultipleActivationKeyListIterator type. +func NewMultipleActivationKeyListIterator(page MultipleActivationKeyListPage) MultipleActivationKeyListIterator { + return MultipleActivationKeyListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (makl MultipleActivationKeyList) IsEmpty() bool { + return makl.Value == nil || len(*makl.Value) == 0 +} + +// multipleActivationKeyListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (makl MultipleActivationKeyList) multipleActivationKeyListPreparer(ctx context.Context) (*http.Request, error) { + if makl.NextLink == nil || len(to.String(makl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(makl.NextLink))) +} + +// MultipleActivationKeyListPage contains a page of MultipleActivationKey values. +type MultipleActivationKeyListPage struct { + fn func(context.Context, MultipleActivationKeyList) (MultipleActivationKeyList, error) + makl MultipleActivationKeyList +} + +// 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 *MultipleActivationKeyListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeyListPage.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.makl) + if err != nil { + return err + } + page.makl = 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 *MultipleActivationKeyListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MultipleActivationKeyListPage) NotDone() bool { + return !page.makl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MultipleActivationKeyListPage) Response() MultipleActivationKeyList { + return page.makl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MultipleActivationKeyListPage) Values() []MultipleActivationKey { + if page.makl.IsEmpty() { + return nil + } + return *page.makl.Value +} + +// Creates a new instance of the MultipleActivationKeyListPage type. +func NewMultipleActivationKeyListPage(getNextPage func(context.Context, MultipleActivationKeyList) (MultipleActivationKeyList, error)) MultipleActivationKeyListPage { + return MultipleActivationKeyListPage{fn: getNextPage} +} + +// MultipleActivationKeyProperties MAK key specific properties. +type MultipleActivationKeyProperties struct { + // MultipleActivationKey - READ-ONLY; MAK 5x5 key. + MultipleActivationKey *string `json:"multipleActivationKey,omitempty"` + // ExpirationDate - READ-ONLY; End of support of security updates activated by the MAK key. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // OsType - Type of OS for which the key is requested. Possible values include: 'Windows7', 'WindowsServer2008', 'WindowsServer2008R2' + OsType OsType `json:"osType,omitempty"` + // SupportType - Type of support. Possible values include: 'SupplementalServicing', 'PremiumAssurance' + SupportType SupportType `json:"supportType,omitempty"` + // InstalledServerNumber - Number of activations/servers using the MAK key. + InstalledServerNumber *int32 `json:"installedServerNumber,omitempty"` + // AgreementNumber - Agreement number under which the key is requested. + AgreementNumber *string `json:"agreementNumber,omitempty"` + // IsEligible - true if user has eligible on-premises Windows physical or virtual machines, and that the requested key will only be used in their organization; false otherwise. + IsEligible *bool `json:"isEligible,omitempty"` + // ProvisioningState - READ-ONLY; Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Accepted', 'Provisioning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MultipleActivationKeysCreateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type MultipleActivationKeysCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MultipleActivationKeysCreateFuture) Result(client MultipleActivationKeysClient) (mak MultipleActivationKey, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("windowsesu.MultipleActivationKeysCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mak.Response.Response, err = future.GetResult(sender); err == nil && mak.Response.Response.StatusCode != http.StatusNoContent { + mak, err = client.CreateResponder(mak.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysCreateFuture", "Result", mak.Response.Response, "Failure responding to request") + } + } + return +} + +// MultipleActivationKeyUpdate MAK key details. +type MultipleActivationKeyUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for MultipleActivationKeyUpdate. +func (maku MultipleActivationKeyUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if maku.Tags != nil { + objectMap["tags"] = maku.Tags + } + return json.Marshal(objectMap) +} + +// Operation REST API operation details. +type Operation struct { + // Name - READ-ONLY; Name of the operation. + Name *string `json:"name,omitempty"` + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay meta data about operation used for display in portal. +type OperationDisplay struct { + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` + Operation *string `json:"operation,omitempty"` + Description *string `json:"description,omitempty"` +} + +// OperationList list of available REST API operations. +type OperationList struct { + autorest.Response `json:"-"` + // Value - List of operations. + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListIterator provides access to a complete listing of Operation values. +type OperationListIterator struct { + i int + page OperationListPage +} + +// 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 *OperationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.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 *OperationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListIterator) 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 OperationListIterator) Response() OperationList { + 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 OperationListIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListIterator type. +func NewOperationListIterator(page OperationListPage) OperationListIterator { + return OperationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ol OperationList) IsEmpty() bool { + return ol.Value == nil || len(*ol.Value) == 0 +} + +// operationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ol OperationList) operationListPreparer(ctx context.Context) (*http.Request, error) { + if ol.NextLink == nil || len(to.String(ol.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ol.NextLink))) +} + +// OperationListPage contains a page of Operation values. +type OperationListPage struct { + fn func(context.Context, OperationList) (OperationList, error) + ol OperationList +} + +// 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 *OperationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.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.ol) + if err != nil { + return err + } + page.ol = 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 *OperationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListPage) NotDone() bool { + return !page.ol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListPage) Response() OperationList { + return page.ol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListPage) Values() []Operation { + if page.ol.IsEmpty() { + return nil + } + return *page.ol.Value +} + +// Creates a new instance of the OperationListPage type. +func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { + return OperationListPage{fn: getNextPage} +} + +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// Resource ... +type Resource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} diff --git a/services/preview/windowsesu/2019-09-16-preview/windowsesu/multipleactivationkeys.go b/services/preview/windowsesu/2019-09-16-preview/windowsesu/multipleactivationkeys.go new file mode 100644 index 000000000000..d1101144dac4 --- /dev/null +++ b/services/preview/windowsesu/2019-09-16-preview/windowsesu/multipleactivationkeys.go @@ -0,0 +1,642 @@ +package windowsesu + +// 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" +) + +// MultipleActivationKeysClient is the manage Multi-Access Keys (MAK) that enable Windows Extended Security Updates +// (ESU). +type MultipleActivationKeysClient struct { + BaseClient +} + +// NewMultipleActivationKeysClient creates an instance of the MultipleActivationKeysClient client. +func NewMultipleActivationKeysClient(subscriptionID string) MultipleActivationKeysClient { + return NewMultipleActivationKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMultipleActivationKeysClientWithBaseURI creates an instance of the MultipleActivationKeysClient client. +func NewMultipleActivationKeysClientWithBaseURI(baseURI string, subscriptionID string) MultipleActivationKeysClient { + return MultipleActivationKeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a MAK key. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// multipleActivationKeyName - the name of the MAK key. +// multipleActivationKey - details of the MAK key. +func (client MultipleActivationKeysClient) Create(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, multipleActivationKey MultipleActivationKey) (result MultipleActivationKeysCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeysClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: multipleActivationKey, + Constraints: []validation.Constraint{{Target: "multipleActivationKey.MultipleActivationKeyProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "multipleActivationKey.MultipleActivationKeyProperties.InstalledServerNumber", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "multipleActivationKey.MultipleActivationKeyProperties.InstalledServerNumber", Name: validation.InclusiveMaximum, Rule: int64(5000), Chain: nil}, + {Target: "multipleActivationKey.MultipleActivationKeyProperties.InstalledServerNumber", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("windowsesu.MultipleActivationKeysClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, multipleActivationKeyName, multipleActivationKey) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client MultipleActivationKeysClient) CreatePreparer(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, multipleActivationKey MultipleActivationKey) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "multipleActivationKeyName": autorest.Encode("path", multipleActivationKeyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16-preview" + 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.WindowsESU/multipleActivationKeys/{multipleActivationKeyName}", pathParameters), + autorest.WithJSON(multipleActivationKey), + 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 MultipleActivationKeysClient) CreateSender(req *http.Request) (future MultipleActivationKeysCreateFuture, 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 +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client MultipleActivationKeysClient) CreateResponder(resp *http.Response) (result MultipleActivationKey, 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 delete a MAK key. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// multipleActivationKeyName - the name of the MAK key. +func (client MultipleActivationKeysClient) Delete(ctx context.Context, resourceGroupName string, multipleActivationKeyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeysClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("windowsesu.MultipleActivationKeysClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, multipleActivationKeyName) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MultipleActivationKeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, multipleActivationKeyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "multipleActivationKeyName": autorest.Encode("path", multipleActivationKeyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.WindowsESU/multipleActivationKeys/{multipleActivationKeyName}", 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 MultipleActivationKeysClient) 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 MultipleActivationKeysClient) 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 get a MAK key. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// multipleActivationKeyName - the name of the MAK key. +func (client MultipleActivationKeysClient) Get(ctx context.Context, resourceGroupName string, multipleActivationKeyName string) (result MultipleActivationKey, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeysClient.Get") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("windowsesu.MultipleActivationKeysClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, multipleActivationKeyName) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MultipleActivationKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, multipleActivationKeyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "multipleActivationKeyName": autorest.Encode("path", multipleActivationKeyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.WindowsESU/multipleActivationKeys/{multipleActivationKeyName}", 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 MultipleActivationKeysClient) 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 MultipleActivationKeysClient) GetResponder(resp *http.Response) (result MultipleActivationKey, 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 list all Multiple Activation Keys (MAK) created for a subscription. +func (client MultipleActivationKeysClient) List(ctx context.Context) (result MultipleActivationKeyListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeysClient.List") + defer func() { + sc := -1 + if result.makl.Response.Response != nil { + sc = result.makl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("windowsesu.MultipleActivationKeysClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.makl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "List", resp, "Failure sending request") + return + } + + result.makl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client MultipleActivationKeysClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.WindowsESU/multipleActivationKeys", 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 MultipleActivationKeysClient) 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 MultipleActivationKeysClient) ListResponder(resp *http.Response) (result MultipleActivationKeyList, 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 MultipleActivationKeysClient) listNextResults(ctx context.Context, lastResults MultipleActivationKeyList) (result MultipleActivationKeyList, err error) { + req, err := lastResults.multipleActivationKeyListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "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, "windowsesu.MultipleActivationKeysClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client MultipleActivationKeysClient) ListComplete(ctx context.Context) (result MultipleActivationKeyListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeysClient.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 list all Multiple Activation Keys (MAK) in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client MultipleActivationKeysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result MultipleActivationKeyListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeysClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.makl.Response.Response != nil { + sc = result.makl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("windowsesu.MultipleActivationKeysClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.makl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.makl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client MultipleActivationKeysClient) 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-09-16-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.WindowsESU/multipleActivationKeys", 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 MultipleActivationKeysClient) 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 MultipleActivationKeysClient) ListByResourceGroupResponder(resp *http.Response) (result MultipleActivationKeyList, 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 MultipleActivationKeysClient) listByResourceGroupNextResults(ctx context.Context, lastResults MultipleActivationKeyList) (result MultipleActivationKeyList, err error) { + req, err := lastResults.multipleActivationKeyListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "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, "windowsesu.MultipleActivationKeysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client MultipleActivationKeysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result MultipleActivationKeyListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeysClient.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 +} + +// Update update a MAK key. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// multipleActivationKeyName - the name of the MAK key. +// multipleActivationKey - details of the MAK key. +func (client MultipleActivationKeysClient) Update(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, multipleActivationKey MultipleActivationKeyUpdate) (result MultipleActivationKey, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MultipleActivationKeysClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {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: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("windowsesu.MultipleActivationKeysClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, multipleActivationKeyName, multipleActivationKey) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.MultipleActivationKeysClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client MultipleActivationKeysClient) UpdatePreparer(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, multipleActivationKey MultipleActivationKeyUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "multipleActivationKeyName": autorest.Encode("path", multipleActivationKeyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16-preview" + 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.WindowsESU/multipleActivationKeys/{multipleActivationKeyName}", pathParameters), + autorest.WithJSON(multipleActivationKey), + 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 MultipleActivationKeysClient) 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 MultipleActivationKeysClient) UpdateResponder(resp *http.Response) (result MultipleActivationKey, 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/windowsesu/2019-09-16-preview/windowsesu/operations.go b/services/preview/windowsesu/2019-09-16-preview/windowsesu/operations.go new file mode 100644 index 000000000000..1232a45422b1 --- /dev/null +++ b/services/preview/windowsesu/2019-09-16-preview/windowsesu/operations.go @@ -0,0 +1,147 @@ +package windowsesu + +// 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 manage Multi-Access Keys (MAK) that enable Windows Extended Security Updates (ESU). +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 list all available Windows.ESU provider operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.ol.Response.Response != nil { + sc = result.ol.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "windowsesu.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.ol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.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-09-16-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.WindowsESU/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 OperationList, 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 OperationList) (result OperationList, err error) { + req, err := lastResults.operationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "windowsesu.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, "windowsesu.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "windowsesu.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 OperationListIterator, 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/windowsesu/2019-09-16-preview/windowsesu/version.go b/services/preview/windowsesu/2019-09-16-preview/windowsesu/version.go new file mode 100644 index 000000000000..7c171c13f62a --- /dev/null +++ b/services/preview/windowsesu/2019-09-16-preview/windowsesu/version.go @@ -0,0 +1,30 @@ +package windowsesu + +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 + " windowsesu/2019-09-16-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/windowsesu/2019-09-16-preview/windowsesu/windowsesuapi/interfaces.go b/services/preview/windowsesu/2019-09-16-preview/windowsesu/windowsesuapi/interfaces.go new file mode 100644 index 000000000000..d8a8c39b99c6 --- /dev/null +++ b/services/preview/windowsesu/2019-09-16-preview/windowsesu/windowsesuapi/interfaces.go @@ -0,0 +1,43 @@ +package windowsesuapi + +// 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/windowsesu/2019-09-16-preview/windowsesu" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result windowsesu.OperationListPage, err error) +} + +var _ OperationsClientAPI = (*windowsesu.OperationsClient)(nil) + +// MultipleActivationKeysClientAPI contains the set of methods on the MultipleActivationKeysClient type. +type MultipleActivationKeysClientAPI interface { + Create(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, multipleActivationKey windowsesu.MultipleActivationKey) (result windowsesu.MultipleActivationKeysCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, multipleActivationKeyName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, multipleActivationKeyName string) (result windowsesu.MultipleActivationKey, err error) + List(ctx context.Context) (result windowsesu.MultipleActivationKeyListPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result windowsesu.MultipleActivationKeyListPage, err error) + Update(ctx context.Context, resourceGroupName string, multipleActivationKeyName string, multipleActivationKey windowsesu.MultipleActivationKeyUpdate) (result windowsesu.MultipleActivationKey, err error) +} + +var _ MultipleActivationKeysClientAPI = (*windowsesu.MultipleActivationKeysClient)(nil) diff --git a/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go b/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go index 9231fa88d117..265bfd6726c3 100644 --- a/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go +++ b/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go @@ -2021,6 +2021,8 @@ type A2AProtectedManagedDiskDetails struct { RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` // DiskName - The disk name. DiskName *string `json:"diskName,omitempty"` // DiskCapacityInBytes - The disk capacity in bytes. @@ -2719,6 +2721,8 @@ type A2AVMManagedDiskInputDetails struct { RecoveryReplicaDiskAccountType *string `json:"recoveryReplicaDiskAccountType,omitempty"` // RecoveryTargetDiskAccountType - The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. RecoveryTargetDiskAccountType *string `json:"recoveryTargetDiskAccountType,omitempty"` + // RecoveryDiskEncryptionSetID - The recovery disk encryption set Id. + RecoveryDiskEncryptionSetID *string `json:"recoveryDiskEncryptionSetId,omitempty"` // DiskEncryptionInfo - The recovery disk encryption information (for one / single pass flows). DiskEncryptionInfo *DiskEncryptionInfo `json:"diskEncryptionInfo,omitempty"` } @@ -3779,6 +3783,8 @@ type AzureVMDiskDetails struct { VhdType *string `json:"vhdType,omitempty"` // VhdID - The VHD id. VhdID *string `json:"vhdId,omitempty"` + // DiskID - The disk resource id. + DiskID *string `json:"diskId,omitempty"` // VhdName - VHD name. VhdName *string `json:"vhdName,omitempty"` // MaxSizeMB - Max side in MB. @@ -3789,6 +3795,8 @@ type AzureVMDiskDetails struct { TargetDiskName *string `json:"targetDiskName,omitempty"` // LunID - Ordinal\LunId of the disk for the Azure VM. LunID *string `json:"lunId,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` } // ComputeSizeErrorDetails represents the error used to indicate why the target compute size is not @@ -7306,6 +7314,8 @@ type HyperVReplicaAzureUpdateReplicationProtectedItemInput struct { RecoveryAzureV2ResourceGroupID *string `json:"recoveryAzureV2ResourceGroupId,omitempty"` // UseManagedDisks - A value indicating whether managed disks should be used during failover. UseManagedDisks *string `json:"useManagedDisks,omitempty"` + // DiskIDToDiskEncryptionMap - The dictionary of disk resource Id to disk encryption set ARM Id. + DiskIDToDiskEncryptionMap map[string]*string `json:"diskIdToDiskEncryptionMap"` // InstanceType - Possible values include: 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeUpdateReplicationProtectedItemProviderInput', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeA2A', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicUpdateReplicationProtectedItemProviderInputInstanceTypeInMageAzureV2' InstanceType InstanceTypeBasicUpdateReplicationProtectedItemProviderInput `json:"instanceType,omitempty"` } @@ -7323,6 +7333,9 @@ func (hvraurpii HyperVReplicaAzureUpdateReplicationProtectedItemInput) MarshalJS if hvraurpii.UseManagedDisks != nil { objectMap["useManagedDisks"] = hvraurpii.UseManagedDisks } + if hvraurpii.DiskIDToDiskEncryptionMap != nil { + objectMap["diskIdToDiskEncryptionMap"] = hvraurpii.DiskIDToDiskEncryptionMap + } if hvraurpii.InstanceType != "" { objectMap["instanceType"] = hvraurpii.InstanceType } @@ -8638,6 +8651,8 @@ type InMageAzureV2DiskInputDetails struct { LogStorageAccountID *string `json:"logStorageAccountId,omitempty"` // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` } // InMageAzureV2EnableProtectionInput vMware Azure specific enable protection input. @@ -8672,6 +8687,8 @@ type InMageAzureV2EnableProtectionInput struct { TargetAzureV2ResourceGroupID *string `json:"targetAzureV2ResourceGroupId,omitempty"` // DiskType - The DiskType. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS' DiskType DiskAccountType `json:"diskType,omitempty"` + // DiskEncryptionSetID - The DiskEncryptionSet ARM ID. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` // InstanceType - Possible values include: 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeEnableProtectionProviderSpecificInput', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeA2A', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeHyperVReplicaAzure', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMageAzureV2', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeInMage', 'InstanceTypeBasicEnableProtectionProviderSpecificInputInstanceTypeSan' InstanceType InstanceTypeBasicEnableProtectionProviderSpecificInput `json:"instanceType,omitempty"` } @@ -8725,6 +8742,9 @@ func (imavepi InMageAzureV2EnableProtectionInput) MarshalJSON() ([]byte, error) if imavepi.DiskType != "" { objectMap["diskType"] = imavepi.DiskType } + if imavepi.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetId"] = imavepi.DiskEncryptionSetID + } if imavepi.InstanceType != "" { objectMap["instanceType"] = imavepi.InstanceType } diff --git a/services/resourcehealth/mgmt/2017-07-01/resourcehealth/emergingissues.go b/services/resourcehealth/mgmt/2017-07-01/resourcehealth/emergingissues.go new file mode 100644 index 000000000000..74e6ac8f1475 --- /dev/null +++ b/services/resourcehealth/mgmt/2017-07-01/resourcehealth/emergingissues.go @@ -0,0 +1,219 @@ +package resourcehealth + +// 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" +) + +// EmergingIssuesClient is the the Resource Health Client. +type EmergingIssuesClient struct { + BaseClient +} + +// NewEmergingIssuesClient creates an instance of the EmergingIssuesClient client. +func NewEmergingIssuesClient(subscriptionID string) EmergingIssuesClient { + return NewEmergingIssuesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewEmergingIssuesClientWithBaseURI creates an instance of the EmergingIssuesClient client. +func NewEmergingIssuesClientWithBaseURI(baseURI string, subscriptionID string) EmergingIssuesClient { + return EmergingIssuesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets Azure services' emerging issues. +func (client EmergingIssuesClient) Get(ctx context.Context) (result EmergingIssuesGetResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EmergingIssuesClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "resourcehealth.EmergingIssuesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "resourcehealth.EmergingIssuesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resourcehealth.EmergingIssuesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client EmergingIssuesClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "issueName": autorest.Encode("path", "default"), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}", 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 EmergingIssuesClient) 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 EmergingIssuesClient) GetResponder(resp *http.Response) (result EmergingIssuesGetResult, 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 Azure services' emerging issues. +func (client EmergingIssuesClient) List(ctx context.Context) (result EmergingIssueListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EmergingIssuesClient.List") + defer func() { + sc := -1 + if result.eilr.Response.Response != nil { + sc = result.eilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "resourcehealth.EmergingIssuesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.eilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "resourcehealth.EmergingIssuesClient", "List", resp, "Failure sending request") + return + } + + result.eilr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resourcehealth.EmergingIssuesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client EmergingIssuesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ResourceHealth/emergingIssues"), + 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 EmergingIssuesClient) 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 EmergingIssuesClient) ListResponder(resp *http.Response) (result EmergingIssueListResult, 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 EmergingIssuesClient) listNextResults(ctx context.Context, lastResults EmergingIssueListResult) (result EmergingIssueListResult, err error) { + req, err := lastResults.emergingIssueListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "resourcehealth.EmergingIssuesClient", "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, "resourcehealth.EmergingIssuesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "resourcehealth.EmergingIssuesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client EmergingIssuesClient) ListComplete(ctx context.Context) (result EmergingIssueListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EmergingIssuesClient.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/resourcehealth/mgmt/2017-07-01/resourcehealth/models.go b/services/resourcehealth/mgmt/2017-07-01/resourcehealth/models.go index a90272587b18..61c6d463c45f 100644 --- a/services/resourcehealth/mgmt/2017-07-01/resourcehealth/models.go +++ b/services/resourcehealth/mgmt/2017-07-01/resourcehealth/models.go @@ -19,6 +19,7 @@ package resourcehealth import ( "context" + "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" @@ -61,6 +62,40 @@ func PossibleReasonChronicityTypesValues() []ReasonChronicityTypes { return []ReasonChronicityTypes{Persistent, Transient} } +// SeverityValues enumerates the values for severity values. +type SeverityValues string + +const ( + // Error ... + Error SeverityValues = "Error" + // Information ... + Information SeverityValues = "Information" + // Warning ... + Warning SeverityValues = "Warning" +) + +// PossibleSeverityValuesValues returns an array of possible values for the SeverityValues const type. +func PossibleSeverityValuesValues() []SeverityValues { + return []SeverityValues{Error, Information, Warning} +} + +// StageValues enumerates the values for stage values. +type StageValues string + +const ( + // Active ... + Active StageValues = "Active" + // Archived ... + Archived StageValues = "Archived" + // Resolve ... + Resolve StageValues = "Resolve" +) + +// PossibleStageValuesValues returns an array of possible values for the StageValues const type. +func PossibleStageValuesValues() []StageValues { + return []StageValues{Active, Archived, Resolve} +} + // AvailabilityStatus availabilityStatus of a resource. type AvailabilityStatus struct { autorest.Response `json:"-"` @@ -269,6 +304,257 @@ type AvailabilityStatusPropertiesRecentlyResolvedState struct { UnavailabilitySummary *string `json:"unavailabilitySummary,omitempty"` } +// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// EmergingIssue on-going emerging issue from azure status. +type EmergingIssue struct { + // RefreshTimestamp - Timestamp for when last time refreshed for ongoing emerging issue. + RefreshTimestamp *date.Time `json:"refreshTimestamp,omitempty"` + // StatusBanners - The list of emerging issues of banner type. + StatusBanners *[]StatusBanner `json:"statusBanners,omitempty"` + // StatusActiveEvents - The list of emerging issues of active event type. + StatusActiveEvents *[]StatusActiveEvent `json:"statusActiveEvents,omitempty"` +} + +// EmergingIssueImpact object of the emerging issue impact on services and regions. +type EmergingIssueImpact struct { + // ID - The impacted service id. + ID *string `json:"id,omitempty"` + // Name - The impacted service name. + Name *string `json:"name,omitempty"` + // Regions - The list of impacted regions for corresponding emerging issues. + Regions *[]ImpactedRegion `json:"regions,omitempty"` +} + +// EmergingIssueListResult the list of emerging issues. +type EmergingIssueListResult struct { + autorest.Response `json:"-"` + // Value - The list of emerging issues. + Value *[]EmergingIssuesGetResult `json:"value,omitempty"` + // NextLink - The link used to get the next page of emerging issues. + NextLink *string `json:"nextLink,omitempty"` +} + +// EmergingIssueListResultIterator provides access to a complete listing of EmergingIssuesGetResult values. +type EmergingIssueListResultIterator struct { + i int + page EmergingIssueListResultPage +} + +// 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 *EmergingIssueListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EmergingIssueListResultIterator.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 *EmergingIssueListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EmergingIssueListResultIterator) 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 EmergingIssueListResultIterator) Response() EmergingIssueListResult { + 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 EmergingIssueListResultIterator) Value() EmergingIssuesGetResult { + if !iter.page.NotDone() { + return EmergingIssuesGetResult{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EmergingIssueListResultIterator type. +func NewEmergingIssueListResultIterator(page EmergingIssueListResultPage) EmergingIssueListResultIterator { + return EmergingIssueListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (eilr EmergingIssueListResult) IsEmpty() bool { + return eilr.Value == nil || len(*eilr.Value) == 0 +} + +// emergingIssueListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (eilr EmergingIssueListResult) emergingIssueListResultPreparer(ctx context.Context) (*http.Request, error) { + if eilr.NextLink == nil || len(to.String(eilr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(eilr.NextLink))) +} + +// EmergingIssueListResultPage contains a page of EmergingIssuesGetResult values. +type EmergingIssueListResultPage struct { + fn func(context.Context, EmergingIssueListResult) (EmergingIssueListResult, error) + eilr EmergingIssueListResult +} + +// 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 *EmergingIssueListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EmergingIssueListResultPage.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.eilr) + if err != nil { + return err + } + page.eilr = 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 *EmergingIssueListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EmergingIssueListResultPage) NotDone() bool { + return !page.eilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EmergingIssueListResultPage) Response() EmergingIssueListResult { + return page.eilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EmergingIssueListResultPage) Values() []EmergingIssuesGetResult { + if page.eilr.IsEmpty() { + return nil + } + return *page.eilr.Value +} + +// Creates a new instance of the EmergingIssueListResultPage type. +func NewEmergingIssueListResultPage(getNextPage func(context.Context, EmergingIssueListResult) (EmergingIssueListResult, error)) EmergingIssueListResultPage { + return EmergingIssueListResultPage{fn: getNextPage} +} + +// EmergingIssuesGetResult the Get EmergingIssues operation response. +type EmergingIssuesGetResult struct { + autorest.Response `json:"-"` + // EmergingIssue - The emerging issue entity properties. + *EmergingIssue `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EmergingIssuesGetResult. +func (eigr EmergingIssuesGetResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if eigr.EmergingIssue != nil { + objectMap["properties"] = eigr.EmergingIssue + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EmergingIssuesGetResult struct. +func (eigr *EmergingIssuesGetResult) 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 emergingIssue EmergingIssue + err = json.Unmarshal(*v, &emergingIssue) + if err != nil { + return err + } + eigr.EmergingIssue = &emergingIssue + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + eigr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + eigr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + eigr.Type = &typeVar + } + } + } + + return nil +} + // ErrorResponse error details. type ErrorResponse struct { // Code - READ-ONLY; The error code. @@ -279,6 +565,14 @@ type ErrorResponse struct { Details *string `json:"details,omitempty"` } +// ImpactedRegion object of impacted region. +type ImpactedRegion struct { + // ID - The impacted region id. + ID *string `json:"id,omitempty"` + // Name - The impacted region name. + Name *string `json:"name,omitempty"` +} + // Operation operation available in the resourcehealth resource provider. type Operation struct { // Name - Name of the operation. @@ -306,6 +600,17 @@ type OperationListResult struct { Value *[]Operation `json:"value,omitempty"` } +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + // RecommendedAction lists actions the user can take based on the current availabilityState of the // resource. type RecommendedAction struct { @@ -317,6 +622,16 @@ type RecommendedAction struct { ActionURLText *string `json:"actionUrlText,omitempty"` } +// Resource ... +type Resource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + // ServiceImpactingEvent lists the service impacting events that may be affecting the health of the // resource. type ServiceImpactingEvent struct { @@ -349,3 +664,65 @@ type ServiceImpactingEventStatus struct { // Value - Current status of the event Value *string `json:"value,omitempty"` } + +// StatusActiveEvent active event type of emerging issue. +type StatusActiveEvent struct { + // Title - The active event title. + Title *string `json:"title,omitempty"` + // Description - The details of active event. + Description *string `json:"description,omitempty"` + // TrackingID - The tracking id of this active event. + TrackingID *string `json:"trackingId,omitempty"` + // StartTime - The impact start time on this active event. + StartTime *date.Time `json:"startTime,omitempty"` + // Cloud - The cloud type of this active event. + Cloud *string `json:"cloud,omitempty"` + // Severity - The severity level of this active event. Possible values include: 'Information', 'Warning', 'Error' + Severity SeverityValues `json:"severity,omitempty"` + // Stage - The stage of this active event. Possible values include: 'Active', 'Resolve', 'Archived' + Stage StageValues `json:"stage,omitempty"` + // Published - The boolean value of this active event if published or not. + Published *bool `json:"published,omitempty"` + // LastModifiedTime - The last time modified on this banner. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Impacts - The list of emerging issues impacts. + Impacts *[]EmergingIssueImpact `json:"impacts,omitempty"` +} + +// StatusBanner banner type of emerging issue. +type StatusBanner struct { + // Title - The banner title. + Title *string `json:"title,omitempty"` + // Message - The details of banner. + Message *string `json:"message,omitempty"` + // Cloud - The cloud type of this banner. + Cloud *string `json:"cloud,omitempty"` + // LastModifiedTime - The last time modified on this banner. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} diff --git a/services/resourcehealth/mgmt/2017-07-01/resourcehealth/resourcehealthapi/interfaces.go b/services/resourcehealth/mgmt/2017-07-01/resourcehealth/resourcehealthapi/interfaces.go index db4390adf77a..aef0b011bfc4 100644 --- a/services/resourcehealth/mgmt/2017-07-01/resourcehealth/resourcehealthapi/interfaces.go +++ b/services/resourcehealth/mgmt/2017-07-01/resourcehealth/resourcehealthapi/interfaces.go @@ -53,3 +53,11 @@ type OperationsClientAPI interface { } var _ OperationsClientAPI = (*resourcehealth.OperationsClient)(nil) + +// EmergingIssuesClientAPI contains the set of methods on the EmergingIssuesClient type. +type EmergingIssuesClientAPI interface { + Get(ctx context.Context) (result resourcehealth.EmergingIssuesGetResult, err error) + List(ctx context.Context) (result resourcehealth.EmergingIssueListResultPage, err error) +} + +var _ EmergingIssuesClientAPI = (*resourcehealth.EmergingIssuesClient)(nil) diff --git a/services/resources/mgmt/2015-11-01/resources/provideroperationdetails.go b/services/resources/mgmt/2015-11-01/resources/provideroperationdetails.go index 1f90abd674b3..0673ff6a7069 100644 --- a/services/resources/mgmt/2015-11-01/resources/provideroperationdetails.go +++ b/services/resources/mgmt/2015-11-01/resources/provideroperationdetails.go @@ -43,7 +43,7 @@ func NewProviderOperationDetailsClientWithBaseURI(baseURI string, subscriptionID // List gets a list of resource providers. // Parameters: // resourceProviderNamespace - resource identity. -func (client ProviderOperationDetailsClient) List(ctx context.Context, resourceProviderNamespace string) (result ProviderOperationDetailListResultPage, err error) { +func (client ProviderOperationDetailsClient) List(ctx context.Context, resourceProviderNamespace string, APIVersion string) (result ProviderOperationDetailListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationDetailsClient.List") defer func() { @@ -55,7 +55,7 @@ func (client ProviderOperationDetailsClient) List(ctx context.Context, resourceP }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceProviderNamespace) + req, err := client.ListPreparer(ctx, resourceProviderNamespace, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.ProviderOperationDetailsClient", "List", nil, "Failure preparing request") return @@ -77,12 +77,11 @@ func (client ProviderOperationDetailsClient) List(ctx context.Context, resourceP } // ListPreparer prepares the List request. -func (client ProviderOperationDetailsClient) ListPreparer(ctx context.Context, resourceProviderNamespace string) (*http.Request, error) { +func (client ProviderOperationDetailsClient) ListPreparer(ctx context.Context, resourceProviderNamespace string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace), } - const APIVersion = "2015-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +136,7 @@ func (client ProviderOperationDetailsClient) listNextResults(ctx context.Context } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProviderOperationDetailsClient) ListComplete(ctx context.Context, resourceProviderNamespace string) (result ProviderOperationDetailListResultIterator, err error) { +func (client ProviderOperationDetailsClient) ListComplete(ctx context.Context, resourceProviderNamespace string, APIVersion string) (result ProviderOperationDetailListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationDetailsClient.List") defer func() { @@ -148,6 +147,6 @@ func (client ProviderOperationDetailsClient) ListComplete(ctx context.Context, r tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceProviderNamespace) + result.page, err = client.List(ctx, resourceProviderNamespace, APIVersion) return } diff --git a/services/resources/mgmt/2015-11-01/resources/resources.go b/services/resources/mgmt/2015-11-01/resources/resources.go index 921a973ec0bb..092866cf4cc9 100644 --- a/services/resources/mgmt/2015-11-01/resources/resources.go +++ b/services/resources/mgmt/2015-11-01/resources/resources.go @@ -48,7 +48,7 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -67,7 +67,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -89,7 +89,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -99,7 +99,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -139,7 +138,7 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceType - resource identity. // resourceName - resource identity. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result GenericResource, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -158,7 +157,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -180,7 +179,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -190,7 +189,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -232,7 +230,7 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -251,7 +249,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -273,7 +271,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -283,7 +281,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +319,7 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -341,7 +338,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -363,7 +360,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -373,7 +370,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -618,8 +614,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -638,7 +635,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -654,7 +651,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -664,7 +661,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2015-11-01/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2015-11-01/resources/resourcesapi/interfaces.go index b322e9dcb533..4212c1e4396d 100644 --- a/services/resources/mgmt/2015-11-01/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2015-11-01/resources/resourcesapi/interfaces.go @@ -62,13 +62,13 @@ var _ GroupsClientAPI = (*resources.GroupsClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.GenericResource, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.GenericResource, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) } var _ ClientAPI = (*resources.Client)(nil) @@ -94,7 +94,7 @@ var _ DeploymentOperationsClientAPI = (*resources.DeploymentOperationsClient)(ni // ProviderOperationDetailsClientAPI contains the set of methods on the ProviderOperationDetailsClient type. type ProviderOperationDetailsClientAPI interface { - List(ctx context.Context, resourceProviderNamespace string) (result resources.ProviderOperationDetailListResultPage, err error) + List(ctx context.Context, resourceProviderNamespace string, APIVersion string) (result resources.ProviderOperationDetailListResultPage, err error) } var _ ProviderOperationDetailsClientAPI = (*resources.ProviderOperationDetailsClient)(nil) diff --git a/services/resources/mgmt/2016-02-01/resources/resources.go b/services/resources/mgmt/2016-02-01/resources/resources.go index d0c2d4c5f620..3c74b158a07a 100644 --- a/services/resources/mgmt/2016-02-01/resources/resources.go +++ b/services/resources/mgmt/2016-02-01/resources/resources.go @@ -48,7 +48,7 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -67,7 +67,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -89,7 +89,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -99,7 +99,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -139,7 +138,7 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceType - resource identity. // resourceName - resource identity. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result GenericResource, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -158,7 +157,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -180,7 +179,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -190,7 +189,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -232,7 +230,7 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -251,7 +249,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -273,7 +271,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -283,7 +281,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +319,7 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -341,7 +338,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -363,7 +360,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -373,7 +370,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -622,8 +618,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -642,7 +639,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -658,7 +655,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -668,7 +665,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2016-02-01/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2016-02-01/resources/resourcesapi/interfaces.go index c22dda2f7a85..181961126f10 100644 --- a/services/resources/mgmt/2016-02-01/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2016-02-01/resources/resourcesapi/interfaces.go @@ -64,13 +64,13 @@ var _ GroupsClientAPI = (*resources.GroupsClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.GenericResource, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.GenericResource, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) } var _ ClientAPI = (*resources.Client)(nil) diff --git a/services/resources/mgmt/2016-07-01/resources/resources.go b/services/resources/mgmt/2016-07-01/resources/resources.go index 300988aaa1dc..d4a73b17d0bc 100644 --- a/services/resources/mgmt/2016-07-01/resources/resources.go +++ b/services/resources/mgmt/2016-07-01/resources/resources.go @@ -48,7 +48,8 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - api version to use. +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -67,7 +68,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -89,7 +90,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -99,7 +100,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -138,8 +138,9 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. +// APIVersion - api version to use. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result GenericResource, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -158,7 +159,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -180,7 +181,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -190,7 +191,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -232,7 +232,8 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - api version to use. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -251,7 +252,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -273,7 +274,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -283,7 +284,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +322,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // parentResourcePath - resource identity. // resourceType - resource identity. // resourceName - resource identity. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +// APIVersion - api version to use. +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -341,7 +342,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -363,7 +364,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -373,7 +374,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -622,8 +622,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -642,7 +643,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -658,7 +659,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -668,7 +669,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2016-07-01/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2016-07-01/resources/resourcesapi/interfaces.go index 6bceb2cfa733..db3093961425 100644 --- a/services/resources/mgmt/2016-07-01/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2016-07-01/resources/resourcesapi/interfaces.go @@ -64,13 +64,13 @@ var _ GroupsClientAPI = (*resources.GroupsClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.GenericResource, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.GenericResource, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) } var _ ClientAPI = (*resources.Client)(nil) diff --git a/services/resources/mgmt/2016-09-01/resources/resources.go b/services/resources/mgmt/2016-09-01/resources/resources.go index 7b50e40775ee..4835d4398d6c 100644 --- a/services/resources/mgmt/2016-09-01/resources/resources.go +++ b/services/resources/mgmt/2016-09-01/resources/resources.go @@ -49,7 +49,8 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to check whether it exists. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -68,7 +69,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -90,7 +91,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -100,7 +101,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +137,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistenceByID") defer func() { @@ -148,7 +149,7 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CheckExistenceByIDPreparer(ctx, resourceID) + req, err := client.CheckExistenceByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", nil, "Failure preparing request") return @@ -170,12 +171,11 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) } // CheckExistenceByIDPreparer prepares the CheckExistenceByID request. -func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -214,8 +214,9 @@ func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result au // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to create. // resourceName - the name of the resource to create. +// APIVersion - the API version to use for the operation. // parameters - parameters for creating or updating the resource. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -237,7 +238,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -253,7 +254,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -263,7 +264,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,8 +309,9 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { +func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdateByID") defer func() { @@ -328,7 +329,7 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, return result, validation.NewError("resources.Client", "CreateOrUpdateByID", err.Error()) } - req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", nil, "Failure preparing request") return @@ -344,12 +345,11 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, } // CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request. -func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,8 @@ func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result Ge // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to delete. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result DeleteFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result DeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -417,7 +418,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -433,7 +434,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -443,7 +444,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -486,7 +486,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) DeleteByID(ctx context.Context, resourceID string) (result DeleteByIDFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result DeleteByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteByID") defer func() { @@ -497,7 +498,7 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeleteByIDPreparer(ctx, resourceID) + req, err := client.DeleteByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure preparing request") return @@ -513,12 +514,11 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result } // DeleteByIDPreparer prepares the DeleteByID request. -func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,8 @@ func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.R // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource. // resourceName - the name of the resource to get. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -583,7 +584,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -605,7 +606,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -615,7 +616,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,8 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource, // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) GetByID(ctx context.Context, resourceID string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetByID") defer func() { @@ -664,7 +665,7 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetByIDPreparer(ctx, resourceID) + req, err := client.GetByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", nil, "Failure preparing request") return @@ -686,12 +687,11 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen } // GetByIDPreparer prepares the GetByID request. -func (client Client) GetByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) GetByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -941,8 +941,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -961,7 +962,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -977,7 +978,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -987,7 +988,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1033,8 +1033,9 @@ func (client Client) UpdateResponder(resp *http.Response) (result GenericResourc // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - update resource parameters. -func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result UpdateByIDFuture, err error) { +func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result UpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateByID") defer func() { @@ -1045,7 +1046,7 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.UpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure preparing request") return @@ -1061,12 +1062,11 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete } // UpdateByIDPreparer prepares the UpdateByID request. -func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2016-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2016-09-01/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2016-09-01/resources/resourcesapi/interfaces.go index 51a9fb4ea5ff..630ea31d329a 100644 --- a/services/resources/mgmt/2016-09-01/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2016-09-01/resources/resourcesapi/interfaces.go @@ -64,18 +64,18 @@ var _ GroupsClientAPI = (*resources.GroupsClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) - CreateOrUpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.DeleteFuture, err error) - DeleteByID(ctx context.Context, resourceID string) (result resources.DeleteByIDFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) - GetByID(ctx context.Context, resourceID string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) + CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.DeleteFuture, err error) + DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result resources.DeleteByIDFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) + GetByID(ctx context.Context, resourceID string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) - UpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) } var _ ClientAPI = (*resources.Client)(nil) diff --git a/services/resources/mgmt/2017-05-10/resources/resources.go b/services/resources/mgmt/2017-05-10/resources/resources.go index 292496cd4e75..454f330b859f 100644 --- a/services/resources/mgmt/2017-05-10/resources/resources.go +++ b/services/resources/mgmt/2017-05-10/resources/resources.go @@ -49,7 +49,8 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to check whether it exists. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -68,7 +69,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -90,7 +91,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -100,7 +101,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +137,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistenceByID") defer func() { @@ -148,7 +149,7 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CheckExistenceByIDPreparer(ctx, resourceID) + req, err := client.CheckExistenceByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", nil, "Failure preparing request") return @@ -170,12 +171,11 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) } // CheckExistenceByIDPreparer prepares the CheckExistenceByID request. -func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -214,8 +214,9 @@ func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result au // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to create. // resourceName - the name of the resource to create. +// APIVersion - the API version to use for the operation. // parameters - parameters for creating or updating the resource. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -237,7 +238,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -253,7 +254,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -263,7 +264,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,8 +309,9 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { +func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdateByID") defer func() { @@ -328,7 +329,7 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, return result, validation.NewError("resources.Client", "CreateOrUpdateByID", err.Error()) } - req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", nil, "Failure preparing request") return @@ -344,12 +345,11 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, } // CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request. -func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,8 @@ func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result Ge // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to delete. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result DeleteFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result DeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -417,7 +418,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -433,7 +434,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -443,7 +444,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -486,7 +486,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) DeleteByID(ctx context.Context, resourceID string) (result DeleteByIDFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result DeleteByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteByID") defer func() { @@ -497,7 +498,7 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeleteByIDPreparer(ctx, resourceID) + req, err := client.DeleteByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure preparing request") return @@ -513,12 +514,11 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result } // DeleteByIDPreparer prepares the DeleteByID request. -func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,8 @@ func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.R // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource. // resourceName - the name of the resource to get. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -583,7 +584,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -605,7 +606,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -615,7 +616,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,8 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource, // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) GetByID(ctx context.Context, resourceID string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetByID") defer func() { @@ -664,7 +665,7 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetByIDPreparer(ctx, resourceID) + req, err := client.GetByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", nil, "Failure preparing request") return @@ -686,12 +687,11 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen } // GetByIDPreparer prepares the GetByID request. -func (client Client) GetByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) GetByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1074,8 +1074,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -1094,7 +1095,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -1110,7 +1111,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1120,7 +1121,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1166,8 +1166,9 @@ func (client Client) UpdateResponder(resp *http.Response) (result GenericResourc // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - update resource parameters. -func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result UpdateByIDFuture, err error) { +func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result UpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateByID") defer func() { @@ -1178,7 +1179,7 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.UpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure preparing request") return @@ -1194,12 +1195,11 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete } // UpdateByIDPreparer prepares the UpdateByID request. -func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2017-05-10" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2017-05-10/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2017-05-10/resources/resourcesapi/interfaces.go index b96760bd4ab7..8073c3ef3b48 100644 --- a/services/resources/mgmt/2017-05-10/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2017-05-10/resources/resourcesapi/interfaces.go @@ -50,19 +50,19 @@ var _ ProvidersClientAPI = (*resources.ProvidersClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) - CreateOrUpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.DeleteFuture, err error) - DeleteByID(ctx context.Context, resourceID string) (result resources.DeleteByIDFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) - GetByID(ctx context.Context, resourceID string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) + CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.DeleteFuture, err error) + DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result resources.DeleteByIDFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) + GetByID(ctx context.Context, resourceID string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result resources.ListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) - UpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.ValidateMoveResourcesFuture, err error) } diff --git a/services/resources/mgmt/2018-02-01/resources/resources.go b/services/resources/mgmt/2018-02-01/resources/resources.go index 112fcde5aedc..29a107dbe944 100644 --- a/services/resources/mgmt/2018-02-01/resources/resources.go +++ b/services/resources/mgmt/2018-02-01/resources/resources.go @@ -49,7 +49,8 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to check whether it exists. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -68,7 +69,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -90,7 +91,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -100,7 +101,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +137,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistenceByID") defer func() { @@ -148,7 +149,7 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CheckExistenceByIDPreparer(ctx, resourceID) + req, err := client.CheckExistenceByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", nil, "Failure preparing request") return @@ -170,12 +171,11 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) } // CheckExistenceByIDPreparer prepares the CheckExistenceByID request. -func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -214,8 +214,9 @@ func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result au // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to create. // resourceName - the name of the resource to create. +// APIVersion - the API version to use for the operation. // parameters - parameters for creating or updating the resource. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -237,7 +238,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -253,7 +254,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -263,7 +264,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,8 +309,9 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { +func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdateByID") defer func() { @@ -328,7 +329,7 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, return result, validation.NewError("resources.Client", "CreateOrUpdateByID", err.Error()) } - req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", nil, "Failure preparing request") return @@ -344,12 +345,11 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, } // CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request. -func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,8 @@ func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result Ge // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to delete. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result DeleteFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result DeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -417,7 +418,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -433,7 +434,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -443,7 +444,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -486,7 +486,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) DeleteByID(ctx context.Context, resourceID string) (result DeleteByIDFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result DeleteByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteByID") defer func() { @@ -497,7 +498,7 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeleteByIDPreparer(ctx, resourceID) + req, err := client.DeleteByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure preparing request") return @@ -513,12 +514,11 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result } // DeleteByIDPreparer prepares the DeleteByID request. -func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,8 @@ func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.R // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource. // resourceName - the name of the resource to get. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -583,7 +584,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -605,7 +606,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -615,7 +616,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,8 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource, // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) GetByID(ctx context.Context, resourceID string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetByID") defer func() { @@ -664,7 +665,7 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetByIDPreparer(ctx, resourceID) + req, err := client.GetByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", nil, "Failure preparing request") return @@ -686,12 +687,11 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen } // GetByIDPreparer prepares the GetByID request. -func (client Client) GetByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) GetByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1074,8 +1074,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -1094,7 +1095,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -1110,7 +1111,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1120,7 +1121,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1166,8 +1166,9 @@ func (client Client) UpdateResponder(resp *http.Response) (result GenericResourc // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - update resource parameters. -func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result UpdateByIDFuture, err error) { +func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result UpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateByID") defer func() { @@ -1178,7 +1179,7 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.UpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure preparing request") return @@ -1194,12 +1195,11 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete } // UpdateByIDPreparer prepares the UpdateByID request. -func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-02-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2018-02-01/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2018-02-01/resources/resourcesapi/interfaces.go index 86a9d02aac53..9a2edeb4fb68 100644 --- a/services/resources/mgmt/2018-02-01/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2018-02-01/resources/resourcesapi/interfaces.go @@ -50,19 +50,19 @@ var _ ProvidersClientAPI = (*resources.ProvidersClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) - CreateOrUpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.DeleteFuture, err error) - DeleteByID(ctx context.Context, resourceID string) (result resources.DeleteByIDFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) - GetByID(ctx context.Context, resourceID string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) + CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.DeleteFuture, err error) + DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result resources.DeleteByIDFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) + GetByID(ctx context.Context, resourceID string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result resources.ListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) - UpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.ValidateMoveResourcesFuture, err error) } diff --git a/services/resources/mgmt/2018-05-01/resources/resources.go b/services/resources/mgmt/2018-05-01/resources/resources.go index 6409ff07de49..b98d8902b4d6 100644 --- a/services/resources/mgmt/2018-05-01/resources/resources.go +++ b/services/resources/mgmt/2018-05-01/resources/resources.go @@ -49,7 +49,8 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to check whether it exists. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -68,7 +69,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -90,7 +91,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -100,7 +101,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +137,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistenceByID") defer func() { @@ -148,7 +149,7 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CheckExistenceByIDPreparer(ctx, resourceID) + req, err := client.CheckExistenceByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", nil, "Failure preparing request") return @@ -170,12 +171,11 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) } // CheckExistenceByIDPreparer prepares the CheckExistenceByID request. -func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -214,8 +214,9 @@ func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result au // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to create. // resourceName - the name of the resource to create. +// APIVersion - the API version to use for the operation. // parameters - parameters for creating or updating the resource. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -237,7 +238,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -253,7 +254,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -263,7 +264,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,8 +309,9 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { +func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdateByID") defer func() { @@ -328,7 +329,7 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, return result, validation.NewError("resources.Client", "CreateOrUpdateByID", err.Error()) } - req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", nil, "Failure preparing request") return @@ -344,12 +345,11 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, } // CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request. -func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,8 @@ func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result Ge // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to delete. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result DeleteFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result DeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -417,7 +418,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -433,7 +434,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -443,7 +444,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -486,7 +486,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) DeleteByID(ctx context.Context, resourceID string) (result DeleteByIDFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result DeleteByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteByID") defer func() { @@ -497,7 +498,7 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeleteByIDPreparer(ctx, resourceID) + req, err := client.DeleteByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure preparing request") return @@ -513,12 +514,11 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result } // DeleteByIDPreparer prepares the DeleteByID request. -func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,8 @@ func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.R // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource. // resourceName - the name of the resource to get. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -583,7 +584,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -605,7 +606,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -615,7 +616,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,8 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource, // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) GetByID(ctx context.Context, resourceID string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetByID") defer func() { @@ -664,7 +665,7 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetByIDPreparer(ctx, resourceID) + req, err := client.GetByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", nil, "Failure preparing request") return @@ -686,12 +687,11 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen } // GetByIDPreparer prepares the GetByID request. -func (client Client) GetByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) GetByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1096,8 +1096,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -1116,7 +1117,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -1132,7 +1133,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1142,7 +1143,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1188,8 +1188,9 @@ func (client Client) UpdateResponder(resp *http.Response) (result GenericResourc // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - update resource parameters. -func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result UpdateByIDFuture, err error) { +func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result UpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateByID") defer func() { @@ -1200,7 +1201,7 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.UpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure preparing request") return @@ -1216,12 +1217,11 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete } // UpdateByIDPreparer prepares the UpdateByID request. -func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2018-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2018-05-01/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2018-05-01/resources/resourcesapi/interfaces.go index d8b1ac7b04fc..79b4edeb5de0 100644 --- a/services/resources/mgmt/2018-05-01/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2018-05-01/resources/resourcesapi/interfaces.go @@ -65,19 +65,19 @@ var _ ProvidersClientAPI = (*resources.ProvidersClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) - CreateOrUpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.DeleteFuture, err error) - DeleteByID(ctx context.Context, resourceID string) (result resources.DeleteByIDFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) - GetByID(ctx context.Context, resourceID string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) + CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.DeleteFuture, err error) + DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result resources.DeleteByIDFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) + GetByID(ctx context.Context, resourceID string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result resources.ListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) - UpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.ValidateMoveResourcesFuture, err error) } diff --git a/services/resources/mgmt/2019-03-01/resources/resources.go b/services/resources/mgmt/2019-03-01/resources/resources.go index a473370f6cde..20fab7fe9260 100644 --- a/services/resources/mgmt/2019-03-01/resources/resources.go +++ b/services/resources/mgmt/2019-03-01/resources/resources.go @@ -49,7 +49,8 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to check whether it exists. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -68,7 +69,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -90,7 +91,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -100,7 +101,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +137,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistenceByID") defer func() { @@ -148,7 +149,7 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CheckExistenceByIDPreparer(ctx, resourceID) + req, err := client.CheckExistenceByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", nil, "Failure preparing request") return @@ -170,12 +171,11 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) } // CheckExistenceByIDPreparer prepares the CheckExistenceByID request. -func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -214,8 +214,9 @@ func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result au // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to create. // resourceName - the name of the resource to create. +// APIVersion - the API version to use for the operation. // parameters - parameters for creating or updating the resource. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -237,7 +238,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -253,7 +254,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -263,7 +264,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,8 +309,9 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { +func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdateByID") defer func() { @@ -328,7 +329,7 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, return result, validation.NewError("resources.Client", "CreateOrUpdateByID", err.Error()) } - req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", nil, "Failure preparing request") return @@ -344,12 +345,11 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, } // CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request. -func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,8 @@ func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result Ge // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to delete. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result DeleteFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result DeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -417,7 +418,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -433,7 +434,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -443,7 +444,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -486,7 +486,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) DeleteByID(ctx context.Context, resourceID string) (result DeleteByIDFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result DeleteByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteByID") defer func() { @@ -497,7 +498,7 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeleteByIDPreparer(ctx, resourceID) + req, err := client.DeleteByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure preparing request") return @@ -513,12 +514,11 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result } // DeleteByIDPreparer prepares the DeleteByID request. -func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,8 @@ func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.R // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource. // resourceName - the name of the resource to get. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -583,7 +584,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -605,7 +606,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -615,7 +616,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,8 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource, // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) GetByID(ctx context.Context, resourceID string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetByID") defer func() { @@ -664,7 +665,7 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetByIDPreparer(ctx, resourceID) + req, err := client.GetByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", nil, "Failure preparing request") return @@ -686,12 +687,11 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen } // GetByIDPreparer prepares the GetByID request. -func (client Client) GetByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) GetByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1096,8 +1096,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -1116,7 +1117,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -1132,7 +1133,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1142,7 +1143,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1188,8 +1188,9 @@ func (client Client) UpdateResponder(resp *http.Response) (result GenericResourc // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - update resource parameters. -func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result UpdateByIDFuture, err error) { +func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result UpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateByID") defer func() { @@ -1200,7 +1201,7 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.UpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure preparing request") return @@ -1216,12 +1217,11 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete } // UpdateByIDPreparer prepares the UpdateByID request. -func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2019-03-01/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2019-03-01/resources/resourcesapi/interfaces.go index 646618e0916d..5231e6751d1a 100644 --- a/services/resources/mgmt/2019-03-01/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2019-03-01/resources/resourcesapi/interfaces.go @@ -65,19 +65,19 @@ var _ ProvidersClientAPI = (*resources.ProvidersClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) - CreateOrUpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.DeleteFuture, err error) - DeleteByID(ctx context.Context, resourceID string) (result resources.DeleteByIDFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) - GetByID(ctx context.Context, resourceID string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) + CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.DeleteFuture, err error) + DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result resources.DeleteByIDFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) + GetByID(ctx context.Context, resourceID string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result resources.ListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) - UpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.ValidateMoveResourcesFuture, err error) } diff --git a/services/resources/mgmt/2019-05-01/resources/resources.go b/services/resources/mgmt/2019-05-01/resources/resources.go index c439a311eb22..ad1e1dda2a55 100644 --- a/services/resources/mgmt/2019-05-01/resources/resources.go +++ b/services/resources/mgmt/2019-05-01/resources/resources.go @@ -49,7 +49,8 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to check whether it exists. -func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence") defer func() { @@ -68,7 +69,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request") return @@ -90,7 +91,7 @@ func (client Client) CheckExistence(ctx context.Context, resourceGroupName strin } // CheckExistencePreparer prepares the CheckExistence request. -func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -100,7 +101,6 @@ func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +137,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistenceByID") defer func() { @@ -148,7 +149,7 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CheckExistenceByIDPreparer(ctx, resourceID) + req, err := client.CheckExistenceByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", nil, "Failure preparing request") return @@ -170,12 +171,11 @@ func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) } // CheckExistenceByIDPreparer prepares the CheckExistenceByID request. -func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -214,8 +214,9 @@ func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result au // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to create. // resourceName - the name of the resource to create. +// APIVersion - the API version to use for the operation. // parameters - parameters for creating or updating the resource. -func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result CreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") defer func() { @@ -237,7 +238,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request") return @@ -253,7 +254,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -263,7 +264,6 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,8 +309,9 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - create or update resource parameters. -func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { +func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdateByID") defer func() { @@ -328,7 +329,7 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, return result, validation.NewError("resources.Client", "CreateOrUpdateByID", err.Error()) } - req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", nil, "Failure preparing request") return @@ -344,12 +345,11 @@ func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, } // CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request. -func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,8 @@ func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result Ge // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to delete. -func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result DeleteFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result DeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") defer func() { @@ -417,7 +418,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request") return @@ -433,7 +434,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } // DeletePreparer prepares the Delete request. -func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -443,7 +444,6 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -486,7 +486,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) DeleteByID(ctx context.Context, resourceID string) (result DeleteByIDFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result DeleteByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteByID") defer func() { @@ -497,7 +498,7 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeleteByIDPreparer(ctx, resourceID) + req, err := client.DeleteByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure preparing request") return @@ -513,12 +514,11 @@ func (client Client) DeleteByID(ctx context.Context, resourceID string) (result } // DeleteByIDPreparer prepares the DeleteByID request. -func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,8 @@ func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.R // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource. // resourceName - the name of the resource to get. -func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") defer func() { @@ -583,7 +584,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource return result, validation.NewError("resources.Client", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request") return @@ -605,7 +606,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } // GetPreparer prepares the Get request. -func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -615,7 +616,6 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,8 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource, // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client Client) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client Client) GetByID(ctx context.Context, resourceID string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetByID") defer func() { @@ -664,7 +665,7 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetByIDPreparer(ctx, resourceID) + req, err := client.GetByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", nil, "Failure preparing request") return @@ -686,12 +687,11 @@ func (client Client) GetByID(ctx context.Context, resourceID string) (result Gen } // GetByIDPreparer prepares the GetByID request. -func (client Client) GetByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client Client) GetByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1096,8 +1096,9 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { @@ -1116,7 +1117,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return result, validation.NewError("resources.Client", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request") return @@ -1132,7 +1133,7 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou } // UpdatePreparer prepares the Update request. -func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1142,7 +1143,6 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1188,8 +1188,9 @@ func (client Client) UpdateResponder(resp *http.Response) (result GenericResourc // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - update resource parameters. -func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result UpdateByIDFuture, err error) { +func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result UpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateByID") defer func() { @@ -1200,7 +1201,7 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.UpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure preparing request") return @@ -1216,12 +1217,11 @@ func (client Client) UpdateByID(ctx context.Context, resourceID string, paramete } // UpdateByIDPreparer prepares the UpdateByID request. -func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2019-05-01/resources/resourcesapi/interfaces.go b/services/resources/mgmt/2019-05-01/resources/resourcesapi/interfaces.go index 86bfcb54ac54..b38cca08d14f 100644 --- a/services/resources/mgmt/2019-05-01/resources/resourcesapi/interfaces.go +++ b/services/resources/mgmt/2019-05-01/resources/resourcesapi/interfaces.go @@ -73,19 +73,19 @@ var _ ProvidersClientAPI = (*resources.ProvidersClient)(nil) // ClientAPI contains the set of methods on the Client type. type ClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) - CreateOrUpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.DeleteFuture, err error) - DeleteByID(ctx context.Context, resourceID string) (result resources.DeleteByIDFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result resources.GenericResource, err error) - GetByID(ctx context.Context, resourceID string) (result resources.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateFuture, err error) + CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.CreateOrUpdateByIDFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.DeleteFuture, err error) + DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result resources.DeleteByIDFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result resources.GenericResource, err error) + GetByID(ctx context.Context, resourceID string, APIVersion string) (result resources.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result resources.ListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result resources.ListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.MoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) - UpdateByID(ctx context.Context, resourceID string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateFuture, err error) + UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters resources.GenericResource) (result resources.UpdateByIDFuture, err error) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters resources.MoveInfo) (result resources.ValidateMoveResourcesFuture, err error) } diff --git a/services/resources/mgmt/2019-07-01/features/featuresapi/interfaces.go b/services/resources/mgmt/2019-07-01/features/featuresapi/interfaces.go index b1bd3bd25dd2..e2dc919af61a 100644 --- a/services/resources/mgmt/2019-07-01/features/featuresapi/interfaces.go +++ b/services/resources/mgmt/2019-07-01/features/featuresapi/interfaces.go @@ -93,19 +93,19 @@ var _ ProvidersClientAPI = (*features.ProvidersClient)(nil) // ResourcesClientAPI contains the set of methods on the ResourcesClient type. type ResourcesClientAPI interface { - CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) - CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters features.GenericResource) (result features.ResourcesCreateOrUpdateFuture, err error) - CreateOrUpdateByID(ctx context.Context, resourceID string, parameters features.GenericResource) (result features.ResourcesCreateOrUpdateByIDFuture, err error) - Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result features.ResourcesDeleteFuture, err error) - DeleteByID(ctx context.Context, resourceID string) (result features.ResourcesDeleteByIDFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result features.GenericResource, err error) - GetByID(ctx context.Context, resourceID string) (result features.GenericResource, err error) + CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) + CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters features.GenericResource) (result features.ResourcesCreateOrUpdateFuture, err error) + CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters features.GenericResource) (result features.ResourcesCreateOrUpdateByIDFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result features.ResourcesDeleteFuture, err error) + DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result features.ResourcesDeleteByIDFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result features.GenericResource, err error) + GetByID(ctx context.Context, resourceID string, APIVersion string) (result features.GenericResource, err error) List(ctx context.Context, filter string, expand string, top *int32) (result features.ResourceListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result features.ResourceListResultPage, err error) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters features.ResourcesMoveInfo) (result features.ResourcesMoveResourcesFuture, err error) - Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters features.GenericResource) (result features.ResourcesUpdateFuture, err error) - UpdateByID(ctx context.Context, resourceID string, parameters features.GenericResource) (result features.ResourcesUpdateByIDFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters features.GenericResource) (result features.ResourcesUpdateFuture, err error) + UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters features.GenericResource) (result features.ResourcesUpdateByIDFuture, err error) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters features.ResourcesMoveInfo) (result features.ResourcesValidateMoveResourcesFuture, err error) } diff --git a/services/resources/mgmt/2019-07-01/features/resources.go b/services/resources/mgmt/2019-07-01/features/resources.go index 80043ba8a4b2..dfaa510bd4eb 100644 --- a/services/resources/mgmt/2019-07-01/features/resources.go +++ b/services/resources/mgmt/2019-07-01/features/resources.go @@ -49,7 +49,8 @@ func NewResourcesClientWithBaseURI(baseURI string, subscriptionID string) Resour // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to check whether it exists. -func (client ResourcesClient) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client ResourcesClient) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.CheckExistence") defer func() { @@ -68,7 +69,7 @@ func (client ResourcesClient) CheckExistence(ctx context.Context, resourceGroupN return result, validation.NewError("features.ResourcesClient", "CheckExistence", err.Error()) } - req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "CheckExistence", nil, "Failure preparing request") return @@ -90,7 +91,7 @@ func (client ResourcesClient) CheckExistence(ctx context.Context, resourceGroupN } // CheckExistencePreparer prepares the CheckExistence request. -func (client ResourcesClient) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client ResourcesClient) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -100,7 +101,6 @@ func (client ResourcesClient) CheckExistencePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +137,8 @@ func (client ResourcesClient) CheckExistenceResponder(resp *http.Response) (resu // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client ResourcesClient) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) { +// APIVersion - the API version to use for the operation. +func (client ResourcesClient) CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.CheckExistenceByID") defer func() { @@ -148,7 +149,7 @@ func (client ResourcesClient) CheckExistenceByID(ctx context.Context, resourceID tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CheckExistenceByIDPreparer(ctx, resourceID) + req, err := client.CheckExistenceByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "CheckExistenceByID", nil, "Failure preparing request") return @@ -170,12 +171,11 @@ func (client ResourcesClient) CheckExistenceByID(ctx context.Context, resourceID } // CheckExistenceByIDPreparer prepares the CheckExistenceByID request. -func (client ResourcesClient) CheckExistenceByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client ResourcesClient) CheckExistenceByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -214,8 +214,9 @@ func (client ResourcesClient) CheckExistenceByIDResponder(resp *http.Response) ( // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to create. // resourceName - the name of the resource to create. +// APIVersion - the API version to use for the operation. // parameters - parameters for creating or updating the resource. -func (client ResourcesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result ResourcesCreateOrUpdateFuture, err error) { +func (client ResourcesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result ResourcesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.CreateOrUpdate") defer func() { @@ -237,7 +238,7 @@ func (client ResourcesClient) CreateOrUpdate(ctx context.Context, resourceGroupN return result, validation.NewError("features.ResourcesClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -253,7 +254,7 @@ func (client ResourcesClient) CreateOrUpdate(ctx context.Context, resourceGroupN } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ResourcesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client ResourcesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -263,7 +264,6 @@ func (client ResourcesClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,8 +309,9 @@ func (client ResourcesClient) CreateOrUpdateResponder(resp *http.Response) (resu // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - create or update resource parameters. -func (client ResourcesClient) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result ResourcesCreateOrUpdateByIDFuture, err error) { +func (client ResourcesClient) CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result ResourcesCreateOrUpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.CreateOrUpdateByID") defer func() { @@ -328,7 +329,7 @@ func (client ResourcesClient) CreateOrUpdateByID(ctx context.Context, resourceID return result, validation.NewError("features.ResourcesClient", "CreateOrUpdateByID", err.Error()) } - req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "CreateOrUpdateByID", nil, "Failure preparing request") return @@ -344,12 +345,11 @@ func (client ResourcesClient) CreateOrUpdateByID(ctx context.Context, resourceID } // CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request. -func (client ResourcesClient) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client ResourcesClient) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,8 @@ func (client ResourcesClient) CreateOrUpdateByIDResponder(resp *http.Response) ( // parentResourcePath - the parent resource identity. // resourceType - the resource type. // resourceName - the name of the resource to delete. -func (client ResourcesClient) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result ResourcesDeleteFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client ResourcesClient) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result ResourcesDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.Delete") defer func() { @@ -417,7 +418,7 @@ func (client ResourcesClient) Delete(ctx context.Context, resourceGroupName stri return result, validation.NewError("features.ResourcesClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "Delete", nil, "Failure preparing request") return @@ -433,7 +434,7 @@ func (client ResourcesClient) Delete(ctx context.Context, resourceGroupName stri } // DeletePreparer prepares the Delete request. -func (client ResourcesClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client ResourcesClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -443,7 +444,6 @@ func (client ResourcesClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -486,7 +486,8 @@ func (client ResourcesClient) DeleteResponder(resp *http.Response) (result autor // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client ResourcesClient) DeleteByID(ctx context.Context, resourceID string) (result ResourcesDeleteByIDFuture, err error) { +// APIVersion - the API version to use for the operation. +func (client ResourcesClient) DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result ResourcesDeleteByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.DeleteByID") defer func() { @@ -497,7 +498,7 @@ func (client ResourcesClient) DeleteByID(ctx context.Context, resourceID string) tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeleteByIDPreparer(ctx, resourceID) + req, err := client.DeleteByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "DeleteByID", nil, "Failure preparing request") return @@ -513,12 +514,11 @@ func (client ResourcesClient) DeleteByID(ctx context.Context, resourceID string) } // DeleteByIDPreparer prepares the DeleteByID request. -func (client ResourcesClient) DeleteByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client ResourcesClient) DeleteByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,8 @@ func (client ResourcesClient) DeleteByIDResponder(resp *http.Response) (result a // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource. // resourceName - the name of the resource to get. -func (client ResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client ResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.Get") defer func() { @@ -583,7 +584,7 @@ func (client ResourcesClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("features.ResourcesClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName) + req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "Get", nil, "Failure preparing request") return @@ -605,7 +606,7 @@ func (client ResourcesClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client ResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) { +func (client ResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -615,7 +616,6 @@ func (client ResourcesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,8 @@ func (client ResourcesClient) GetResponder(resp *http.Response) (result GenericR // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} -func (client ResourcesClient) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) { +// APIVersion - the API version to use for the operation. +func (client ResourcesClient) GetByID(ctx context.Context, resourceID string, APIVersion string) (result GenericResource, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.GetByID") defer func() { @@ -664,7 +665,7 @@ func (client ResourcesClient) GetByID(ctx context.Context, resourceID string) (r tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetByIDPreparer(ctx, resourceID) + req, err := client.GetByIDPreparer(ctx, resourceID, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "GetByID", nil, "Failure preparing request") return @@ -686,12 +687,11 @@ func (client ResourcesClient) GetByID(ctx context.Context, resourceID string) (r } // GetByIDPreparer prepares the GetByID request. -func (client ResourcesClient) GetByIDPreparer(ctx context.Context, resourceID string) (*http.Request, error) { +func (client ResourcesClient) GetByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1096,8 +1096,9 @@ func (client ResourcesClient) MoveResourcesResponder(resp *http.Response) (resul // parentResourcePath - the parent resource identity. // resourceType - the resource type of the resource to update. // resourceName - the name of the resource to update. +// APIVersion - the API version to use for the operation. // parameters - parameters for updating the resource. -func (client ResourcesClient) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result ResourcesUpdateFuture, err error) { +func (client ResourcesClient) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result ResourcesUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.Update") defer func() { @@ -1116,7 +1117,7 @@ func (client ResourcesClient) Update(ctx context.Context, resourceGroupName stri return result, validation.NewError("features.ResourcesClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "Update", nil, "Failure preparing request") return @@ -1132,7 +1133,7 @@ func (client ResourcesClient) Update(ctx context.Context, resourceGroupName stri } // UpdatePreparer prepares the Update request. -func (client ResourcesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) { +func (client ResourcesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "parentResourcePath": parentResourcePath, "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1142,7 +1143,6 @@ func (client ResourcesClient) UpdatePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1188,8 +1188,9 @@ func (client ResourcesClient) UpdateResponder(resp *http.Response) (result Gener // resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the // format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} +// APIVersion - the API version to use for the operation. // parameters - update resource parameters. -func (client ResourcesClient) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result ResourcesUpdateByIDFuture, err error) { +func (client ResourcesClient) UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result ResourcesUpdateByIDFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourcesClient.UpdateByID") defer func() { @@ -1200,7 +1201,7 @@ func (client ResourcesClient) UpdateByID(ctx context.Context, resourceID string, tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters) + req, err := client.UpdateByIDPreparer(ctx, resourceID, APIVersion, parameters) if err != nil { err = autorest.NewErrorWithError(err, "features.ResourcesClient", "UpdateByID", nil, "Failure preparing request") return @@ -1216,12 +1217,11 @@ func (client ResourcesClient) UpdateByID(ctx context.Context, resourceID string, } // UpdateByIDPreparer prepares the UpdateByID request. -func (client ResourcesClient) UpdateByIDPreparer(ctx context.Context, resourceID string, parameters GenericResource) (*http.Request, error) { +func (client ResourcesClient) UpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceId": resourceID, } - const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/resources/mgmt/2019-09-01/policy/models.go b/services/resources/mgmt/2019-09-01/policy/models.go index 814e5645f18b..826df3d63647 100644 --- a/services/resources/mgmt/2019-09-01/policy/models.go +++ b/services/resources/mgmt/2019-09-01/policy/models.go @@ -73,9 +73,10 @@ func PossibleParameterTypeValues() []ParameterType { type ResourceIdentityType string const ( - // None ... + // None Indicates that no identity is associated with the resource or that the existing identity should be + // removed. None ResourceIdentityType = "None" - // SystemAssigned ... + // SystemAssigned Indicates that a system assigned identity is associated with the resource. SystemAssigned ResourceIdentityType = "SystemAssigned" ) @@ -755,11 +756,11 @@ type Identity struct { 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 - The identity type. This is the only required field when adding a system assigned identity to a resource. Possible values include: 'SystemAssigned', 'None' Type ResourceIdentityType `json:"type,omitempty"` } -// ParameterDefinitionsValue ... +// ParameterDefinitionsValue the definition of a parameter that can be provided to the policy. 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"` @@ -841,7 +842,7 @@ func (pdv *ParameterDefinitionsValueMetadata) UnmarshalJSON(body []byte) error { return nil } -// ParameterValuesValue ... +// ParameterValuesValue the value of a parameter. type ParameterValuesValue struct { // Value - The value of the parameter. Value interface{} `json:"value,omitempty"` diff --git a/services/servicefabric/mgmt/2018-02-01/servicefabric/operations.go b/services/servicefabric/mgmt/2018-02-01/servicefabric/operations.go index cb9ff979278c..82ccc3f0bf26 100644 --- a/services/servicefabric/mgmt/2018-02-01/servicefabric/operations.go +++ b/services/servicefabric/mgmt/2018-02-01/servicefabric/operations.go @@ -41,7 +41,9 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera } // List get the list of available Service Fabric resource provider API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { +// Parameters: +// APIVersion - the version of the Service Fabric resource provider API +func (client OperationsClient) List(ctx context.Context, APIVersion string) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -53,7 +55,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", nil, "Failure preparing request") return @@ -75,8 +77,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "" +func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +132,7 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context, APIVersion string) (result OperationListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -142,6 +143,6 @@ func (client OperationsClient) ListComplete(ctx context.Context) (result Operati tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx) + result.page, err = client.List(ctx, APIVersion) return } diff --git a/services/servicefabric/mgmt/2018-02-01/servicefabric/servicefabricapi/interfaces.go b/services/servicefabric/mgmt/2018-02-01/servicefabric/servicefabricapi/interfaces.go index f46cde13b53e..31d177b3eb2b 100644 --- a/services/servicefabric/mgmt/2018-02-01/servicefabric/servicefabricapi/interfaces.go +++ b/services/servicefabric/mgmt/2018-02-01/servicefabric/servicefabricapi/interfaces.go @@ -47,7 +47,7 @@ var _ ClusterVersionsClientAPI = (*servicefabric.ClusterVersionsClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result servicefabric.OperationListResultPage, err error) + List(ctx context.Context, APIVersion string) (result servicefabric.OperationListResultPage, err error) } var _ OperationsClientAPI = (*servicefabric.OperationsClient)(nil) diff --git a/services/servicefabric/mgmt/2019-03-01/servicefabric/operations.go b/services/servicefabric/mgmt/2019-03-01/servicefabric/operations.go index b73bec1e42c9..82ccc3f0bf26 100644 --- a/services/servicefabric/mgmt/2019-03-01/servicefabric/operations.go +++ b/services/servicefabric/mgmt/2019-03-01/servicefabric/operations.go @@ -41,7 +41,9 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera } // List get the list of available Service Fabric resource provider API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { +// Parameters: +// APIVersion - the version of the Service Fabric resource provider API +func (client OperationsClient) List(ctx context.Context, APIVersion string) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -53,7 +55,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) + req, err := client.ListPreparer(ctx, APIVersion) if err != nil { err = autorest.NewErrorWithError(err, "servicefabric.OperationsClient", "List", nil, "Failure preparing request") return @@ -75,8 +77,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-03-01" +func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +132,7 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context, APIVersion string) (result OperationListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -142,6 +143,6 @@ func (client OperationsClient) ListComplete(ctx context.Context) (result Operati tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx) + result.page, err = client.List(ctx, APIVersion) return } diff --git a/services/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi/interfaces.go b/services/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi/interfaces.go index c51278701ea2..8e7e214946e2 100644 --- a/services/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi/interfaces.go +++ b/services/servicefabric/mgmt/2019-03-01/servicefabric/servicefabricapi/interfaces.go @@ -47,7 +47,7 @@ var _ ClusterVersionsClientAPI = (*servicefabric.ClusterVersionsClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context) (result servicefabric.OperationListResultPage, err error) + List(ctx context.Context, APIVersion string) (result servicefabric.OperationListResultPage, err error) } var _ OperationsClientAPI = (*servicefabric.OperationsClient)(nil) diff --git a/services/storage/mgmt/2019-06-01/storage/fileshares.go b/services/storage/mgmt/2019-06-01/storage/fileshares.go index ba3a157d17ac..381e09dfeb4b 100644 --- a/services/storage/mgmt/2019-06-01/storage/fileshares.go +++ b/services/storage/mgmt/2019-06-01/storage/fileshares.go @@ -77,7 +77,7 @@ func (client FileSharesClient) Create(ctx context.Context, resourceGroupName str {TargetValue: fileShare, Constraints: []validation.Constraint{{Target: "fileShare.FileShareProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.InclusiveMaximum, Rule: int64(100000), Chain: nil}, + Chain: []validation.Constraint{{Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.InclusiveMaximum, Rule: int64(102400), Chain: nil}, {Target: "fileShare.FileShareProperties.ShareQuota", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, }}, }}}}, diff --git a/version/version.go b/version/version.go index 3eac8bb046d0..cde980c3ae06 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 = "v37.2.0" +const Number = "v38.0.0"