From 4f153abb942b87a1518c3b976c577053ede07cdf Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 27 Apr 2022 00:14:19 +0000 Subject: [PATCH] CodeGen from PR 18551 in Azure/azure-rest-api-specs [Hub Generated] Publish private branch 'dev-orbital-Microsoft.Orbital-2021-04-04-preview' (#18551) * New Swagger Spec File * New Swagger Example Spec File * New Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Go Language Readme Config File * New Python Language Readme Config File * New Typescript Language Readme Config File * New C# Language Readme Config File * Orbital sdk 2021 04 04 preview (#5253) * New Readme Config File * New Go Language Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New Ruby Language Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Added orbital.json file * Passed linting using AutoRest for 2020-09-01 Azure Orbital Private Privew * Updated Operation object under Azure Orbital 2020-09-01 preview. * Updated Operation object under Azure Orbital 2020-09-01 preview. * Updated Satellites object for Azure Orbital 2020-09-01 preview * Updated examples for Azure Orbital Private Preview 2020-09-01 * Updated examples for Azure Orbital Private Preview 2020-09-01 * Updated examples for Azure Orbital Private Preview 2020-09-01 * Addressed feedback from ARMChangesRequested * Updated the GetAvailableContacts api to add long running operation * Updated the api version * Updated the objects based on discussion with PM. * list available ground station made a POST request (#2521) * list available ground station made a POST request * Swagger LintDiff fix Co-authored-by: Devanshu Singh * swagger specs for version-20210404-preview * removed cross version references. Copied over unchanged examples from the previous API version 2021-09-01-preview * removed availableGroundStations API * New Readme Config File New Go Language Readme Config File New Typescript Language Readme Config File New Python Language Readme Config File New C# Language Readme Config File New Ruby Language Readme Config File New Swagger Spec File New Swagger Example Spec File Added orbital.json file Passed linting using AutoRest for 2020-09-01 Azure Orbital Private Privew Updated Operation object under Azure Orbital 2020-09-01 preview. Updated Operation object under Azure Orbital 2020-09-01 preview. Updated Satellites object for Azure Orbital 2020-09-01 preview Updated examples for Azure Orbital Private Preview 2020-09-01 Updated examples for Azure Orbital Private Preview 2020-09-01 Updated examples for Azure Orbital Private Preview 2020-09-01 Addressed feedback from ARMChangesRequested Updated the GetAvailableContacts api to add long running operation Updated the api version Updated the objects based on discussion with PM. list available ground station made a POST request (#2521) * list available ground station made a POST request * Swagger LintDiff fix Co-authored-by: Devanshu Singh * validation check changes. Avocado, SpellCheck and prettier * validation checks changes * Modify readme.md for sdk generation * added system data * sdk pre namer validation changes * lintdiff warning changes * add comms scenario swagger (#3794) * add comms scenario swagger * remove unused example * fix some validation errors * fix style issues * update spec based on feedback * add updated example files * fix CI errors * change endpoints/connections list APIs to posts from gets * connections lists from endpoints return resource IDs rather than full objects. * update examples files for endpoints connections list APIs * fix operationIds and add descriptions * fix more op ids and add descriptions for real * fix typos, add constraints, and remove kbps/gbps from bandwidth (#4023) * Updates to Resource Types (Modifications and Renames) (#4294) * update orbital.json * update examples * prettier fix * unfix old api version * fix ci issues * make more fields immutable * update provisioning states * swagger specs for Available groundstation APIs, version 2021-preview (#4920) * swagger specs for Available groundstation APIs, version 2021-preview * npm prettier check * added type object * removed capability and global comms info from responses * prettier fix * changed AP id response * changes to schema to follow ARM format, resource id update * Spelling check fix * Ground Station spell check * added groundstation to custom words * Revert "added groundstation to custom words" This reverts commit 0d7e18217de98836dcb8ba991685e15436004836. * Revert "Ground Station spell check" This reverts commit ef85b3b26f9ddf81dc1f50a9b677f9d8f115c4cf. * Revert "Spelling check fix" This reverts commit 6bd95c6e013889b6d488703846bbe87bbbb9c494. * word addition * type in response * type definition in swagger * readonly add Co-authored-by: Akanksha Bhattacharyya * removed comms APIs * readme updated * fixed Swagger Avocado errors * swagger lintDiff fix 1 * swagger lintDiff fix 2 * swagger lintDiff fix 3 Co-authored-by: Sunny Patel Co-authored-by: Sunny Patel Co-authored-by: Arthur Ning <57385816+akning-ms@users.noreply.github.com> Co-authored-by: Devanshu Singh Co-authored-by: Zhenglai Zhang Co-authored-by: Jim Harris <72156062+MicrosoftJim@users.noreply.github.com> Co-authored-by: Akanksha Bhattacharyya Co-authored-by: Akanksha Bhattacharyya * operation IDs updated (#5461) Co-authored-by: Devanshu Singh * Dev orbital microsoft.orbital 2021 04 04 preview (#5491) * operation IDs updated * updated OperationListResult definition * review points implemented Co-authored-by: Devanshu Singh * Azure Orbital - Review points implemented (#5507) * operation IDs updated * updated OperationListResult definition * review points implemented * referencing CloudError, ApiVersionParameter, ResourceGroupNameParameter, SubscriptionIdParameter from common-types * reverting cloudError refs * prettify json * reorder some parameters Co-authored-by: Devanshu Singh Co-authored-by: ArcturusZhang * Removed Empty allOf (#5510) * operation IDs updated * updated OperationListResult definition * review points implemented * referencing CloudError, ApiVersionParameter, ResourceGroupNameParameter, SubscriptionIdParameter from common-types * reverting cloudError refs * prettify json * removed empty allOf * validation checks Co-authored-by: Devanshu Singh * readme.go.md fixed (#5512) * operation IDs updated * updated OperationListResult definition * review points implemented * referencing CloudError, ApiVersionParameter, ResourceGroupNameParameter, SubscriptionIdParameter from common-types * reverting cloudError refs * prettify json * removed empty allOf * validation checks * readme.go.md fixed Co-authored-by: Devanshu Singh * Remove last empty allOf (#5513) * operation IDs updated * updated OperationListResult definition * review points implemented * referencing CloudError, ApiVersionParameter, ResourceGroupNameParameter, SubscriptionIdParameter from common-types * reverting cloudError refs * prettify json * removed empty allOf * validation checks * readme.go.md fixed * remove one last empty allOf Co-authored-by: Devanshu Singh * stable API version 2022-03-01 * valid json * lint diff fix * lint diff fix 2 * avocado fix * lint diff warninga 1 * lint diff warnings 2 * prettier fix * readme.me updated 2022-03-01 * Update readme.python.md Co-authored-by: Sunny Patel Co-authored-by: Sunny Patel Co-authored-by: Arthur Ning <57385816+akning-ms@users.noreply.github.com> Co-authored-by: Devanshu Singh Co-authored-by: Zhenglai Zhang Co-authored-by: Jim Harris <72156062+MicrosoftJim@users.noreply.github.com> Co-authored-by: Akanksha Bhattacharyya Co-authored-by: Akanksha Bhattacharyya Co-authored-by: ArcturusZhang Co-authored-by: Yuchao Yan --- .../orbital/armorbital/CHANGELOG.md | 110 ++++++++ .../orbital/armorbital/autorest.md | 6 +- sdk/resourcemanager/orbital/armorbital/go.mod | 16 +- sdk/resourcemanager/orbital/armorbital/go.sum | 33 +-- ...ple_availablegroundstations_client_test.go | 64 ----- ...ted_example_contactprofiles_client_test.go | 223 --------------- ..._generated_example_contacts_client_test.go | 132 --------- ...enerated_example_operations_client_test.go | 42 --- ...nerated_example_spacecrafts_client_test.go | 227 --------------- ...enerated_availablegroundstations_client.go | 8 +- .../armorbital/zz_generated_constants.go | 175 ++++++++++-- .../zz_generated_contactprofiles_client.go | 125 ++++---- .../zz_generated_contacts_client.go | 53 ++-- .../armorbital/zz_generated_date_type.go | 59 ++++ .../orbital/armorbital/zz_generated_models.go | 266 ++++++++++++++++-- .../armorbital/zz_generated_models_serde.go | 192 ++++++++++++- .../zz_generated_operations_client.go | 2 +- .../zz_generated_operationsresults_client.go | 116 ++++++++ .../armorbital/zz_generated_response_types.go | 5 + .../zz_generated_spacecrafts_client.go | 173 ++++++++---- 20 files changed, 1100 insertions(+), 927 deletions(-) delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_availablegroundstations_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_contactprofiles_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_contacts_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_spacecrafts_client_test.go create mode 100644 sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go create mode 100644 sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go diff --git a/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md b/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md index 0f6d897426f8..1e8008b0a0a2 100644 --- a/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md +++ b/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md @@ -1,5 +1,115 @@ # Release History +## 0.5.0 (2022-04-27) +### Breaking Changes + +- Function `*AvailableGroundStationsClient.NewListByCapabilityPager` parameter(s) have been changed from `(CapabilityType, *AvailableGroundStationsClientListByCapabilityOptions)` to `(CapabilityParameter, *AvailableGroundStationsClientListByCapabilityOptions)` +- Function `*SpacecraftsClient.BeginListAvailableContacts` return value(s) have been changed from `(*armruntime.Poller[SpacecraftsClientListAvailableContactsResponse], error)` to `(*armruntime.Poller[*runtime.Pager[SpacecraftsClientListAvailableContactsResponse]], error)` +- Type of `AvailableContacts.Spacecraft` has been changed from `*ResourceReference` to `*AvailableContactsSpacecraft` +- Type of `AvailableContacts.Properties` has been changed from `*ContactInstanceProperties` to `*AvailableContactsProperties` +- Type of `ContactParameters.ContactProfile` has been changed from `*ResourceReference` to `*ContactParametersContactProfile` +- Type of `ContactProfile.Properties` has been changed from `*ContactProfilesProperties` to `*ContactProfileProperties` +- Type of `ContactsProperties.ContactProfile` has been changed from `*ResourceReference` to `*ContactsPropertiesContactProfile` +- Const `AuthorizationStatusAllowed` has been removed +- Const `PolarizationDualRhcpLhcp` has been removed +- Const `CapabilityTypeCommunication` has been removed +- Const `CapabilityTypeEarthObservation` has been removed +- Const `AuthorizationStatusDenied` has been removed +- Const `AuthorizationStatusPending` has been removed +- Function `*ContactProfilesClient.UpdateTags` has been removed +- Function `*SpacecraftsClient.UpdateTags` has been removed +- Function `PossibleCapabilityTypeValues` has been removed +- Function `PossibleAuthorizationStatusValues` has been removed +- Struct `ContactProfilesClientUpdateTagsOptions` has been removed +- Struct `SpacecraftsClientUpdateTagsOptions` has been removed +- Field `AuthorizationStatus` of struct `SpacecraftsProperties` has been removed +- Field `AuthorizationStatusExtended` of struct `SpacecraftsProperties` has been removed + +### Features Added + +- New const `CapabilityParameterCommunication` +- New const `ContactsPropertiesProvisioningStateCreating` +- New const `SpacecraftsPropertiesProvisioningStateUpdating` +- New const `ContactProfilesPropertiesProvisioningStateDeleting` +- New const `StatusRunning` +- New const `APIVersionParameterTwoThousandTwenty0901Preview` +- New const `APIVersionParameterTwoThousandTwentyOne0404Preview` +- New const `ProvisioningStateFailed` +- New const `SpacecraftsPropertiesProvisioningStateCreating` +- New const `SpacecraftsPropertiesProvisioningStateSucceeded` +- New const `SpacecraftsPropertiesProvisioningStateCanceled` +- New const `StatusCanceled` +- New const `ContactsPropertiesProvisioningStateCanceled` +- New const `ContactsPropertiesProvisioningStateFailed` +- New const `ContactsPropertiesProvisioningStateSucceeded` +- New const `ContactProfilesPropertiesProvisioningStateUpdating` +- New const `ProvisioningStateUpdating` +- New const `ContactProfilesPropertiesProvisioningStateSucceeded` +- New const `SpacecraftsPropertiesProvisioningStateDeleting` +- New const `ContactsPropertiesProvisioningStateUpdating` +- New const `ProvisioningStateDeleting` +- New const `CapabilityParameterEarthObservation` +- New const `ProvisioningStateSucceeded` +- New const `ReleaseModeGA` +- New const `ContactProfilesPropertiesProvisioningStateFailed` +- New const `ContactsPropertiesProvisioningStateDeleting` +- New const `ContactProfilesPropertiesProvisioningStateCreating` +- New const `ReleaseModePreview` +- New const `ProvisioningStateCanceled` +- New const `ContactProfilesPropertiesProvisioningStateCanceled` +- New const `ProvisioningStateCreating` +- New const `APIVersionParameterTwoThousandTwentyTwo0301` +- New const `SpacecraftsPropertiesProvisioningStateFailed` +- New function `PossibleCapabilityParameterValues() []CapabilityParameter` +- New function `AvailableContactsProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleAPIVersionParameterValues() []APIVersionParameter` +- New function `PossibleContactsPropertiesProvisioningStateValues() []ContactsPropertiesProvisioningState` +- New function `*AvailableContactsProperties.UnmarshalJSON([]byte) error` +- New function `ContactsPropertiesAntennaConfiguration.MarshalJSON() ([]byte, error)` +- New function `PossibleReleaseModeValues() []ReleaseMode` +- New function `*SpacecraftsClient.BeginUpdateTags(context.Context, string, string, TagsObject, *SpacecraftsClientBeginUpdateTagsOptions) (*armruntime.Poller[SpacecraftsClientUpdateTagsResponse], error)` +- New function `OperationResult.MarshalJSON() ([]byte, error)` +- New function `*AuthorizedGroundstation.UnmarshalJSON([]byte) error` +- New function `SpacecraftLink.MarshalJSON() ([]byte, error)` +- New function `ContactProfileProperties.MarshalJSON() ([]byte, error)` +- New function `AuthorizedGroundstation.MarshalJSON() ([]byte, error)` +- New function `PossibleSpacecraftsPropertiesProvisioningStateValues() []SpacecraftsPropertiesProvisioningState` +- New function `*ContactProfilesClient.BeginUpdateTags(context.Context, string, string, TagsObject, *ContactProfilesClientBeginUpdateTagsOptions) (*armruntime.Poller[ContactProfilesClientUpdateTagsResponse], error)` +- New function `PossibleProvisioningStateValues() []ProvisioningState` +- New function `*OperationResult.UnmarshalJSON([]byte) error` +- New function `PossibleContactProfilesPropertiesProvisioningStateValues() []ContactProfilesPropertiesProvisioningState` +- New struct `AuthorizedGroundstation` +- New struct `AvailableContactsProperties` +- New struct `AvailableContactsSpacecraft` +- New struct `AvailableGroundStationPropertiesAutoGenerated` +- New struct `ContactParametersContactProfile` +- New struct `ContactProfileProperties` +- New struct `ContactProfilesClientBeginUpdateTagsOptions` +- New struct `ContactProfilesPropertiesNetworkConfiguration` +- New struct `ContactsPropertiesAntennaConfiguration` +- New struct `ContactsPropertiesContactProfile` +- New struct `OperationResult` +- New struct `OperationResultErrorProperties` +- New struct `OperationsResultsClientBeginGetOptions` +- New struct `OperationsResultsClientGetResponse` +- New struct `SpacecraftsClientBeginUpdateTagsOptions` +- New field `Skiptoken` in struct `ContactProfilesClientListOptions` +- New field `ReleaseMode` in struct `AvailableGroundStationProperties` +- New field `Skiptoken` in struct `ContactProfilesClientListBySubscriptionOptions` +- New field `Skiptoken` in struct `SpacecraftsClientListBySubscriptionOptions` +- New field `Name` in struct `ContactProfileLink` +- New field `ProvisioningState` in struct `ContactsProperties` +- New field `AntennaConfiguration` in struct `ContactsProperties` +- New field `ProvisioningState` in struct `SpacecraftsProperties` +- New field `Skiptoken` in struct `SpacecraftsClientListOptions` +- New field `Name` in struct `ContactProfileLinkChannel` +- New field `ProvisioningState` in struct `ContactProfilesProperties` +- New field `NetworkConfiguration` in struct `ContactProfilesProperties` +- New field `Skiptoken` in struct `ContactsClientListOptions` +- New field `Name` in struct `SpacecraftLink` +- New field `Authorizations` in struct `SpacecraftLink` + + ## 0.4.0 (2022-04-18) ### Breaking Changes diff --git a/sdk/resourcemanager/orbital/armorbital/autorest.md b/sdk/resourcemanager/orbital/armorbital/autorest.md index c0cb0e5cf45e..aa20bed74e36 100644 --- a/sdk/resourcemanager/orbital/armorbital/autorest.md +++ b/sdk/resourcemanager/orbital/armorbital/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/orbital/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/orbital/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/orbital/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/orbital/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 0.5.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/orbital/armorbital/go.mod b/sdk/resourcemanager/orbital/armorbital/go.mod index 2fe18ee2fba5..b6b489f69110 100644 --- a/sdk/resourcemanager/orbital/armorbital/go.mod +++ b/sdk/resourcemanager/orbital/armorbital/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/orbital/armorbital/go.sum b/sdk/resourcemanager/orbital/armorbital/go.sum index 56d1c32628ae..a7eaa30576c1 100644 --- a/sdk/resourcemanager/orbital/armorbital/go.sum +++ b/sdk/resourcemanager/orbital/armorbital/go.sum @@ -1,26 +1,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -28,26 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_availablegroundstations_client_test.go b/sdk/resourcemanager/orbital/armorbital/ze_generated_example_availablegroundstations_client_test.go deleted file mode 100644 index 957126e7bfb1..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_availablegroundstations_client_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armorbital_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableGroundStationsByCapabilityList.json -func ExampleAvailableGroundStationsClient_NewListByCapabilityPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewAvailableGroundStationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByCapabilityPager(armorbital.CapabilityTypeEarthObservation, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableGroundStationGet.json -func ExampleAvailableGroundStationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewAvailableGroundStationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_contactprofiles_client_test.go b/sdk/resourcemanager/orbital/armorbital/ze_generated_example_contactprofiles_client_test.go deleted file mode 100644 index 6a7229150e11..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_contactprofiles_client_test.go +++ /dev/null @@ -1,223 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armorbital_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileGet.json -func ExampleContactProfilesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactProfilesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileCreate.json -func ExampleContactProfilesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactProfilesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armorbital.ContactProfile{ - Location: to.Ptr(""), - Properties: &armorbital.ContactProfilesProperties{ - AutoTrackingConfiguration: to.Ptr(armorbital.AutoTrackingConfigurationXBand), - EventHubURI: to.Ptr(""), - Links: []*armorbital.ContactProfileLink{ - { - Channels: []*armorbital.ContactProfileLinkChannel{ - { - BandwidthMHz: to.Ptr[float32](0.036), - CenterFrequencyMHz: to.Ptr[float32](2106.4063), - DecodingConfiguration: to.Ptr(""), - DemodulationConfiguration: to.Ptr(""), - EncodingConfiguration: to.Ptr(""), - EndPoint: &armorbital.EndPoint{ - EndPointName: to.Ptr(""), - IPAddress: to.Ptr(""), - Port: to.Ptr(""), - Protocol: to.Ptr(armorbital.ProtocolTCP), - }, - ModulationConfiguration: to.Ptr(""), - }}, - Direction: to.Ptr(armorbital.DirectionUplink), - EirpdBW: to.Ptr[float32](45), - GainOverTemperature: to.Ptr[float32](0), - Polarization: to.Ptr(armorbital.PolarizationRHCP), - }, - { - Channels: []*armorbital.ContactProfileLinkChannel{ - { - BandwidthMHz: to.Ptr[float32](150), - CenterFrequencyMHz: to.Ptr[float32](8160), - DecodingConfiguration: to.Ptr(""), - DemodulationConfiguration: to.Ptr(""), - EncodingConfiguration: to.Ptr(""), - EndPoint: &armorbital.EndPoint{ - EndPointName: to.Ptr(""), - IPAddress: to.Ptr(""), - Port: to.Ptr(""), - Protocol: to.Ptr(armorbital.ProtocolTCP), - }, - ModulationConfiguration: to.Ptr(""), - }}, - Direction: to.Ptr(armorbital.DirectionDownlink), - EirpdBW: to.Ptr[float32](0), - GainOverTemperature: to.Ptr[float32](25), - Polarization: to.Ptr(armorbital.PolarizationRHCP), - }}, - MinimumElevationDegrees: to.Ptr[float32](10), - MinimumViableContactDuration: to.Ptr(""), - }, - }, - &armorbital.ContactProfilesClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileDelete.json -func ExampleContactProfilesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactProfilesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - "", - &armorbital.ContactProfilesClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfileUpdateTag.json -func ExampleContactProfilesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactProfilesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateTags(ctx, - "", - "", - armorbital.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfilesBySubscriptionList.json -func ExampleContactProfilesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactProfilesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactProfilesByResourceGroupList.json -func ExampleContactProfilesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactProfilesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_contacts_client_test.go b/sdk/resourcemanager/orbital/armorbital/ze_generated_example_contacts_client_test.go deleted file mode 100644 index 14aba41287dc..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_contacts_client_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armorbital_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactsBySpacecraftNameList.json -func ExampleContactsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactGet.json -func ExampleContactsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactCreate.json -func ExampleContactsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "", - "", - "", - armorbital.Contact{ - Properties: &armorbital.ContactsProperties{ - ContactProfile: &armorbital.ResourceReference{ - ID: to.Ptr(""), - }, - GroundStationName: to.Ptr(""), - ReservationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-16T20:55:00.00Z"); return t }()), - ReservationStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-16T20:35:00.00Z"); return t }()), - }, - }, - &armorbital.ContactsClientBeginCreateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/ContactDelete.json -func ExampleContactsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - "", - "", - &armorbital.ContactsClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/orbital/armorbital/ze_generated_example_operations_client_test.go deleted file mode 100644 index 1a438472a892..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armorbital_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_spacecrafts_client_test.go b/sdk/resourcemanager/orbital/armorbital/ze_generated_example_spacecrafts_client_test.go deleted file mode 100644 index 301a3169a76d..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_spacecrafts_client_test.go +++ /dev/null @@ -1,227 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armorbital_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftsBySubscriptionList.json -func ExampleSpacecraftsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewSpacecraftsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftsByResourceGroupList.json -func ExampleSpacecraftsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewSpacecraftsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftGet.json -func ExampleSpacecraftsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewSpacecraftsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftCreate.json -func ExampleSpacecraftsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewSpacecraftsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armorbital.Spacecraft{ - Location: to.Ptr(""), - Properties: &armorbital.SpacecraftsProperties{ - Links: []*armorbital.SpacecraftLink{ - { - BandwidthMHz: to.Ptr[float32](0.036), - CenterFrequencyMHz: to.Ptr[float32](2106.4063), - Direction: to.Ptr(armorbital.DirectionUplink), - Polarization: to.Ptr(armorbital.PolarizationRHCP), - }, - { - BandwidthMHz: to.Ptr[float32](150), - CenterFrequencyMHz: to.Ptr[float32](8125), - Direction: to.Ptr(armorbital.DirectionDownlink), - Polarization: to.Ptr(armorbital.PolarizationRHCP), - }}, - NoradID: to.Ptr(""), - TitleLine: to.Ptr(""), - TleLine1: to.Ptr(""), - TleLine2: to.Ptr(""), - }, - }, - &armorbital.SpacecraftsClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftDelete.json -func ExampleSpacecraftsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewSpacecraftsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - "", - &armorbital.SpacecraftsClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/SpacecraftUpdateTags.json -func ExampleSpacecraftsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewSpacecraftsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateTags(ctx, - "", - "", - armorbital.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/orbital/resource-manager/Microsoft.Orbital/preview/2021-04-04-preview/examples/AvailableContactsList.json -func ExampleSpacecraftsClient_BeginListAvailableContacts() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewSpacecraftsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginListAvailableContacts(ctx, - "", - "", - armorbital.ContactParameters{ - ContactProfile: &armorbital.ResourceReference{ - ID: to.Ptr(""), - }, - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-17T23:49:40.00Z"); return t }()), - GroundStationName: to.Ptr(""), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-16T05:40:21.00Z"); return t }()), - }, - &armorbital.SpacecraftsClientBeginListAvailableContactsOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_availablegroundstations_client.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_availablegroundstations_client.go index 4131ec0c3bbf..bbc626bfe9a9 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_availablegroundstations_client.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_availablegroundstations_client.go @@ -90,7 +90,7 @@ func (client *AvailableGroundStationsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -110,7 +110,7 @@ func (client *AvailableGroundStationsClient) getHandleResponse(resp *http.Respon // capability - Ground Station Capability // options - AvailableGroundStationsClientListByCapabilityOptions contains the optional parameters for the AvailableGroundStationsClient.ListByCapability // method. -func (client *AvailableGroundStationsClient) NewListByCapabilityPager(capability CapabilityType, options *AvailableGroundStationsClientListByCapabilityOptions) *runtime.Pager[AvailableGroundStationsClientListByCapabilityResponse] { +func (client *AvailableGroundStationsClient) NewListByCapabilityPager(capability CapabilityParameter, options *AvailableGroundStationsClientListByCapabilityOptions) *runtime.Pager[AvailableGroundStationsClientListByCapabilityResponse] { return runtime.NewPager(runtime.PageProcessor[AvailableGroundStationsClientListByCapabilityResponse]{ More: func(page AvailableGroundStationsClientListByCapabilityResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -139,7 +139,7 @@ func (client *AvailableGroundStationsClient) NewListByCapabilityPager(capability } // listByCapabilityCreateRequest creates the ListByCapability request. -func (client *AvailableGroundStationsClient) listByCapabilityCreateRequest(ctx context.Context, capability CapabilityType, options *AvailableGroundStationsClientListByCapabilityOptions) (*policy.Request, error) { +func (client *AvailableGroundStationsClient) listByCapabilityCreateRequest(ctx context.Context, capability CapabilityParameter, options *AvailableGroundStationsClientListByCapabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/availableGroundStations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -150,7 +150,7 @@ func (client *AvailableGroundStationsClient) listByCapabilityCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") reqQP.Set("capability", string(capability)) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go index 837a0874ab7d..76f3be453955 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go @@ -10,38 +10,37 @@ package armorbital const ( moduleName = "armorbital" - moduleVersion = "v0.4.0" + moduleVersion = "v0.5.0" ) -// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. -type ActionType string +type APIVersionParameter string const ( - ActionTypeInternal ActionType = "Internal" + APIVersionParameterTwoThousandTwenty0901Preview APIVersionParameter = "2020-09-01-preview" + APIVersionParameterTwoThousandTwentyOne0404Preview APIVersionParameter = "2021-04-04-preview" + APIVersionParameterTwoThousandTwentyTwo0301 APIVersionParameter = "2022-03-01" ) -// PossibleActionTypeValues returns the possible values for the ActionType const type. -func PossibleActionTypeValues() []ActionType { - return []ActionType{ - ActionTypeInternal, +// PossibleAPIVersionParameterValues returns the possible values for the APIVersionParameter const type. +func PossibleAPIVersionParameterValues() []APIVersionParameter { + return []APIVersionParameter{ + APIVersionParameterTwoThousandTwenty0901Preview, + APIVersionParameterTwoThousandTwentyOne0404Preview, + APIVersionParameterTwoThousandTwentyTwo0301, } } -// AuthorizationStatus - Authorization status of spacecraft. -type AuthorizationStatus string +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string const ( - AuthorizationStatusAllowed AuthorizationStatus = "Allowed" - AuthorizationStatusPending AuthorizationStatus = "Pending" - AuthorizationStatusDenied AuthorizationStatus = "Denied" + ActionTypeInternal ActionType = "Internal" ) -// PossibleAuthorizationStatusValues returns the possible values for the AuthorizationStatus const type. -func PossibleAuthorizationStatusValues() []AuthorizationStatus { - return []AuthorizationStatus{ - AuthorizationStatusAllowed, - AuthorizationStatusPending, - AuthorizationStatusDenied, +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, } } @@ -79,18 +78,66 @@ func PossibleCapabilityValues() []Capability { } } -type CapabilityType string +type CapabilityParameter string const ( - CapabilityTypeCommunication CapabilityType = "Communication" - CapabilityTypeEarthObservation CapabilityType = "EarthObservation" + CapabilityParameterCommunication CapabilityParameter = "Communication" + CapabilityParameterEarthObservation CapabilityParameter = "EarthObservation" ) -// PossibleCapabilityTypeValues returns the possible values for the CapabilityType const type. -func PossibleCapabilityTypeValues() []CapabilityType { - return []CapabilityType{ - CapabilityTypeCommunication, - CapabilityTypeEarthObservation, +// PossibleCapabilityParameterValues returns the possible values for the CapabilityParameter const type. +func PossibleCapabilityParameterValues() []CapabilityParameter { + return []CapabilityParameter{ + CapabilityParameterCommunication, + CapabilityParameterEarthObservation, + } +} + +// ContactProfilesPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification +type ContactProfilesPropertiesProvisioningState string + +const ( + ContactProfilesPropertiesProvisioningStateCanceled ContactProfilesPropertiesProvisioningState = "Canceled" + ContactProfilesPropertiesProvisioningStateCreating ContactProfilesPropertiesProvisioningState = "Creating" + ContactProfilesPropertiesProvisioningStateDeleting ContactProfilesPropertiesProvisioningState = "Deleting" + ContactProfilesPropertiesProvisioningStateFailed ContactProfilesPropertiesProvisioningState = "Failed" + ContactProfilesPropertiesProvisioningStateSucceeded ContactProfilesPropertiesProvisioningState = "Succeeded" + ContactProfilesPropertiesProvisioningStateUpdating ContactProfilesPropertiesProvisioningState = "Updating" +) + +// PossibleContactProfilesPropertiesProvisioningStateValues returns the possible values for the ContactProfilesPropertiesProvisioningState const type. +func PossibleContactProfilesPropertiesProvisioningStateValues() []ContactProfilesPropertiesProvisioningState { + return []ContactProfilesPropertiesProvisioningState{ + ContactProfilesPropertiesProvisioningStateCanceled, + ContactProfilesPropertiesProvisioningStateCreating, + ContactProfilesPropertiesProvisioningStateDeleting, + ContactProfilesPropertiesProvisioningStateFailed, + ContactProfilesPropertiesProvisioningStateSucceeded, + ContactProfilesPropertiesProvisioningStateUpdating, + } +} + +// ContactsPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification +type ContactsPropertiesProvisioningState string + +const ( + ContactsPropertiesProvisioningStateCanceled ContactsPropertiesProvisioningState = "Canceled" + ContactsPropertiesProvisioningStateCreating ContactsPropertiesProvisioningState = "Creating" + ContactsPropertiesProvisioningStateDeleting ContactsPropertiesProvisioningState = "Deleting" + ContactsPropertiesProvisioningStateFailed ContactsPropertiesProvisioningState = "Failed" + ContactsPropertiesProvisioningStateSucceeded ContactsPropertiesProvisioningState = "Succeeded" + ContactsPropertiesProvisioningStateUpdating ContactsPropertiesProvisioningState = "Updating" +) + +// PossibleContactsPropertiesProvisioningStateValues returns the possible values for the ContactsPropertiesProvisioningState const type. +func PossibleContactsPropertiesProvisioningStateValues() []ContactsPropertiesProvisioningState { + return []ContactsPropertiesProvisioningState{ + ContactsPropertiesProvisioningStateCanceled, + ContactsPropertiesProvisioningStateCreating, + ContactsPropertiesProvisioningStateDeleting, + ContactsPropertiesProvisioningStateFailed, + ContactsPropertiesProvisioningStateSucceeded, + ContactsPropertiesProvisioningStateUpdating, } } @@ -153,7 +200,6 @@ func PossibleOriginValues() []Origin { type Polarization string const ( - PolarizationDualRhcpLhcp Polarization = "dualRhcpLhcp" PolarizationLHCP Polarization = "LHCP" PolarizationLinearHorizontal Polarization = "linearHorizontal" PolarizationLinearVertical Polarization = "linearVertical" @@ -163,7 +209,6 @@ const ( // PossiblePolarizationValues returns the possible values for the Polarization const type. func PossiblePolarizationValues() []Polarization { return []Polarization{ - PolarizationDualRhcpLhcp, PolarizationLHCP, PolarizationLinearHorizontal, PolarizationLinearVertical, @@ -187,6 +232,70 @@ func PossibleProtocolValues() []Protocol { } } +// ProvisioningState - The current state of the resource's creation, deletion, or modification +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateCanceled, + ProvisioningStateCreating, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + +// ReleaseMode - Release Status of a ground station +type ReleaseMode string + +const ( + ReleaseModeGA ReleaseMode = "GA" + ReleaseModePreview ReleaseMode = "Preview" +) + +// PossibleReleaseModeValues returns the possible values for the ReleaseMode const type. +func PossibleReleaseModeValues() []ReleaseMode { + return []ReleaseMode{ + ReleaseModeGA, + ReleaseModePreview, + } +} + +// SpacecraftsPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification +type SpacecraftsPropertiesProvisioningState string + +const ( + SpacecraftsPropertiesProvisioningStateCanceled SpacecraftsPropertiesProvisioningState = "Canceled" + SpacecraftsPropertiesProvisioningStateCreating SpacecraftsPropertiesProvisioningState = "Creating" + SpacecraftsPropertiesProvisioningStateDeleting SpacecraftsPropertiesProvisioningState = "Deleting" + SpacecraftsPropertiesProvisioningStateFailed SpacecraftsPropertiesProvisioningState = "Failed" + SpacecraftsPropertiesProvisioningStateSucceeded SpacecraftsPropertiesProvisioningState = "Succeeded" + SpacecraftsPropertiesProvisioningStateUpdating SpacecraftsPropertiesProvisioningState = "Updating" +) + +// PossibleSpacecraftsPropertiesProvisioningStateValues returns the possible values for the SpacecraftsPropertiesProvisioningState const type. +func PossibleSpacecraftsPropertiesProvisioningStateValues() []SpacecraftsPropertiesProvisioningState { + return []SpacecraftsPropertiesProvisioningState{ + SpacecraftsPropertiesProvisioningStateCanceled, + SpacecraftsPropertiesProvisioningStateCreating, + SpacecraftsPropertiesProvisioningStateDeleting, + SpacecraftsPropertiesProvisioningStateFailed, + SpacecraftsPropertiesProvisioningStateSucceeded, + SpacecraftsPropertiesProvisioningStateUpdating, + } +} + // Status - Status of a contact. type Status string @@ -196,6 +305,10 @@ const ( StatusSucceeded Status = "succeeded" StatusFailed Status = "failed" StatusProviderCancelled Status = "providerCancelled" + StatusSucceeded Status = "Succeeded" + StatusCanceled Status = "Canceled" + StatusFailed Status = "Failed" + StatusRunning Status = "Running" ) // PossibleStatusValues returns the possible values for the Status const type. @@ -206,5 +319,9 @@ func PossibleStatusValues() []Status { StatusSucceeded, StatusFailed, StatusProviderCancelled, + StatusSucceeded, + StatusCanceled, + StatusFailed, + StatusRunning, } } diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go index d590290cb680..f9ea0798efb5 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go @@ -95,14 +95,14 @@ func (client *ContactProfilesClient) createOrUpdate(ctx context.Context, resourc // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *ContactProfilesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, contactProfileName string, parameters ContactProfile, options *ContactProfilesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/contactProfiles/{contactProfileName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if contactProfileName == "" { return nil, errors.New("parameter contactProfileName cannot be empty") } @@ -112,7 +112,7 @@ func (client *ContactProfilesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -158,14 +158,14 @@ func (client *ContactProfilesClient) deleteOperation(ctx context.Context, resour // deleteCreateRequest creates the Delete request. func (client *ContactProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, contactProfileName string, options *ContactProfilesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/contactProfiles/{contactProfileName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if contactProfileName == "" { return nil, errors.New("parameter contactProfileName cannot be empty") } @@ -175,7 +175,7 @@ func (client *ContactProfilesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -204,14 +204,14 @@ func (client *ContactProfilesClient) Get(ctx context.Context, resourceGroupName // getCreateRequest creates the Get request. func (client *ContactProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, contactProfileName string, options *ContactProfilesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/contactProfiles/{contactProfileName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if contactProfileName == "" { return nil, errors.New("parameter contactProfileName cannot be empty") } @@ -221,7 +221,7 @@ func (client *ContactProfilesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -236,17 +236,23 @@ func (client *ContactProfilesClient) getHandleResponse(resp *http.Response) (Con return result, nil } -// NewListPager - Returns list of contact profiles +// NewListPager - Returns list of contact profiles by Resource Group // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ContactProfilesClientListOptions contains the optional parameters for the ContactProfilesClient.List method. func (client *ContactProfilesClient) NewListPager(resourceGroupName string, options *ContactProfilesClientListOptions) *runtime.Pager[ContactProfilesClientListResponse] { return runtime.NewPager(runtime.PageProcessor[ContactProfilesClientListResponse]{ More: func(page ContactProfilesClientListResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ContactProfilesClientListResponse) (ContactProfilesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return ContactProfilesClientListResponse{}, err } @@ -265,20 +271,23 @@ func (client *ContactProfilesClient) NewListPager(resourceGroupName string, opti // listCreateRequest creates the List request. func (client *ContactProfilesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ContactProfilesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/contactProfiles" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") + if options != nil && options.Skiptoken != nil { + reqQP.Set("$skiptoken", *options.Skiptoken) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -293,17 +302,23 @@ func (client *ContactProfilesClient) listHandleResponse(resp *http.Response) (Co return result, nil } -// NewListBySubscriptionPager - Returns list of contact profiles +// NewListBySubscriptionPager - Returns list of contact profiles by Subscription // If the operation fails it returns an *azcore.ResponseError type. // options - ContactProfilesClientListBySubscriptionOptions contains the optional parameters for the ContactProfilesClient.ListBySubscription // method. func (client *ContactProfilesClient) NewListBySubscriptionPager(options *ContactProfilesClientListBySubscriptionOptions) *runtime.Pager[ContactProfilesClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PageProcessor[ContactProfilesClientListBySubscriptionResponse]{ More: func(page ContactProfilesClientListBySubscriptionResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ContactProfilesClientListBySubscriptionResponse) (ContactProfilesClientListBySubscriptionResponse, error) { - req, err := client.listBySubscriptionCreateRequest(ctx, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return ContactProfilesClientListBySubscriptionResponse{}, err } @@ -331,7 +346,10 @@ func (client *ContactProfilesClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") + if options != nil && options.Skiptoken != nil { + reqQP.Set("$skiptoken", *options.Skiptoken) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -346,39 +364,55 @@ func (client *ContactProfilesClient) listBySubscriptionHandleResponse(resp *http return result, nil } -// UpdateTags - Updates the specified contact profile tags. +// BeginUpdateTags - Updates the specified contact profile tags. // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. The name is case insensitive. // contactProfileName - Contact Profile Name // parameters - Parameters supplied to update contact profile tags. -// options - ContactProfilesClientUpdateTagsOptions contains the optional parameters for the ContactProfilesClient.UpdateTags +// options - ContactProfilesClientBeginUpdateTagsOptions contains the optional parameters for the ContactProfilesClient.BeginUpdateTags // method. -func (client *ContactProfilesClient) UpdateTags(ctx context.Context, resourceGroupName string, contactProfileName string, parameters TagsObject, options *ContactProfilesClientUpdateTagsOptions) (ContactProfilesClientUpdateTagsResponse, error) { +func (client *ContactProfilesClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, contactProfileName string, parameters TagsObject, options *ContactProfilesClientBeginUpdateTagsOptions) (*armruntime.Poller[ContactProfilesClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, contactProfileName, parameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[ContactProfilesClientUpdateTagsResponse]{ + FinalStateVia: armruntime.FinalStateViaLocation, + }) + } else { + return armruntime.NewPollerFromResumeToken[ContactProfilesClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) + } +} + +// UpdateTags - Updates the specified contact profile tags. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *ContactProfilesClient) updateTags(ctx context.Context, resourceGroupName string, contactProfileName string, parameters TagsObject, options *ContactProfilesClientBeginUpdateTagsOptions) (*http.Response, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, contactProfileName, parameters, options) if err != nil { - return ContactProfilesClientUpdateTagsResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return ContactProfilesClientUpdateTagsResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContactProfilesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return client.updateTagsHandleResponse(resp) + return resp, nil } // updateTagsCreateRequest creates the UpdateTags request. -func (client *ContactProfilesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, contactProfileName string, parameters TagsObject, options *ContactProfilesClientUpdateTagsOptions) (*policy.Request, error) { +func (client *ContactProfilesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, contactProfileName string, parameters TagsObject, options *ContactProfilesClientBeginUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/contactProfiles/{contactProfileName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if contactProfileName == "" { return nil, errors.New("parameter contactProfileName cannot be empty") } @@ -388,17 +422,8 @@ func (client *ContactProfilesClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) } - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *ContactProfilesClient) updateTagsHandleResponse(resp *http.Response) (ContactProfilesClientUpdateTagsResponse, error) { - result := ContactProfilesClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ContactProfile); err != nil { - return ContactProfilesClientUpdateTagsResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go index b1d1a5217a8a..ec7c3906781c 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go @@ -95,14 +95,14 @@ func (client *ContactsClient) create(ctx context.Context, resourceGroupName stri // createCreateRequest creates the Create request. func (client *ContactsClient) createCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, parameters Contact, options *ContactsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}/contacts/{contactName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -116,7 +116,7 @@ func (client *ContactsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -162,14 +162,14 @@ func (client *ContactsClient) deleteOperation(ctx context.Context, resourceGroup // deleteCreateRequest creates the Delete request. func (client *ContactsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, options *ContactsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}/contacts/{contactName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -183,7 +183,7 @@ func (client *ContactsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -213,14 +213,14 @@ func (client *ContactsClient) Get(ctx context.Context, resourceGroupName string, // getCreateRequest creates the Get request. func (client *ContactsClient) getCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, options *ContactsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}/contacts/{contactName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -234,7 +234,7 @@ func (client *ContactsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -257,10 +257,16 @@ func (client *ContactsClient) getHandleResponse(resp *http.Response) (ContactsCl func (client *ContactsClient) NewListPager(resourceGroupName string, spacecraftName string, options *ContactsClientListOptions) *runtime.Pager[ContactsClientListResponse] { return runtime.NewPager(runtime.PageProcessor[ContactsClientListResponse]{ More: func(page ContactsClientListResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ContactsClientListResponse) (ContactsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, spacecraftName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, spacecraftName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return ContactsClientListResponse{}, err } @@ -279,14 +285,14 @@ func (client *ContactsClient) NewListPager(resourceGroupName string, spacecraftN // listCreateRequest creates the List request. func (client *ContactsClient) listCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, options *ContactsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}/contacts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -296,7 +302,10 @@ func (client *ContactsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") + if options != nil && options.Skiptoken != nil { + reqQP.Set("$skiptoken", *options.Skiptoken) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go new file mode 100644 index 000000000000..2a185d25435a --- /dev/null +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go @@ -0,0 +1,59 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armorbital + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "strings" + "time" +) + +const ( + fullDateJSON = `"2006-01-02"` + jsonFormat = `"%04d-%02d-%02d"` +) + +type dateType time.Time + +func (t dateType) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(jsonFormat, time.Time(t).Year(), time.Time(t).Month(), time.Time(t).Day())), nil +} + +func (d *dateType) UnmarshalJSON(data []byte) (err error) { + t, err := time.Parse(fullDateJSON, string(data)) + *d = (dateType)(t) + return err +} + +func populateDateType(m map[string]interface{}, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateType)(t) +} + +func unpopulateDateType(data json.RawMessage, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux dateType + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_models.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_models.go index 04632be4bf6c..3a56dc33353a 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_models.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_models.go @@ -10,14 +10,23 @@ package armorbital import "time" +// AuthorizedGroundstation - Authorized groundstation +type AuthorizedGroundstation struct { + // Date of authorization expiration + ExpirationDate *time.Time `json:"expirationDate,omitempty"` + + // Groundstation name + GroundStation *string `json:"groundStation,omitempty"` +} + // AvailableContacts - Customer retrieves list of Available Contacts for a spacecraft resource. Later, one of the available // contact can be selected to create a contact. type AvailableContacts struct { // Properties of Contact resource. - Properties *ContactInstanceProperties `json:"properties,omitempty"` + Properties *AvailableContactsProperties `json:"properties,omitempty"` // The reference to the spacecraft resource. - Spacecraft *ResourceReference `json:"spacecraft,omitempty"` + Spacecraft *AvailableContactsSpacecraft `json:"spacecraft,omitempty"` // READ-ONLY; Name of Azure Ground Station. GroundStationName *string `json:"groundStationName,omitempty" azure:"ro"` @@ -32,6 +41,42 @@ type AvailableContactsListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } +// AvailableContactsProperties - Properties of Contact resource. +type AvailableContactsProperties struct { + // READ-ONLY; Azimuth of the antenna at the end of the contact in decimal degrees. + EndAzimuthDegrees *float32 `json:"endAzimuthDegrees,omitempty" azure:"ro"` + + // READ-ONLY; Spacecraft elevation above the horizon at contact end. + EndElevationDegrees *float32 `json:"endElevationDegrees,omitempty" azure:"ro"` + + // READ-ONLY; Maximum elevation of the antenna during the contact in decimal degrees. + MaximumElevationDegrees *float32 `json:"maximumElevationDegrees,omitempty" azure:"ro"` + + // READ-ONLY; Time to lost receiving a signal. + RxEndTime *time.Time `json:"rxEndTime,omitempty" azure:"ro"` + + // READ-ONLY; Earliest time to receive a signal. + RxStartTime *time.Time `json:"rxStartTime,omitempty" azure:"ro"` + + // READ-ONLY; Azimuth of the antenna at the start of the contact in decimal degrees. + StartAzimuthDegrees *float32 `json:"startAzimuthDegrees,omitempty" azure:"ro"` + + // READ-ONLY; Spacecraft elevation above the horizon at contact start. + StartElevationDegrees *float32 `json:"startElevationDegrees,omitempty" azure:"ro"` + + // READ-ONLY; Time at which antenna transmit will be disabled. + TxEndTime *time.Time `json:"txEndTime,omitempty" azure:"ro"` + + // READ-ONLY; Time at which antenna transmit will be enabled. + TxStartTime *time.Time `json:"txStartTime,omitempty" azure:"ro"` +} + +// AvailableContactsSpacecraft - The reference to the spacecraft resource. +type AvailableContactsSpacecraft struct { + // Resource ID. + ID *string `json:"id,omitempty"` +} + // AvailableGroundStation - GroundStations available to schedule Contacts type AvailableGroundStation struct { // Azure region @@ -59,7 +104,7 @@ type AvailableGroundStationListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// AvailableGroundStationProperties - Properties object for Available groundstation. +// AvailableGroundStationProperties - The properties bag for this resource type AvailableGroundStationProperties struct { // Altitude of the ground station AltitudeMeters *float32 `json:"altitudeMeters,omitempty"` @@ -75,6 +120,30 @@ type AvailableGroundStationProperties struct { // Ground station provider name. ProviderName *string `json:"providerName,omitempty"` + + // Release Status of a ground station + ReleaseMode *ReleaseMode `json:"releaseMode,omitempty"` +} + +// AvailableGroundStationPropertiesAutoGenerated - Properties object for Available groundstation. +type AvailableGroundStationPropertiesAutoGenerated struct { + // Altitude of the ground station + AltitudeMeters *float32 `json:"altitudeMeters,omitempty"` + + // City of ground station. + City *string `json:"city,omitempty"` + + // Latitude of the ground station in decimal degrees. + LatitudeDegrees *float32 `json:"latitudeDegrees,omitempty"` + + // Longitude of the ground station in decimal degrees. + LongitudeDegrees *float32 `json:"longitudeDegrees,omitempty"` + + // Ground station provider name. + ProviderName *string `json:"providerName,omitempty"` + + // Release Status of a ground station + ReleaseMode *ReleaseMode `json:"releaseMode,omitempty"` } // AvailableGroundStationsClientGetOptions contains the optional parameters for the AvailableGroundStationsClient.Get method. @@ -172,7 +241,7 @@ type ContactListResult struct { // ContactParameters - Parameters that define the contact resource. type ContactParameters struct { // REQUIRED; The reference to the contact profile resource. - ContactProfile *ResourceReference `json:"contactProfile,omitempty"` + ContactProfile *ContactParametersContactProfile `json:"contactProfile,omitempty"` // REQUIRED; End time of a contact. EndTime *time.Time `json:"endTime,omitempty"` @@ -184,14 +253,20 @@ type ContactParameters struct { StartTime *time.Time `json:"startTime,omitempty"` } +// ContactParametersContactProfile - The reference to the contact profile resource. +type ContactParametersContactProfile struct { + // Resource ID. + ID *string `json:"id,omitempty"` +} + // ContactProfile - Customer creates a Contact Profile Resource, which will contain all of the configurations required for // scheduling a contact. type ContactProfile struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Properties of the spacecraft resource. - Properties *ContactProfilesProperties `json:"properties,omitempty"` + // Properties of the contact profile resource. + Properties *ContactProfileProperties `json:"properties,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` @@ -212,7 +287,7 @@ type ContactProfile struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ContactProfileLink - Contact Profile link +// ContactProfileLink - Contact Profile Link type ContactProfileLink struct { // REQUIRED; Contact Profile Link Channel Channels []*ContactProfileLinkChannel `json:"channels,omitempty"` @@ -220,6 +295,9 @@ type ContactProfileLink struct { // REQUIRED; Direction (uplink or downlink) Direction *Direction `json:"direction,omitempty"` + // REQUIRED; Link name + Name *string `json:"name,omitempty"` + // REQUIRED; polarization. eg (RHCP, LHCP) Polarization *Polarization `json:"polarization,omitempty"` @@ -241,6 +319,9 @@ type ContactProfileLinkChannel struct { // REQUIRED; Customer End point to store/retrieve data during a contact. EndPoint *EndPoint `json:"endPoint,omitempty"` + // REQUIRED; Channel name + Name *string `json:"name,omitempty"` + // Configuration for decoding DecodingConfiguration *string `json:"decodingConfiguration,omitempty"` @@ -263,6 +344,30 @@ type ContactProfileListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } +// ContactProfileProperties - Properties of the contact profile resource. +type ContactProfileProperties struct { + // REQUIRED; Links of the Contact Profile + Links []*ContactProfileLink `json:"links,omitempty"` + + // REQUIRED; Network configuration of customer virtual network. + NetworkConfiguration *ContactProfilesPropertiesNetworkConfiguration `json:"networkConfiguration,omitempty"` + + // Auto track configuration. + AutoTrackingConfiguration *AutoTrackingConfiguration `json:"autoTrackingConfiguration,omitempty"` + + // The URI of the Event Hub used for telemetry + EventHubURI *string `json:"eventHubUri,omitempty"` + + // Minimum viable elevation for the contact in decimal degrees. + MinimumElevationDegrees *float32 `json:"minimumElevationDegrees,omitempty"` + + // Minimum viable contact duration in ISO 8601 format. + MinimumViableContactDuration *string `json:"minimumViableContactDuration,omitempty"` + + // The current state of the resource's creation, deletion, or modification + ProvisioningState *ContactProfilesPropertiesProvisioningState `json:"provisioningState,omitempty"` +} + // ContactProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the ContactProfilesClient.BeginCreateOrUpdate // method. type ContactProfilesClientBeginCreateOrUpdateOptions struct { @@ -276,6 +381,13 @@ type ContactProfilesClientBeginDeleteOptions struct { ResumeToken string } +// ContactProfilesClientBeginUpdateTagsOptions contains the optional parameters for the ContactProfilesClient.BeginUpdateTags +// method. +type ContactProfilesClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ContactProfilesClientGetOptions contains the optional parameters for the ContactProfilesClient.Get method. type ContactProfilesClientGetOptions struct { // placeholder for future optional parameters @@ -284,17 +396,20 @@ type ContactProfilesClientGetOptions struct { // ContactProfilesClientListBySubscriptionOptions contains the optional parameters for the ContactProfilesClient.ListBySubscription // method. type ContactProfilesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters + // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous + // list operation call returned a partial result. If a previous response contains a + // nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point + // to use for subsequent calls. + Skiptoken *string } // ContactProfilesClientListOptions contains the optional parameters for the ContactProfilesClient.List method. type ContactProfilesClientListOptions struct { - // placeholder for future optional parameters -} - -// ContactProfilesClientUpdateTagsOptions contains the optional parameters for the ContactProfilesClient.UpdateTags method. -type ContactProfilesClientUpdateTagsOptions struct { - // placeholder for future optional parameters + // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous + // list operation call returned a partial result. If a previous response contains a + // nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point + // to use for subsequent calls. + Skiptoken *string } // ContactProfilesProperties - List of Contact Profile Resource Properties. @@ -302,6 +417,9 @@ type ContactProfilesProperties struct { // REQUIRED; Links of the Contact Profile Links []*ContactProfileLink `json:"links,omitempty"` + // REQUIRED; Network configuration of customer virtual network. + NetworkConfiguration *ContactProfilesPropertiesNetworkConfiguration `json:"networkConfiguration,omitempty"` + // Auto track configuration. AutoTrackingConfiguration *AutoTrackingConfiguration `json:"autoTrackingConfiguration,omitempty"` @@ -313,6 +431,15 @@ type ContactProfilesProperties struct { // Minimum viable contact duration in ISO 8601 format. MinimumViableContactDuration *string `json:"minimumViableContactDuration,omitempty"` + + // The current state of the resource's creation, deletion, or modification + ProvisioningState *ContactProfilesPropertiesProvisioningState `json:"provisioningState,omitempty"` +} + +// ContactProfilesPropertiesNetworkConfiguration - Network configuration of customer virtual network. +type ContactProfilesPropertiesNetworkConfiguration struct { + // REQUIRED; Customer subnet ARM resource identifier. + SubnetID *string `json:"subnetId,omitempty"` } // ContactsClientBeginCreateOptions contains the optional parameters for the ContactsClient.BeginCreate method. @@ -334,13 +461,17 @@ type ContactsClientGetOptions struct { // ContactsClientListOptions contains the optional parameters for the ContactsClient.List method. type ContactsClientListOptions struct { - // placeholder for future optional parameters + // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous + // list operation call returned a partial result. If a previous response contains a + // nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point + // to use for subsequent calls. + Skiptoken *string } // ContactsProperties - Properties of the Contact Resource. type ContactsProperties struct { // REQUIRED; The reference to the contact profile resource. - ContactProfile *ResourceReference `json:"contactProfile,omitempty"` + ContactProfile *ContactsPropertiesContactProfile `json:"contactProfile,omitempty"` // REQUIRED; Azure Ground Station name. GroundStationName *string `json:"groundStationName,omitempty"` @@ -351,6 +482,12 @@ type ContactsProperties struct { // REQUIRED; Reservation start time of a contact. ReservationStartTime *time.Time `json:"reservationStartTime,omitempty"` + // The current state of the resource's creation, deletion, or modification + ProvisioningState *ContactsPropertiesProvisioningState `json:"provisioningState,omitempty"` + + // READ-ONLY; The configuration associated with the allocated antenna. + AntennaConfiguration *ContactsPropertiesAntennaConfiguration `json:"antennaConfiguration,omitempty" azure:"ro"` + // READ-ONLY; Azimuth of the antenna at the end of the contact in decimal degrees. EndAzimuthDegrees *float32 `json:"endAzimuthDegrees,omitempty" azure:"ro"` @@ -385,6 +522,21 @@ type ContactsProperties struct { TxStartTime *time.Time `json:"txStartTime,omitempty" azure:"ro"` } +// ContactsPropertiesAntennaConfiguration - The configuration associated with the allocated antenna. +type ContactsPropertiesAntennaConfiguration struct { + // The destination IP a packet can be sent to. This would for example be the TCP endpoint you would send data to. + DestinationIP *string `json:"destinationIp,omitempty"` + + // List of Source IP + SourceIPs []*string `json:"sourceIps,omitempty"` +} + +// ContactsPropertiesContactProfile - The reference to the contact profile resource. +type ContactsPropertiesContactProfile struct { + // Resource ID. + ID *string `json:"id,omitempty"` +} + // EndPoint - Customer End point to store/retrieve data during a contact. type EndPoint struct { // REQUIRED; Name of an end point. @@ -449,11 +601,53 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty" azure:"ro"` } +// OperationResult - Operation Result Entity. +type OperationResult struct { + // Operation result error properties + Error *OperationResultErrorProperties `json:"error,omitempty"` + + // Operation result properties + Properties interface{} `json:"properties,omitempty"` + + // Status of a contact. + Status *Status `json:"status,omitempty"` + + // READ-ONLY; The operation end time + EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` + + // READ-ONLY; ID of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Percentage completed. + PercentComplete *float64 `json:"percentComplete,omitempty" azure:"ro"` + + // READ-ONLY; The operation start time + StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` +} + +// OperationResultErrorProperties - Operation result error properties +type OperationResultErrorProperties struct { + // READ-ONLY; The code of the error. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. type OperationsClientListOptions struct { // placeholder for future optional parameters } +// OperationsResultsClientBeginGetOptions contains the optional parameters for the OperationsResultsClient.BeginGet method. +type OperationsResultsClientBeginGetOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -533,7 +727,7 @@ type Spacecraft struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SpacecraftLink - Spacecraft Link +// SpacecraftLink - Authorized Ground Stations for the link type SpacecraftLink struct { // REQUIRED; Bandwidth in MHz BandwidthMHz *float32 `json:"bandwidthMHz,omitempty"` @@ -544,8 +738,14 @@ type SpacecraftLink struct { // REQUIRED; Direction (uplink or downlink) Direction *Direction `json:"direction,omitempty"` + // REQUIRED; Link name + Name *string `json:"name,omitempty"` + // REQUIRED; polarization. eg (RHCP, LHCP) Polarization *Polarization `json:"polarization,omitempty"` + + // READ-ONLY; Authorized Ground Stations + Authorizations []*AuthorizedGroundstation `json:"authorizations,omitempty" azure:"ro"` } // SpacecraftListResult - Response for the ListSpacecrafts API service call. @@ -577,6 +777,12 @@ type SpacecraftsClientBeginListAvailableContactsOptions struct { ResumeToken string } +// SpacecraftsClientBeginUpdateTagsOptions contains the optional parameters for the SpacecraftsClient.BeginUpdateTags method. +type SpacecraftsClientBeginUpdateTagsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // SpacecraftsClientGetOptions contains the optional parameters for the SpacecraftsClient.Get method. type SpacecraftsClientGetOptions struct { // placeholder for future optional parameters @@ -585,17 +791,20 @@ type SpacecraftsClientGetOptions struct { // SpacecraftsClientListBySubscriptionOptions contains the optional parameters for the SpacecraftsClient.ListBySubscription // method. type SpacecraftsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters + // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous + // list operation call returned a partial result. If a previous response contains a + // nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point + // to use for subsequent calls. + Skiptoken *string } // SpacecraftsClientListOptions contains the optional parameters for the SpacecraftsClient.List method. type SpacecraftsClientListOptions struct { - // placeholder for future optional parameters -} - -// SpacecraftsClientUpdateTagsOptions contains the optional parameters for the SpacecraftsClient.UpdateTags method. -type SpacecraftsClientUpdateTagsOptions struct { - // placeholder for future optional parameters + // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous + // list operation call returned a partial result. If a previous response contains a + // nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point + // to use for subsequent calls. + Skiptoken *string } // SpacecraftsProperties - List of Spacecraft Resource Properties. @@ -606,6 +815,9 @@ type SpacecraftsProperties struct { // Links of the Spacecraft Links []*SpacecraftLink `json:"links,omitempty"` + // The current state of the resource's creation, deletion, or modification + ProvisioningState *SpacecraftsPropertiesProvisioningState `json:"provisioningState,omitempty"` + // Title line of Two Line Element (TLE). TitleLine *string `json:"titleLine,omitempty"` @@ -614,12 +826,6 @@ type SpacecraftsProperties struct { // Line 2 of Two Line Element (TLE). TleLine2 *string `json:"tleLine2,omitempty"` - - // READ-ONLY; Authorization status of spacecraft. - AuthorizationStatus *AuthorizationStatus `json:"authorizationStatus,omitempty" azure:"ro"` - - // READ-ONLY; Details of the authorization status. - AuthorizationStatusExtended *string `json:"authorizationStatusExtended,omitempty" azure:"ro"` } // SystemData - Metadata pertaining to creation and last modification of the resource. diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_models_serde.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_models_serde.go index 33dab03a7363..9222a92371e7 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_models_serde.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_models_serde.go @@ -14,6 +14,37 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type AuthorizedGroundstation. +func (a AuthorizedGroundstation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateDateType(objectMap, "expirationDate", a.ExpirationDate) + populate(objectMap, "groundStation", a.GroundStation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizedGroundstation. +func (a *AuthorizedGroundstation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationDate": + err = unpopulateDateType(val, &a.ExpirationDate) + delete(rawMsg, key) + case "groundStation": + err = unpopulate(val, &a.GroundStation) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AvailableContactsListResult. func (a AvailableContactsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -22,6 +53,65 @@ func (a AvailableContactsListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type AvailableContactsProperties. +func (a AvailableContactsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endAzimuthDegrees", a.EndAzimuthDegrees) + populate(objectMap, "endElevationDegrees", a.EndElevationDegrees) + populate(objectMap, "maximumElevationDegrees", a.MaximumElevationDegrees) + populateTimeRFC3339(objectMap, "rxEndTime", a.RxEndTime) + populateTimeRFC3339(objectMap, "rxStartTime", a.RxStartTime) + populate(objectMap, "startAzimuthDegrees", a.StartAzimuthDegrees) + populate(objectMap, "startElevationDegrees", a.StartElevationDegrees) + populateTimeRFC3339(objectMap, "txEndTime", a.TxEndTime) + populateTimeRFC3339(objectMap, "txStartTime", a.TxStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableContactsProperties. +func (a *AvailableContactsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endAzimuthDegrees": + err = unpopulate(val, &a.EndAzimuthDegrees) + delete(rawMsg, key) + case "endElevationDegrees": + err = unpopulate(val, &a.EndElevationDegrees) + delete(rawMsg, key) + case "maximumElevationDegrees": + err = unpopulate(val, &a.MaximumElevationDegrees) + delete(rawMsg, key) + case "rxEndTime": + err = unpopulateTimeRFC3339(val, &a.RxEndTime) + delete(rawMsg, key) + case "rxStartTime": + err = unpopulateTimeRFC3339(val, &a.RxStartTime) + delete(rawMsg, key) + case "startAzimuthDegrees": + err = unpopulate(val, &a.StartAzimuthDegrees) + delete(rawMsg, key) + case "startElevationDegrees": + err = unpopulate(val, &a.StartElevationDegrees) + delete(rawMsg, key) + case "txEndTime": + err = unpopulateTimeRFC3339(val, &a.TxEndTime) + delete(rawMsg, key) + case "txStartTime": + err = unpopulateTimeRFC3339(val, &a.TxStartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AvailableGroundStationListResult. func (a AvailableGroundStationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -167,6 +257,7 @@ func (c ContactProfileLink) MarshalJSON() ([]byte, error) { populate(objectMap, "direction", c.Direction) populate(objectMap, "eirpdBW", c.EirpdBW) populate(objectMap, "gainOverTemperature", c.GainOverTemperature) + populate(objectMap, "name", c.Name) populate(objectMap, "polarization", c.Polarization) return json.Marshal(objectMap) } @@ -179,6 +270,19 @@ func (c ContactProfileListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type ContactProfileProperties. +func (c ContactProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoTrackingConfiguration", c.AutoTrackingConfiguration) + populate(objectMap, "eventHubUri", c.EventHubURI) + populate(objectMap, "links", c.Links) + populate(objectMap, "minimumElevationDegrees", c.MinimumElevationDegrees) + populate(objectMap, "minimumViableContactDuration", c.MinimumViableContactDuration) + populate(objectMap, "networkConfiguration", c.NetworkConfiguration) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type ContactProfilesProperties. func (c ContactProfilesProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -187,18 +291,22 @@ func (c ContactProfilesProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "links", c.Links) populate(objectMap, "minimumElevationDegrees", c.MinimumElevationDegrees) populate(objectMap, "minimumViableContactDuration", c.MinimumViableContactDuration) + populate(objectMap, "networkConfiguration", c.NetworkConfiguration) + populate(objectMap, "provisioningState", c.ProvisioningState) return json.Marshal(objectMap) } // MarshalJSON implements the json.Marshaller interface for type ContactsProperties. func (c ContactsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "antennaConfiguration", c.AntennaConfiguration) populate(objectMap, "contactProfile", c.ContactProfile) populate(objectMap, "endAzimuthDegrees", c.EndAzimuthDegrees) populate(objectMap, "endElevationDegrees", c.EndElevationDegrees) populate(objectMap, "errorMessage", c.ErrorMessage) populate(objectMap, "groundStationName", c.GroundStationName) populate(objectMap, "maximumElevationDegrees", c.MaximumElevationDegrees) + populate(objectMap, "provisioningState", c.ProvisioningState) populateTimeRFC3339(objectMap, "reservationEndTime", c.ReservationEndTime) populateTimeRFC3339(objectMap, "reservationStartTime", c.ReservationStartTime) populateTimeRFC3339(objectMap, "rxEndTime", c.RxEndTime) @@ -220,6 +328,9 @@ func (c *ContactsProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "antennaConfiguration": + err = unpopulate(val, &c.AntennaConfiguration) + delete(rawMsg, key) case "contactProfile": err = unpopulate(val, &c.ContactProfile) delete(rawMsg, key) @@ -238,6 +349,9 @@ func (c *ContactsProperties) UnmarshalJSON(data []byte) error { case "maximumElevationDegrees": err = unpopulate(val, &c.MaximumElevationDegrees) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &c.ProvisioningState) + delete(rawMsg, key) case "reservationEndTime": err = unpopulateTimeRFC3339(val, &c.ReservationEndTime) delete(rawMsg, key) @@ -273,6 +387,14 @@ func (c *ContactsProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ContactsPropertiesAntennaConfiguration. +func (c ContactsPropertiesAntennaConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destinationIp", c.DestinationIP) + populate(objectMap, "sourceIps", c.SourceIPs) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -281,6 +403,61 @@ func (o OperationListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type OperationResult. +func (o OperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "percentComplete", o.PercentComplete) + populate(objectMap, "properties", &o.Properties) + populateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResult. +func (o *OperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &o.Name) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, &o.PercentComplete) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &o.Status) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ResourceIDListResult. func (r ResourceIDListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -303,6 +480,18 @@ func (s Spacecraft) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type SpacecraftLink. +func (s SpacecraftLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorizations", s.Authorizations) + populate(objectMap, "bandwidthMHz", s.BandwidthMHz) + populate(objectMap, "centerFrequencyMHz", s.CenterFrequencyMHz) + populate(objectMap, "direction", s.Direction) + populate(objectMap, "name", s.Name) + populate(objectMap, "polarization", s.Polarization) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type SpacecraftListResult. func (s SpacecraftListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -314,10 +503,9 @@ func (s SpacecraftListResult) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type SpacecraftsProperties. func (s SpacecraftsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationStatus", s.AuthorizationStatus) - populate(objectMap, "authorizationStatusExtended", s.AuthorizationStatusExtended) populate(objectMap, "links", s.Links) populate(objectMap, "noradId", s.NoradID) + populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "titleLine", s.TitleLine) populate(objectMap, "tleLine1", s.TleLine1) populate(objectMap, "tleLine2", s.TleLine2) diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_operations_client.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_operations_client.go index 740507e753a5..e76a9ab73b82 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_operations_client.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_operations_client.go @@ -81,7 +81,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go new file mode 100644 index 000000000000..682914bbc59b --- /dev/null +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go @@ -0,0 +1,116 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armorbital + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// OperationsResultsClient contains the methods for the OperationsResults group. +// Don't use this type directly, use NewOperationsResultsClient() instead. +type OperationsResultsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewOperationsResultsClient creates a new instance of OperationsResultsClient with the specified values. +// subscriptionID - The ID of the target subscription. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewOperationsResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsResultsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &OperationsResultsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginGet - Returns operation results. +// If the operation fails it returns an *azcore.ResponseError type. +// location - The name of Azure region. +// operationID - The ID of an ongoing async operation. +// options - OperationsResultsClientBeginGetOptions contains the optional parameters for the OperationsResultsClient.BeginGet +// method. +func (client *OperationsResultsClient) BeginGet(ctx context.Context, location string, operationID string, options *OperationsResultsClientBeginGetOptions) (*armruntime.Poller[OperationsResultsClientGetResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.get(ctx, location, operationID, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[OperationsResultsClientGetResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[OperationsResultsClientGetResponse](options.ResumeToken, client.pl, nil) + } +} + +// Get - Returns operation results. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *OperationsResultsClient) get(ctx context.Context, location string, operationID string, options *OperationsResultsClientBeginGetOptions) (*http.Response, error) { + req, err := client.getCreateRequest(ctx, location, operationID, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// getCreateRequest creates the Get request. +func (client *OperationsResultsClient) getCreateRequest(ctx context.Context, location string, operationID string, options *OperationsResultsClientBeginGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/locations/{location}/operationResults/{operationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go index 47707a5cf8ec..bc0f29cdbb34 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go @@ -73,6 +73,11 @@ type OperationsClientListResponse struct { OperationListResult } +// OperationsResultsClientGetResponse contains the response from method OperationsResultsClient.Get. +type OperationsResultsClientGetResponse struct { + OperationResult +} + // SpacecraftsClientCreateOrUpdateResponse contains the response from method SpacecraftsClient.CreateOrUpdate. type SpacecraftsClientCreateOrUpdateResponse struct { Spacecraft diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go index e6132cd8bec3..a70f8978ce8a 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go +++ b/sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go @@ -95,14 +95,14 @@ func (client *SpacecraftsClient) createOrUpdate(ctx context.Context, resourceGro // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *SpacecraftsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, parameters Spacecraft, options *SpacecraftsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -112,7 +112,7 @@ func (client *SpacecraftsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -157,14 +157,14 @@ func (client *SpacecraftsClient) deleteOperation(ctx context.Context, resourceGr // deleteCreateRequest creates the Delete request. func (client *SpacecraftsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, options *SpacecraftsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -174,7 +174,7 @@ func (client *SpacecraftsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -203,14 +203,14 @@ func (client *SpacecraftsClient) Get(ctx context.Context, resourceGroupName stri // getCreateRequest creates the Get request. func (client *SpacecraftsClient) getCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, options *SpacecraftsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -220,7 +220,7 @@ func (client *SpacecraftsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -242,10 +242,16 @@ func (client *SpacecraftsClient) getHandleResponse(resp *http.Response) (Spacecr func (client *SpacecraftsClient) NewListPager(resourceGroupName string, options *SpacecraftsClientListOptions) *runtime.Pager[SpacecraftsClientListResponse] { return runtime.NewPager(runtime.PageProcessor[SpacecraftsClientListResponse]{ More: func(page SpacecraftsClientListResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *SpacecraftsClientListResponse) (SpacecraftsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return SpacecraftsClientListResponse{}, err } @@ -264,20 +270,23 @@ func (client *SpacecraftsClient) NewListPager(resourceGroupName string, options // listCreateRequest creates the List request. func (client *SpacecraftsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *SpacecraftsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") + if options != nil && options.Skiptoken != nil { + reqQP.Set("$skiptoken", *options.Skiptoken) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -299,17 +308,39 @@ func (client *SpacecraftsClient) listHandleResponse(resp *http.Response) (Spacec // parameters - The parameters to provide for the contacts. // options - SpacecraftsClientBeginListAvailableContactsOptions contains the optional parameters for the SpacecraftsClient.BeginListAvailableContacts // method. -func (client *SpacecraftsClient) BeginListAvailableContacts(ctx context.Context, resourceGroupName string, spacecraftName string, parameters ContactParameters, options *SpacecraftsClientBeginListAvailableContactsOptions) (*armruntime.Poller[SpacecraftsClientListAvailableContactsResponse], error) { +func (client *SpacecraftsClient) BeginListAvailableContacts(ctx context.Context, resourceGroupName string, spacecraftName string, parameters ContactParameters, options *SpacecraftsClientBeginListAvailableContactsOptions) (*armruntime.Poller[*runtime.Pager[SpacecraftsClientListAvailableContactsResponse]], error) { + pager := runtime.NewPager(runtime.PageProcessor[SpacecraftsClientListAvailableContactsResponse]{ + More: func(page SpacecraftsClientListAvailableContactsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SpacecraftsClientListAvailableContactsResponse) (SpacecraftsClientListAvailableContactsResponse, error) { + req, err := runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + if err != nil { + return SpacecraftsClientListAvailableContactsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SpacecraftsClientListAvailableContactsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SpacecraftsClientListAvailableContactsResponse{}, runtime.NewResponseError(resp) + } + return client.listAvailableContactsHandleResponse(resp) + }, + }) if options == nil || options.ResumeToken == "" { resp, err := client.listAvailableContacts(ctx, resourceGroupName, spacecraftName, parameters, options) if err != nil { return nil, err } - return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[SpacecraftsClientListAvailableContactsResponse]{ - FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[*runtime.Pager[SpacecraftsClientListAvailableContactsResponse]]{ + FinalStateVia: armruntime.FinalStateViaLocation, + Response: &pager, }) } else { - return armruntime.NewPollerFromResumeToken[SpacecraftsClientListAvailableContactsResponse](options.ResumeToken, client.pl, nil) + return armruntime.NewPollerFromResumeToken(options.ResumeToken, client.pl, &armruntime.NewPollerFromResumeTokenOptions[*runtime.Pager[SpacecraftsClientListAvailableContactsResponse]]{ + Response: &pager, + }) } } @@ -324,7 +355,7 @@ func (client *SpacecraftsClient) listAvailableContacts(ctx context.Context, reso if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -333,14 +364,14 @@ func (client *SpacecraftsClient) listAvailableContacts(ctx context.Context, reso // listAvailableContactsCreateRequest creates the ListAvailableContacts request. func (client *SpacecraftsClient) listAvailableContactsCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, parameters ContactParameters, options *SpacecraftsClientBeginListAvailableContactsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}/listAvailableContacts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -350,12 +381,21 @@ func (client *SpacecraftsClient) listAvailableContactsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) } +// listAvailableContactsHandleResponse handles the ListAvailableContacts response. +func (client *SpacecraftsClient) listAvailableContactsHandleResponse(resp *http.Response) (SpacecraftsClientListAvailableContactsResponse, error) { + result := SpacecraftsClientListAvailableContactsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AvailableContactsListResult); err != nil { + return SpacecraftsClientListAvailableContactsResponse{}, err + } + return result, nil +} + // NewListBySubscriptionPager - Return list of spacecrafts // If the operation fails it returns an *azcore.ResponseError type. // options - SpacecraftsClientListBySubscriptionOptions contains the optional parameters for the SpacecraftsClient.ListBySubscription @@ -363,10 +403,16 @@ func (client *SpacecraftsClient) listAvailableContactsCreateRequest(ctx context. func (client *SpacecraftsClient) NewListBySubscriptionPager(options *SpacecraftsClientListBySubscriptionOptions) *runtime.Pager[SpacecraftsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PageProcessor[SpacecraftsClientListBySubscriptionResponse]{ More: func(page SpacecraftsClientListBySubscriptionResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *SpacecraftsClientListBySubscriptionResponse) (SpacecraftsClientListBySubscriptionResponse, error) { - req, err := client.listBySubscriptionCreateRequest(ctx, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return SpacecraftsClientListBySubscriptionResponse{}, err } @@ -394,7 +440,10 @@ func (client *SpacecraftsClient) listBySubscriptionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") + if options != nil && options.Skiptoken != nil { + reqQP.Set("$skiptoken", *options.Skiptoken) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -409,38 +458,55 @@ func (client *SpacecraftsClient) listBySubscriptionHandleResponse(resp *http.Res return result, nil } -// UpdateTags - Updates the specified spacecraft tags. +// BeginUpdateTags - Updates the specified spacecraft tags. // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. The name is case insensitive. // spacecraftName - Spacecraft ID // parameters - Parameters supplied to update spacecraft tags. -// options - SpacecraftsClientUpdateTagsOptions contains the optional parameters for the SpacecraftsClient.UpdateTags method. -func (client *SpacecraftsClient) UpdateTags(ctx context.Context, resourceGroupName string, spacecraftName string, parameters TagsObject, options *SpacecraftsClientUpdateTagsOptions) (SpacecraftsClientUpdateTagsResponse, error) { +// options - SpacecraftsClientBeginUpdateTagsOptions contains the optional parameters for the SpacecraftsClient.BeginUpdateTags +// method. +func (client *SpacecraftsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, spacecraftName string, parameters TagsObject, options *SpacecraftsClientBeginUpdateTagsOptions) (*armruntime.Poller[SpacecraftsClientUpdateTagsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateTags(ctx, resourceGroupName, spacecraftName, parameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[SpacecraftsClientUpdateTagsResponse]{ + FinalStateVia: armruntime.FinalStateViaLocation, + }) + } else { + return armruntime.NewPollerFromResumeToken[SpacecraftsClientUpdateTagsResponse](options.ResumeToken, client.pl, nil) + } +} + +// UpdateTags - Updates the specified spacecraft tags. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *SpacecraftsClient) updateTags(ctx context.Context, resourceGroupName string, spacecraftName string, parameters TagsObject, options *SpacecraftsClientBeginUpdateTagsOptions) (*http.Response, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, spacecraftName, parameters, options) if err != nil { - return SpacecraftsClientUpdateTagsResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return SpacecraftsClientUpdateTagsResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SpacecraftsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return client.updateTagsHandleResponse(resp) + return resp, nil } // updateTagsCreateRequest creates the UpdateTags request. -func (client *SpacecraftsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, parameters TagsObject, options *SpacecraftsClientUpdateTagsOptions) (*policy.Request, error) { +func (client *SpacecraftsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, spacecraftName string, parameters TagsObject, options *SpacecraftsClientBeginUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/spacecrafts/{spacecraftName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if spacecraftName == "" { return nil, errors.New("parameter spacecraftName cannot be empty") } @@ -450,17 +516,8 @@ func (client *SpacecraftsClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-04-preview") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) } - -// updateTagsHandleResponse handles the UpdateTags response. -func (client *SpacecraftsClient) updateTagsHandleResponse(resp *http.Response) (SpacecraftsClientUpdateTagsResponse, error) { - result := SpacecraftsClientUpdateTagsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Spacecraft); err != nil { - return SpacecraftsClientUpdateTagsResponse{}, err - } - return result, nil -}