diff --git a/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md b/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md index 23de10d77feb..0a21fdd03d2a 100644 --- a/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md +++ b/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2022-06-22) +### Other Changes + + ## 1.0.0 (2022-05-19) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/orbital/armorbital/autorest.md b/sdk/resourcemanager/orbital/armorbital/autorest.md index e8dc78b35cc2..bb6dbbe68fa5 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/08a74065e38665d8a9bb5f2653e92b2abd45bf99/specification/orbital/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/08a74065e38665d8a9bb5f2653e92b2abd45bf99/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: 1.0.0 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_availablegroundstations_client.go b/sdk/resourcemanager/orbital/armorbital/availablegroundstations_client.go similarity index 97% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_availablegroundstations_client.go rename to sdk/resourcemanager/orbital/armorbital/availablegroundstations_client.go index 33ddd1fd8fdc..0aef21ee1e60 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_availablegroundstations_client.go +++ b/sdk/resourcemanager/orbital/armorbital/availablegroundstations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital @@ -54,10 +55,10 @@ func NewAvailableGroundStationsClient(subscriptionID string, credential azcore.T return client, nil } -// Get - Gets the specified available ground station +// Get - Gets the specified available ground station. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 -// groundStationName - Ground Station name +// groundStationName - Ground Station name. // options - AvailableGroundStationsClientGetOptions contains the optional parameters for the AvailableGroundStationsClient.Get // method. func (client *AvailableGroundStationsClient) Get(ctx context.Context, groundStationName string, options *AvailableGroundStationsClientGetOptions) (AvailableGroundStationsClientGetResponse, error) { @@ -106,10 +107,10 @@ func (client *AvailableGroundStationsClient) getHandleResponse(resp *http.Respon return result, nil } -// NewListByCapabilityPager - Returns list of available ground stations +// NewListByCapabilityPager - Returns list of available ground stations. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 -// capability - Ground Station Capability +// capability - Ground Station Capability. // options - AvailableGroundStationsClientListByCapabilityOptions contains the optional parameters for the AvailableGroundStationsClient.ListByCapability // method. func (client *AvailableGroundStationsClient) NewListByCapabilityPager(capability CapabilityParameter, options *AvailableGroundStationsClientListByCapabilityOptions) *runtime.Pager[AvailableGroundStationsClientListByCapabilityResponse] { diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go b/sdk/resourcemanager/orbital/armorbital/constants.go similarity index 96% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go rename to sdk/resourcemanager/orbital/armorbital/constants.go index 14f241071afd..3bfb94537571 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go +++ b/sdk/resourcemanager/orbital/armorbital/constants.go @@ -5,12 +5,13 @@ // 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. +// DO NOT EDIT. package armorbital const ( moduleName = "armorbital" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) type APIVersionParameter string @@ -44,7 +45,7 @@ func PossibleActionTypeValues() []ActionType { } } -// AutoTrackingConfiguration - Auto track configuration. +// AutoTrackingConfiguration - Auto-tracking configuration. type AutoTrackingConfiguration string const ( @@ -93,7 +94,7 @@ func PossibleCapabilityParameterValues() []CapabilityParameter { } } -// ContactProfilesPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification +// ContactProfilesPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification. type ContactProfilesPropertiesProvisioningState string const ( @@ -117,7 +118,7 @@ func PossibleContactProfilesPropertiesProvisioningStateValues() []ContactProfile } } -// ContactsPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification +// ContactsPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification. type ContactsPropertiesProvisioningState string const ( @@ -145,21 +146,21 @@ func PossibleContactsPropertiesProvisioningStateValues() []ContactsPropertiesPro type ContactsStatus string const ( - ContactsStatusScheduled ContactsStatus = "scheduled" ContactsStatusCancelled ContactsStatus = "cancelled" - ContactsStatusSucceeded ContactsStatus = "succeeded" ContactsStatusFailed ContactsStatus = "failed" ContactsStatusProviderCancelled ContactsStatus = "providerCancelled" + ContactsStatusScheduled ContactsStatus = "scheduled" + ContactsStatusSucceeded ContactsStatus = "succeeded" ) // PossibleContactsStatusValues returns the possible values for the ContactsStatus const type. func PossibleContactsStatusValues() []ContactsStatus { return []ContactsStatus{ - ContactsStatusScheduled, ContactsStatusCancelled, - ContactsStatusSucceeded, ContactsStatusFailed, ContactsStatusProviderCancelled, + ContactsStatusScheduled, + ContactsStatusSucceeded, } } @@ -183,7 +184,7 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// Direction - Direction (uplink or downlink) +// Direction - Direction (uplink or downlink). type Direction string const ( @@ -218,7 +219,7 @@ func PossibleOriginValues() []Origin { } } -// Polarization - polarization. eg (RHCP, LHCP) +// Polarization - Polarization. e.g. (RHCP, LHCP). type Polarization string const ( @@ -254,7 +255,7 @@ func PossibleProtocolValues() []Protocol { } } -// ProvisioningState - The current state of the resource's creation, deletion, or modification +// ProvisioningState - The current state of the resource's creation, deletion, or modification. type ProvisioningState string const ( @@ -278,7 +279,7 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } -// ReleaseMode - Release Status of a ground station +// ReleaseMode - Release Status of a ground station. type ReleaseMode string const ( @@ -294,7 +295,7 @@ func PossibleReleaseModeValues() []ReleaseMode { } } -// SpacecraftsPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification +// SpacecraftsPropertiesProvisioningState - The current state of the resource's creation, deletion, or modification. type SpacecraftsPropertiesProvisioningState string const ( diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go b/sdk/resourcemanager/orbital/armorbital/contactprofiles_client.go similarity index 98% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go rename to sdk/resourcemanager/orbital/armorbital/contactprofiles_client.go index c935248ae0f8..6da0747f8670 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go +++ b/sdk/resourcemanager/orbital/armorbital/contactprofiles_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital @@ -54,11 +55,11 @@ func NewContactProfilesClient(subscriptionID string, credential azcore.TokenCred return client, nil } -// BeginCreateOrUpdate - Creates or updates a contact profile +// BeginCreateOrUpdate - Creates or updates a contact profile. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// contactProfileName - Contact Profile Name +// contactProfileName - Contact Profile name. // parameters - The parameters to provide for the created Contact Profile. // options - ContactProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the ContactProfilesClient.BeginCreateOrUpdate // method. @@ -76,7 +77,7 @@ func (client *ContactProfilesClient) BeginCreateOrUpdate(ctx context.Context, re } } -// CreateOrUpdate - Creates or updates a contact profile +// CreateOrUpdate - Creates or updates a contact profile. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 func (client *ContactProfilesClient) createOrUpdate(ctx context.Context, resourceGroupName string, contactProfileName string, parameters ContactProfile, options *ContactProfilesClientBeginCreateOrUpdateOptions) (*http.Response, error) { @@ -124,7 +125,7 @@ func (client *ContactProfilesClient) createOrUpdateCreateRequest(ctx context.Con // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// contactProfileName - Contact Profile Name +// contactProfileName - Contact Profile name. // options - ContactProfilesClientBeginDeleteOptions contains the optional parameters for the ContactProfilesClient.BeginDelete // method. func (client *ContactProfilesClient) BeginDelete(ctx context.Context, resourceGroupName string, contactProfileName string, options *ContactProfilesClientBeginDeleteOptions) (*runtime.Poller[ContactProfilesClientDeleteResponse], error) { @@ -185,11 +186,11 @@ func (client *ContactProfilesClient) deleteCreateRequest(ctx context.Context, re return req, nil } -// Get - Gets the specified contact Profile in a specified resource group +// Get - Gets the specified contact Profile in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// contactProfileName - Contact Profile Name +// contactProfileName - Contact Profile name. // options - ContactProfilesClientGetOptions contains the optional parameters for the ContactProfilesClient.Get method. func (client *ContactProfilesClient) Get(ctx context.Context, resourceGroupName string, contactProfileName string, options *ContactProfilesClientGetOptions) (ContactProfilesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, contactProfileName, options) @@ -241,7 +242,7 @@ func (client *ContactProfilesClient) getHandleResponse(resp *http.Response) (Con return result, nil } -// NewListPager - Returns list of contact profiles by Resource Group +// NewListPager - Returns list of contact profiles by Resource Group. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. @@ -308,7 +309,7 @@ func (client *ContactProfilesClient) listHandleResponse(resp *http.Response) (Co return result, nil } -// NewListBySubscriptionPager - Returns list of contact profiles by Subscription +// NewListBySubscriptionPager - Returns list of contact profiles by Subscription. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // options - ContactProfilesClientListBySubscriptionOptions contains the optional parameters for the ContactProfilesClient.ListBySubscription @@ -375,7 +376,7 @@ func (client *ContactProfilesClient) listBySubscriptionHandleResponse(resp *http // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// contactProfileName - Contact Profile Name +// contactProfileName - Contact Profile name. // parameters - Parameters supplied to update contact profile tags. // options - ContactProfilesClientBeginUpdateTagsOptions contains the optional parameters for the ContactProfilesClient.BeginUpdateTags // method. diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go b/sdk/resourcemanager/orbital/armorbital/contacts_client.go similarity index 97% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go rename to sdk/resourcemanager/orbital/armorbital/contacts_client.go index 6ba388d32c23..3713d6ad1751 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go +++ b/sdk/resourcemanager/orbital/armorbital/contacts_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital @@ -58,8 +59,8 @@ func NewContactsClient(subscriptionID string, credential azcore.TokenCredential, // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID -// contactName - Contact Name +// spacecraftName - Spacecraft ID. +// contactName - Contact name. // parameters - The parameters to provide for the created contact. // options - ContactsClientBeginCreateOptions contains the optional parameters for the ContactsClient.BeginCreate method. func (client *ContactsClient) BeginCreate(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, parameters Contact, options *ContactsClientBeginCreateOptions) (*runtime.Poller[ContactsClientCreateResponse], error) { @@ -124,12 +125,12 @@ func (client *ContactsClient) createCreateRequest(ctx context.Context, resourceG return req, runtime.MarshalAsJSON(req, parameters) } -// BeginDelete - Deletes a specified contact +// BeginDelete - Deletes a specified contact. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID -// contactName - Contact Name +// spacecraftName - Spacecraft ID. +// contactName - Contact name. // options - ContactsClientBeginDeleteOptions contains the optional parameters for the ContactsClient.BeginDelete method. func (client *ContactsClient) BeginDelete(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, options *ContactsClientBeginDeleteOptions) (*runtime.Poller[ContactsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -145,7 +146,7 @@ func (client *ContactsClient) BeginDelete(ctx context.Context, resourceGroupName } } -// Delete - Deletes a specified contact +// Delete - Deletes a specified contact. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 func (client *ContactsClient) deleteOperation(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, options *ContactsClientBeginDeleteOptions) (*http.Response, error) { @@ -193,12 +194,12 @@ func (client *ContactsClient) deleteCreateRequest(ctx context.Context, resourceG return req, nil } -// Get - Gets the specified contact in a specified resource group +// Get - Gets the specified contact in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID -// contactName - Contact Name +// spacecraftName - Spacecraft ID. +// contactName - Contact name. // options - ContactsClientGetOptions contains the optional parameters for the ContactsClient.Get method. func (client *ContactsClient) Get(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, options *ContactsClientGetOptions) (ContactsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, spacecraftName, contactName, options) @@ -254,11 +255,11 @@ func (client *ContactsClient) getHandleResponse(resp *http.Response) (ContactsCl return result, nil } -// NewListPager - Returns list of contacts by spacecraftName +// NewListPager - Returns list of contacts by spacecraftName. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID +// spacecraftName - Spacecraft ID. // options - ContactsClientListOptions contains the optional parameters for the ContactsClient.List method. func (client *ContactsClient) NewListPager(resourceGroupName string, spacecraftName string, options *ContactsClientListOptions) *runtime.Pager[ContactsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ContactsClientListResponse]{ diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go b/sdk/resourcemanager/orbital/armorbital/date_type.go similarity index 98% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go rename to sdk/resourcemanager/orbital/armorbital/date_type.go index 8e8dc7249a5f..28ac7f5ebdea 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go +++ b/sdk/resourcemanager/orbital/armorbital/date_type.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital diff --git a/sdk/resourcemanager/orbital/armorbital/go.mod b/sdk/resourcemanager/orbital/armorbital/go.mod index c960d96ee3a1..ddf31ba1ff69 100644 --- a/sdk/resourcemanager/orbital/armorbital/go.mod +++ b/sdk/resourcemanager/orbital/armorbital/go.mod @@ -2,20 +2,12 @@ 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 v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // 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-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/orbital/armorbital/go.sum b/sdk/resourcemanager/orbital/armorbital/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/orbital/armorbital/go.sum +++ b/sdk/resourcemanager/orbital/armorbital/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -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.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -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/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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_models.go b/sdk/resourcemanager/orbital/armorbital/models.go similarity index 87% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_models.go rename to sdk/resourcemanager/orbital/armorbital/models.go index 3194a88db9de..c692acf33eb1 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_models.go +++ b/sdk/resourcemanager/orbital/armorbital/models.go @@ -5,17 +5,18 @@ // 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. +// DO NOT EDIT. package armorbital import "time" -// AuthorizedGroundstation - Authorized groundstation +// AuthorizedGroundstation - Authorized groundstation. type AuthorizedGroundstation struct { - // Date of authorization expiration + // Date of authorization expiration. ExpirationDate *time.Time `json:"expirationDate,omitempty"` - // Groundstation name + // Groundstation name. GroundStation *string `json:"groundStation,omitempty"` } @@ -34,7 +35,7 @@ type AvailableContacts struct { // AvailableContactsListResult - Response for the ListAvailableContacts API service call. type AvailableContactsListResult struct { - // A list of available contacts + // A list of available contacts. Value []*AvailableContacts `json:"value,omitempty"` // READ-ONLY; The URL to get the next set of results. @@ -52,10 +53,10 @@ type AvailableContactsProperties struct { // 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. + // READ-ONLY; Time to lost receiving a signal (ISO 8601 UTC standard). RxEndTime *time.Time `json:"rxEndTime,omitempty" azure:"ro"` - // READ-ONLY; Earliest time to receive a signal. + // READ-ONLY; Earliest time to receive a signal (ISO 8601 UTC standard). RxStartTime *time.Time `json:"rxStartTime,omitempty" azure:"ro"` // READ-ONLY; Azimuth of the antenna at the start of the contact in decimal degrees. @@ -64,10 +65,10 @@ type AvailableContactsProperties struct { // 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. + // READ-ONLY; Time at which antenna transmit will be disabled (ISO 8601 UTC standard). TxEndTime *time.Time `json:"txEndTime,omitempty" azure:"ro"` - // READ-ONLY; Time at which antenna transmit will be enabled. + // READ-ONLY; Time at which antenna transmit will be enabled (ISO 8601 UTC standard). TxStartTime *time.Time `json:"txStartTime,omitempty" azure:"ro"` } @@ -77,15 +78,15 @@ type AvailableContactsSpacecraft struct { ID *string `json:"id,omitempty"` } -// AvailableGroundStation - GroundStations available to schedule Contacts +// AvailableGroundStation - Ground Stations available to schedule Contacts. type AvailableGroundStation struct { - // Azure region + // Azure region. Location *string `json:"location,omitempty"` - // The properties bag for this resource + // The properties bag for this resource. Properties *AvailableGroundStationProperties `json:"properties,omitempty"` - // READ-ONLY; Id of groundStation + // READ-ONLY; ID of groundStation. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Name of the ground station. @@ -104,9 +105,9 @@ type AvailableGroundStationListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// AvailableGroundStationProperties - The properties bag for this resource +// AvailableGroundStationProperties - The properties bag for this resource. type AvailableGroundStationProperties struct { - // Altitude of the ground station + // Altitude of the ground station. AltitudeMeters *float32 `json:"altitudeMeters,omitempty"` // City of ground station. @@ -121,13 +122,13 @@ type AvailableGroundStationProperties struct { // Ground station provider name. ProviderName *string `json:"providerName,omitempty"` - // Release Status of a ground station + // 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 + // Altitude of the ground station. AltitudeMeters *float32 `json:"altitudeMeters,omitempty"` // City of ground station. @@ -142,7 +143,7 @@ type AvailableGroundStationPropertiesAutoGenerated struct { // Ground station provider name. ProviderName *string `json:"providerName,omitempty"` - // Release Status of a ground station + // Release Status of a ground station. ReleaseMode *ReleaseMode `json:"releaseMode,omitempty"` } @@ -199,7 +200,7 @@ type Contact struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ContactInstanceProperties - Contact Instance Properties +// ContactInstanceProperties - Contact Instance Properties. type ContactInstanceProperties struct { // READ-ONLY; Azimuth of the antenna at the end of the contact in decimal degrees. EndAzimuthDegrees *float32 `json:"endAzimuthDegrees,omitempty" azure:"ro"` @@ -210,10 +211,10 @@ type ContactInstanceProperties struct { // 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. + // READ-ONLY; Time to lost receiving a signal (ISO 8601 UTC standard). RxEndTime *time.Time `json:"rxEndTime,omitempty" azure:"ro"` - // READ-ONLY; Earliest time to receive a signal. + // READ-ONLY; Earliest time to receive a signal (ISO 8601 UTC standard). RxStartTime *time.Time `json:"rxStartTime,omitempty" azure:"ro"` // READ-ONLY; Azimuth of the antenna at the start of the contact in decimal degrees. @@ -222,10 +223,10 @@ type ContactInstanceProperties struct { // 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. + // READ-ONLY; Time at which antenna transmit will be disabled (ISO 8601 UTC standard). TxEndTime *time.Time `json:"txEndTime,omitempty" azure:"ro"` - // READ-ONLY; Time at which antenna transmit will be enabled. + // READ-ONLY; Time at which antenna transmit will be enabled (ISO 8601 UTC standard). TxStartTime *time.Time `json:"txStartTime,omitempty" azure:"ro"` } @@ -243,13 +244,13 @@ type ContactParameters struct { // REQUIRED; The reference to the contact profile resource. ContactProfile *ContactParametersContactProfile `json:"contactProfile,omitempty"` - // REQUIRED; End time of a contact. + // REQUIRED; End time of a contact (ISO 8601 UTC standard). EndTime *time.Time `json:"endTime,omitempty"` // REQUIRED; Name of Azure Ground Station. GroundStationName *string `json:"groundStationName,omitempty"` - // REQUIRED; Start time of a contact. + // REQUIRED; Start time of a contact (ISO 8601 UTC standard). StartTime *time.Time `json:"startTime,omitempty"` } @@ -287,51 +288,55 @@ 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 + // REQUIRED; Contact Profile Link Channel. Channels []*ContactProfileLinkChannel `json:"channels,omitempty"` - // REQUIRED; Direction (uplink or downlink) + // REQUIRED; Direction (uplink or downlink). Direction *Direction `json:"direction,omitempty"` - // REQUIRED; Link name + // REQUIRED; Link name. Name *string `json:"name,omitempty"` - // REQUIRED; polarization. eg (RHCP, LHCP) + // REQUIRED; Polarization. e.g. (RHCP, LHCP). Polarization *Polarization `json:"polarization,omitempty"` - // Effective Isotropic Radiated Power (EIRP) in dBW. + // Effective Isotropic Radiated Power (EIRP) in dBW. It is the required EIRP by the customer. Not used yet. EirpdBW *float32 `json:"eirpdBW,omitempty"` - // Gain To Noise Temperature in db/K. + // Gain To Noise Temperature in db/K. It is the required G/T by the customer. Not used yet. GainOverTemperature *float32 `json:"gainOverTemperature,omitempty"` } -// ContactProfileLinkChannel - Contact Profile Link Channel +// ContactProfileLinkChannel - Contact Profile Link Channel. type ContactProfileLinkChannel struct { - // REQUIRED; Bandwidth in MHz + // REQUIRED; Bandwidth in MHz. BandwidthMHz *float32 `json:"bandwidthMHz,omitempty"` - // REQUIRED; Center Frequency in MHz + // REQUIRED; Center Frequency in MHz. CenterFrequencyMHz *float32 `json:"centerFrequencyMHz,omitempty"` // REQUIRED; Customer End point to store/retrieve data during a contact. EndPoint *EndPoint `json:"endPoint,omitempty"` - // REQUIRED; Channel name + // REQUIRED; Channel name. Name *string `json:"name,omitempty"` - // Configuration for decoding + // Currently unused. DecodingConfiguration *string `json:"decodingConfiguration,omitempty"` - // Configuration for demodulation + // Copy of the modem configuration file such as Kratos QRadio or Kratos QuantumRx. Only valid for downlink directions. If + // provided, the modem connects to the customer endpoint and sends demodulated data + // instead of a VITA.49 stream. DemodulationConfiguration *string `json:"demodulationConfiguration,omitempty"` - // Configuration for encoding + // Currently unused. EncodingConfiguration *string `json:"encodingConfiguration,omitempty"` - // Configuration for modulation + // Copy of the modem configuration file such as Kratos QRadio. Only valid for uplink directions. If provided, the modem connects + // to the customer endpoint and accepts commands from the customer instead of + // a VITA.49 stream. ModulationConfiguration *string `json:"modulationConfiguration,omitempty"` } @@ -346,25 +351,28 @@ type ContactProfileListResult struct { // ContactProfileProperties - Properties of the contact profile resource. type ContactProfileProperties struct { - // REQUIRED; Links of the Contact Profile + // REQUIRED; Links of the Contact Profile. Describes RF links, modem processing, and IP endpoints. Links []*ContactProfileLink `json:"links,omitempty"` // REQUIRED; Network configuration of customer virtual network. NetworkConfiguration *ContactProfilesPropertiesNetworkConfiguration `json:"networkConfiguration,omitempty"` - // Auto track configuration. + // Auto-tracking configuration. AutoTrackingConfiguration *AutoTrackingConfiguration `json:"autoTrackingConfiguration,omitempty"` - // The URI of the Event Hub used for telemetry + // ARM resource identifier of the Event Hub used for telemetry. Requires granting Orbital Resource Provider the rights to + // send telemetry into the hub. EventHubURI *string `json:"eventHubUri,omitempty"` - // Minimum viable elevation for the contact in decimal degrees. + // Minimum viable elevation for the contact in decimal degrees. Used for listing the available contacts with a spacecraft + // at a given ground station. MinimumElevationDegrees *float32 `json:"minimumElevationDegrees,omitempty"` - // Minimum viable contact duration in ISO 8601 format. + // Minimum viable contact duration in ISO 8601 format. Used for listing the available contacts with a spacecraft at a given + // ground station. MinimumViableContactDuration *string `json:"minimumViableContactDuration,omitempty"` - // The current state of the resource's creation, deletion, or modification + // The current state of the resource's creation, deletion, or modification. ProvisioningState *ContactProfilesPropertiesProvisioningState `json:"provisioningState,omitempty"` } @@ -414,31 +422,35 @@ type ContactProfilesClientListOptions struct { // ContactProfilesProperties - List of Contact Profile Resource Properties. type ContactProfilesProperties struct { - // REQUIRED; Links of the Contact Profile + // REQUIRED; Links of the Contact Profile. Describes RF links, modem processing, and IP endpoints. Links []*ContactProfileLink `json:"links,omitempty"` // REQUIRED; Network configuration of customer virtual network. NetworkConfiguration *ContactProfilesPropertiesNetworkConfiguration `json:"networkConfiguration,omitempty"` - // Auto track configuration. + // Auto-tracking configuration. AutoTrackingConfiguration *AutoTrackingConfiguration `json:"autoTrackingConfiguration,omitempty"` - // The URI of the Event Hub used for telemetry + // ARM resource identifier of the Event Hub used for telemetry. Requires granting Orbital Resource Provider the rights to + // send telemetry into the hub. EventHubURI *string `json:"eventHubUri,omitempty"` - // Minimum viable elevation for the contact in decimal degrees. + // Minimum viable elevation for the contact in decimal degrees. Used for listing the available contacts with a spacecraft + // at a given ground station. MinimumElevationDegrees *float32 `json:"minimumElevationDegrees,omitempty"` - // Minimum viable contact duration in ISO 8601 format. + // Minimum viable contact duration in ISO 8601 format. Used for listing the available contacts with a spacecraft at a given + // ground station. MinimumViableContactDuration *string `json:"minimumViableContactDuration,omitempty"` - // The current state of the resource's creation, deletion, or modification + // 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. + // REQUIRED; ARM resource identifier of the subnet delegated to the Microsoft.Orbital/orbitalGateways. Needs to be at least + // a class C subnet, and should not have any IP created in it. SubnetID *string `json:"subnetId,omitempty"` } @@ -476,13 +488,13 @@ type ContactsProperties struct { // REQUIRED; Azure Ground Station name. GroundStationName *string `json:"groundStationName,omitempty"` - // REQUIRED; Reservation end time of a contact. + // REQUIRED; Reservation end time of a contact (ISO 8601 UTC standard). ReservationEndTime *time.Time `json:"reservationEndTime,omitempty"` - // REQUIRED; Reservation start time of a contact. + // REQUIRED; Reservation start time of a contact (ISO 8601 UTC standard). ReservationStartTime *time.Time `json:"reservationStartTime,omitempty"` - // The current state of the resource's creation, deletion, or modification + // 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. @@ -500,10 +512,10 @@ type ContactsProperties struct { // READ-ONLY; Maximum elevation of the antenna during the contact in decimal degrees. MaximumElevationDegrees *float32 `json:"maximumElevationDegrees,omitempty" azure:"ro"` - // READ-ONLY; Receive end time of a contact. + // READ-ONLY; Receive end time of a contact (ISO 8601 UTC standard). RxEndTime *time.Time `json:"rxEndTime,omitempty" azure:"ro"` - // READ-ONLY; Receive start time of a contact. + // READ-ONLY; Receive start time of a contact (ISO 8601 UTC standard). RxStartTime *time.Time `json:"rxStartTime,omitempty" azure:"ro"` // READ-ONLY; Azimuth of the antenna at the start of the contact in decimal degrees. @@ -515,10 +527,10 @@ type ContactsProperties struct { // READ-ONLY; Status of a contact. Status *ContactsStatus `json:"status,omitempty" azure:"ro"` - // READ-ONLY; Transmit end time of a contact. + // READ-ONLY; Transmit end time of a contact (ISO 8601 UTC standard). TxEndTime *time.Time `json:"txEndTime,omitempty" azure:"ro"` - // READ-ONLY; Transmit start time of a contact. + // READ-ONLY; Transmit start time of a contact (ISO 8601 UTC standard). TxStartTime *time.Time `json:"txStartTime,omitempty" azure:"ro"` } @@ -603,13 +615,13 @@ type OperationListResult struct { // OperationResult - Operation Result Entity. type OperationResult struct { - // Operation result error properties + // Operation result error properties. Error *OperationResultErrorProperties `json:"error,omitempty"` - // Operation result properties + // Operation result properties. Properties interface{} `json:"properties,omitempty"` - // READ-ONLY; The operation end time + // READ-ONLY; The operation end time (ISO 8601 UTC standard). EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` // READ-ONLY; ID of the resource. @@ -621,14 +633,14 @@ type OperationResult struct { // READ-ONLY; Percentage completed. PercentComplete *float64 `json:"percentComplete,omitempty" azure:"ro"` - // READ-ONLY; The operation start time + // READ-ONLY; The operation start time (ISO 8601 UTC standard). StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` // READ-ONLY; The status of operation. Status *Status `json:"status,omitempty" azure:"ro"` } -// OperationResultErrorProperties - Operation result error properties +// OperationResultErrorProperties - Operation result error properties. type OperationResultErrorProperties struct { // READ-ONLY; The code of the error. Code *string `json:"code,omitempty" azure:"ro"` @@ -690,11 +702,11 @@ type ResourceIDListResult struct { } type ResourceIDListResultValueItem struct { - // The Azure Resource ID + // The Azure Resource ID. ID *string `json:"id,omitempty"` } -// ResourceReference - Resource Reference +// ResourceReference - Resource Reference. type ResourceReference struct { // Resource ID. ID *string `json:"id,omitempty"` @@ -727,21 +739,21 @@ type Spacecraft struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SpacecraftLink - Authorized Ground Stations for the link +// SpacecraftLink - List of authorized spacecraft links per ground station and the expiration date of the authorization. type SpacecraftLink struct { - // REQUIRED; Bandwidth in MHz + // REQUIRED; Bandwidth in MHz. BandwidthMHz *float32 `json:"bandwidthMHz,omitempty"` - // REQUIRED; Center Frequency in MHz + // REQUIRED; Center Frequency in MHz. CenterFrequencyMHz *float32 `json:"centerFrequencyMHz,omitempty"` - // REQUIRED; Direction (uplink or downlink) + // REQUIRED; Direction (uplink or downlink). Direction *Direction `json:"direction,omitempty"` - // REQUIRED; Link name + // REQUIRED; Link name. Name *string `json:"name,omitempty"` - // REQUIRED; polarization. eg (RHCP, LHCP) + // REQUIRED; Polarization. e.g. (RHCP, LHCP). Polarization *Polarization `json:"polarization,omitempty"` // READ-ONLY; Authorized Ground Stations @@ -812,19 +824,19 @@ type SpacecraftsProperties struct { // REQUIRED; NORAD ID of the spacecraft. NoradID *string `json:"noradId,omitempty"` - // Links of the Spacecraft + // Immutable list of Spacecraft links. Links []*SpacecraftLink `json:"links,omitempty"` - // The current state of the resource's creation, deletion, or modification + // The current state of the resource's creation, deletion, or modification. ProvisioningState *SpacecraftsPropertiesProvisioningState `json:"provisioningState,omitempty"` - // Title line of Two Line Element (TLE). + // Title line of the two-line element set (TLE). TitleLine *string `json:"titleLine,omitempty"` - // Line 1 of Two Line Element (TLE). + // Line 1 of the two-line element set (TLE). TleLine1 *string `json:"tleLine1,omitempty"` - // Line 2 of Two Line Element (TLE). + // Line 2 of the two-line element set (TLE). TleLine2 *string `json:"tleLine2,omitempty"` } diff --git a/sdk/resourcemanager/orbital/armorbital/models_serde.go b/sdk/resourcemanager/orbital/armorbital/models_serde.go new file mode 100644 index 000000000000..65bff714c715 --- /dev/null +++ b/sdk/resourcemanager/orbital/armorbital/models_serde.go @@ -0,0 +1,1825 @@ +//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. +// DO NOT EDIT. + +package armorbital + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "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 fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationDate": + err = unpopulateDateType(val, "ExpirationDate", &a.ExpirationDate) + delete(rawMsg, key) + case "groundStation": + err = unpopulate(val, "GroundStation", &a.GroundStation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableContacts. +func (a AvailableContacts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groundStationName", a.GroundStationName) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "spacecraft", a.Spacecraft) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableContacts. +func (a *AvailableContacts) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groundStationName": + err = unpopulate(val, "GroundStationName", &a.GroundStationName) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "spacecraft": + err = unpopulate(val, "Spacecraft", &a.Spacecraft) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableContactsListResult. +func (a AvailableContactsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableContactsListResult. +func (a *AvailableContactsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endAzimuthDegrees": + err = unpopulate(val, "EndAzimuthDegrees", &a.EndAzimuthDegrees) + delete(rawMsg, key) + case "endElevationDegrees": + err = unpopulate(val, "EndElevationDegrees", &a.EndElevationDegrees) + delete(rawMsg, key) + case "maximumElevationDegrees": + err = unpopulate(val, "MaximumElevationDegrees", &a.MaximumElevationDegrees) + delete(rawMsg, key) + case "rxEndTime": + err = unpopulateTimeRFC3339(val, "RxEndTime", &a.RxEndTime) + delete(rawMsg, key) + case "rxStartTime": + err = unpopulateTimeRFC3339(val, "RxStartTime", &a.RxStartTime) + delete(rawMsg, key) + case "startAzimuthDegrees": + err = unpopulate(val, "StartAzimuthDegrees", &a.StartAzimuthDegrees) + delete(rawMsg, key) + case "startElevationDegrees": + err = unpopulate(val, "StartElevationDegrees", &a.StartElevationDegrees) + delete(rawMsg, key) + case "txEndTime": + err = unpopulateTimeRFC3339(val, "TxEndTime", &a.TxEndTime) + delete(rawMsg, key) + case "txStartTime": + err = unpopulateTimeRFC3339(val, "TxStartTime", &a.TxStartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableContactsSpacecraft. +func (a AvailableContactsSpacecraft) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableContactsSpacecraft. +func (a *AvailableContactsSpacecraft) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableGroundStation. +func (a AvailableGroundStation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableGroundStation. +func (a *AvailableGroundStation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableGroundStationListResult. +func (a AvailableGroundStationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableGroundStationListResult. +func (a *AvailableGroundStationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableGroundStationProperties. +func (a AvailableGroundStationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "altitudeMeters", a.AltitudeMeters) + populate(objectMap, "city", a.City) + populate(objectMap, "latitudeDegrees", a.LatitudeDegrees) + populate(objectMap, "longitudeDegrees", a.LongitudeDegrees) + populate(objectMap, "providerName", a.ProviderName) + populate(objectMap, "releaseMode", a.ReleaseMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableGroundStationProperties. +func (a *AvailableGroundStationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "altitudeMeters": + err = unpopulate(val, "AltitudeMeters", &a.AltitudeMeters) + delete(rawMsg, key) + case "city": + err = unpopulate(val, "City", &a.City) + delete(rawMsg, key) + case "latitudeDegrees": + err = unpopulate(val, "LatitudeDegrees", &a.LatitudeDegrees) + delete(rawMsg, key) + case "longitudeDegrees": + err = unpopulate(val, "LongitudeDegrees", &a.LongitudeDegrees) + delete(rawMsg, key) + case "providerName": + err = unpopulate(val, "ProviderName", &a.ProviderName) + delete(rawMsg, key) + case "releaseMode": + err = unpopulate(val, "ReleaseMode", &a.ReleaseMode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableGroundStationPropertiesAutoGenerated. +func (a AvailableGroundStationPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "altitudeMeters", a.AltitudeMeters) + populate(objectMap, "city", a.City) + populate(objectMap, "latitudeDegrees", a.LatitudeDegrees) + populate(objectMap, "longitudeDegrees", a.LongitudeDegrees) + populate(objectMap, "providerName", a.ProviderName) + populate(objectMap, "releaseMode", a.ReleaseMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableGroundStationPropertiesAutoGenerated. +func (a *AvailableGroundStationPropertiesAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "altitudeMeters": + err = unpopulate(val, "AltitudeMeters", &a.AltitudeMeters) + delete(rawMsg, key) + case "city": + err = unpopulate(val, "City", &a.City) + delete(rawMsg, key) + case "latitudeDegrees": + err = unpopulate(val, "LatitudeDegrees", &a.LatitudeDegrees) + delete(rawMsg, key) + case "longitudeDegrees": + err = unpopulate(val, "LongitudeDegrees", &a.LongitudeDegrees) + delete(rawMsg, key) + case "providerName": + err = unpopulate(val, "ProviderName", &a.ProviderName) + delete(rawMsg, key) + case "releaseMode": + err = unpopulate(val, "ReleaseMode", &a.ReleaseMode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudError. +func (c CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", c.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. +func (c *CloudError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &c.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. +func (c CloudErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "details", c.Details) + populate(objectMap, "message", c.Message) + populate(objectMap, "target", c.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudErrorBody. +func (c *CloudErrorBody) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &c.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &c.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &c.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Contact. +func (c Contact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Contact. +func (c *Contact) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactInstanceProperties. +func (c ContactInstanceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endAzimuthDegrees", c.EndAzimuthDegrees) + populate(objectMap, "endElevationDegrees", c.EndElevationDegrees) + populate(objectMap, "maximumElevationDegrees", c.MaximumElevationDegrees) + populateTimeRFC3339(objectMap, "rxEndTime", c.RxEndTime) + populateTimeRFC3339(objectMap, "rxStartTime", c.RxStartTime) + populate(objectMap, "startAzimuthDegrees", c.StartAzimuthDegrees) + populate(objectMap, "startElevationDegrees", c.StartElevationDegrees) + populateTimeRFC3339(objectMap, "txEndTime", c.TxEndTime) + populateTimeRFC3339(objectMap, "txStartTime", c.TxStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactInstanceProperties. +func (c *ContactInstanceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endAzimuthDegrees": + err = unpopulate(val, "EndAzimuthDegrees", &c.EndAzimuthDegrees) + delete(rawMsg, key) + case "endElevationDegrees": + err = unpopulate(val, "EndElevationDegrees", &c.EndElevationDegrees) + delete(rawMsg, key) + case "maximumElevationDegrees": + err = unpopulate(val, "MaximumElevationDegrees", &c.MaximumElevationDegrees) + delete(rawMsg, key) + case "rxEndTime": + err = unpopulateTimeRFC3339(val, "RxEndTime", &c.RxEndTime) + delete(rawMsg, key) + case "rxStartTime": + err = unpopulateTimeRFC3339(val, "RxStartTime", &c.RxStartTime) + delete(rawMsg, key) + case "startAzimuthDegrees": + err = unpopulate(val, "StartAzimuthDegrees", &c.StartAzimuthDegrees) + delete(rawMsg, key) + case "startElevationDegrees": + err = unpopulate(val, "StartElevationDegrees", &c.StartElevationDegrees) + delete(rawMsg, key) + case "txEndTime": + err = unpopulateTimeRFC3339(val, "TxEndTime", &c.TxEndTime) + delete(rawMsg, key) + case "txStartTime": + err = unpopulateTimeRFC3339(val, "TxStartTime", &c.TxStartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactListResult. +func (c ContactListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactListResult. +func (c *ContactListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactParameters. +func (c ContactParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contactProfile", c.ContactProfile) + populateTimeRFC3339(objectMap, "endTime", c.EndTime) + populate(objectMap, "groundStationName", c.GroundStationName) + populateTimeRFC3339(objectMap, "startTime", c.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactParameters. +func (c *ContactParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contactProfile": + err = unpopulate(val, "ContactProfile", &c.ContactProfile) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &c.EndTime) + delete(rawMsg, key) + case "groundStationName": + err = unpopulate(val, "GroundStationName", &c.GroundStationName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactParametersContactProfile. +func (c ContactParametersContactProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactParametersContactProfile. +func (c *ContactParametersContactProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactProfile. +func (c ContactProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProfile. +func (c *ContactProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactProfileLink. +func (c ContactProfileLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "channels", c.Channels) + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProfileLink. +func (c *ContactProfileLink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "channels": + err = unpopulate(val, "Channels", &c.Channels) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &c.Direction) + delete(rawMsg, key) + case "eirpdBW": + err = unpopulate(val, "EirpdBW", &c.EirpdBW) + delete(rawMsg, key) + case "gainOverTemperature": + err = unpopulate(val, "GainOverTemperature", &c.GainOverTemperature) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "polarization": + err = unpopulate(val, "Polarization", &c.Polarization) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactProfileLinkChannel. +func (c ContactProfileLinkChannel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bandwidthMHz", c.BandwidthMHz) + populate(objectMap, "centerFrequencyMHz", c.CenterFrequencyMHz) + populate(objectMap, "decodingConfiguration", c.DecodingConfiguration) + populate(objectMap, "demodulationConfiguration", c.DemodulationConfiguration) + populate(objectMap, "encodingConfiguration", c.EncodingConfiguration) + populate(objectMap, "endPoint", c.EndPoint) + populate(objectMap, "modulationConfiguration", c.ModulationConfiguration) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProfileLinkChannel. +func (c *ContactProfileLinkChannel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bandwidthMHz": + err = unpopulate(val, "BandwidthMHz", &c.BandwidthMHz) + delete(rawMsg, key) + case "centerFrequencyMHz": + err = unpopulate(val, "CenterFrequencyMHz", &c.CenterFrequencyMHz) + delete(rawMsg, key) + case "decodingConfiguration": + err = unpopulate(val, "DecodingConfiguration", &c.DecodingConfiguration) + delete(rawMsg, key) + case "demodulationConfiguration": + err = unpopulate(val, "DemodulationConfiguration", &c.DemodulationConfiguration) + delete(rawMsg, key) + case "encodingConfiguration": + err = unpopulate(val, "EncodingConfiguration", &c.EncodingConfiguration) + delete(rawMsg, key) + case "endPoint": + err = unpopulate(val, "EndPoint", &c.EndPoint) + delete(rawMsg, key) + case "modulationConfiguration": + err = unpopulate(val, "ModulationConfiguration", &c.ModulationConfiguration) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactProfileListResult. +func (c ContactProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProfileListResult. +func (c *ContactProfileListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProfileProperties. +func (c *ContactProfileProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoTrackingConfiguration": + err = unpopulate(val, "AutoTrackingConfiguration", &c.AutoTrackingConfiguration) + delete(rawMsg, key) + case "eventHubUri": + err = unpopulate(val, "EventHubURI", &c.EventHubURI) + delete(rawMsg, key) + case "links": + err = unpopulate(val, "Links", &c.Links) + delete(rawMsg, key) + case "minimumElevationDegrees": + err = unpopulate(val, "MinimumElevationDegrees", &c.MinimumElevationDegrees) + delete(rawMsg, key) + case "minimumViableContactDuration": + err = unpopulate(val, "MinimumViableContactDuration", &c.MinimumViableContactDuration) + delete(rawMsg, key) + case "networkConfiguration": + err = unpopulate(val, "NetworkConfiguration", &c.NetworkConfiguration) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactProfilesProperties. +func (c ContactProfilesProperties) 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProfilesProperties. +func (c *ContactProfilesProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoTrackingConfiguration": + err = unpopulate(val, "AutoTrackingConfiguration", &c.AutoTrackingConfiguration) + delete(rawMsg, key) + case "eventHubUri": + err = unpopulate(val, "EventHubURI", &c.EventHubURI) + delete(rawMsg, key) + case "links": + err = unpopulate(val, "Links", &c.Links) + delete(rawMsg, key) + case "minimumElevationDegrees": + err = unpopulate(val, "MinimumElevationDegrees", &c.MinimumElevationDegrees) + delete(rawMsg, key) + case "minimumViableContactDuration": + err = unpopulate(val, "MinimumViableContactDuration", &c.MinimumViableContactDuration) + delete(rawMsg, key) + case "networkConfiguration": + err = unpopulate(val, "NetworkConfiguration", &c.NetworkConfiguration) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactProfilesPropertiesNetworkConfiguration. +func (c ContactProfilesPropertiesNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "subnetId", c.SubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProfilesPropertiesNetworkConfiguration. +func (c *ContactProfilesPropertiesNetworkConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "subnetId": + err = unpopulate(val, "SubnetID", &c.SubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// 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) + populateTimeRFC3339(objectMap, "rxStartTime", c.RxStartTime) + populate(objectMap, "startAzimuthDegrees", c.StartAzimuthDegrees) + populate(objectMap, "startElevationDegrees", c.StartElevationDegrees) + populate(objectMap, "status", c.Status) + populateTimeRFC3339(objectMap, "txEndTime", c.TxEndTime) + populateTimeRFC3339(objectMap, "txStartTime", c.TxStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactsProperties. +func (c *ContactsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "antennaConfiguration": + err = unpopulate(val, "AntennaConfiguration", &c.AntennaConfiguration) + delete(rawMsg, key) + case "contactProfile": + err = unpopulate(val, "ContactProfile", &c.ContactProfile) + delete(rawMsg, key) + case "endAzimuthDegrees": + err = unpopulate(val, "EndAzimuthDegrees", &c.EndAzimuthDegrees) + delete(rawMsg, key) + case "endElevationDegrees": + err = unpopulate(val, "EndElevationDegrees", &c.EndElevationDegrees) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &c.ErrorMessage) + delete(rawMsg, key) + case "groundStationName": + err = unpopulate(val, "GroundStationName", &c.GroundStationName) + delete(rawMsg, key) + case "maximumElevationDegrees": + err = unpopulate(val, "MaximumElevationDegrees", &c.MaximumElevationDegrees) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "reservationEndTime": + err = unpopulateTimeRFC3339(val, "ReservationEndTime", &c.ReservationEndTime) + delete(rawMsg, key) + case "reservationStartTime": + err = unpopulateTimeRFC3339(val, "ReservationStartTime", &c.ReservationStartTime) + delete(rawMsg, key) + case "rxEndTime": + err = unpopulateTimeRFC3339(val, "RxEndTime", &c.RxEndTime) + delete(rawMsg, key) + case "rxStartTime": + err = unpopulateTimeRFC3339(val, "RxStartTime", &c.RxStartTime) + delete(rawMsg, key) + case "startAzimuthDegrees": + err = unpopulate(val, "StartAzimuthDegrees", &c.StartAzimuthDegrees) + delete(rawMsg, key) + case "startElevationDegrees": + err = unpopulate(val, "StartElevationDegrees", &c.StartElevationDegrees) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "txEndTime": + err = unpopulateTimeRFC3339(val, "TxEndTime", &c.TxEndTime) + delete(rawMsg, key) + case "txStartTime": + err = unpopulateTimeRFC3339(val, "TxStartTime", &c.TxStartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactsPropertiesAntennaConfiguration. +func (c *ContactsPropertiesAntennaConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationIp": + err = unpopulate(val, "DestinationIP", &c.DestinationIP) + delete(rawMsg, key) + case "sourceIps": + err = unpopulate(val, "SourceIPs", &c.SourceIPs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContactsPropertiesContactProfile. +func (c ContactsPropertiesContactProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactsPropertiesContactProfile. +func (c *ContactsPropertiesContactProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndPoint. +func (e EndPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endPointName", e.EndPointName) + populate(objectMap, "ipAddress", e.IPAddress) + populate(objectMap, "port", e.Port) + populate(objectMap, "protocol", e.Protocol) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndPoint. +func (e *EndPoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endPointName": + err = unpopulate(val, "EndPointName", &e.EndPointName) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &e.IPAddress) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &e.Port) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &e.Protocol) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &o.PercentComplete) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationResultErrorProperties. +func (o OperationResultErrorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", o.Code) + populate(objectMap, "message", o.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultErrorProperties. +func (o *OperationResultErrorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceIDListResult. +func (r ResourceIDListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIDListResult. +func (r *ResourceIDListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceIDListResultValueItem. +func (r ResourceIDListResultValueItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIDListResultValueItem. +func (r *ResourceIDListResultValueItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceReference. +func (r ResourceReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReference. +func (r *ResourceReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Spacecraft. +func (s Spacecraft) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Spacecraft. +func (s *Spacecraft) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SpacecraftLink. +func (s *SpacecraftLink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authorizations": + err = unpopulate(val, "Authorizations", &s.Authorizations) + delete(rawMsg, key) + case "bandwidthMHz": + err = unpopulate(val, "BandwidthMHz", &s.BandwidthMHz) + delete(rawMsg, key) + case "centerFrequencyMHz": + err = unpopulate(val, "CenterFrequencyMHz", &s.CenterFrequencyMHz) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &s.Direction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "polarization": + err = unpopulate(val, "Polarization", &s.Polarization) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SpacecraftListResult. +func (s SpacecraftListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SpacecraftListResult. +func (s *SpacecraftListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SpacecraftsProperties. +func (s SpacecraftsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SpacecraftsProperties. +func (s *SpacecraftsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "links": + err = unpopulate(val, "Links", &s.Links) + delete(rawMsg, key) + case "noradId": + err = unpopulate(val, "NoradID", &s.NoradID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "titleLine": + err = unpopulate(val, "TitleLine", &s.TitleLine) + delete(rawMsg, key) + case "tleLine1": + err = unpopulate(val, "TleLine1", &s.TleLine1) + delete(rawMsg, key) + case "tleLine2": + err = unpopulate(val, "TleLine2", &s.TleLine2) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagsObject. +func (t TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. +func (t *TagsObject) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_operations_client.go b/sdk/resourcemanager/orbital/armorbital/operations_client.go similarity index 99% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_operations_client.go rename to sdk/resourcemanager/orbital/armorbital/operations_client.go index 9e13a168d7ad..8dca188aed32 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_operations_client.go +++ b/sdk/resourcemanager/orbital/armorbital/operations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go b/sdk/resourcemanager/orbital/armorbital/operationsresults_client.go similarity index 99% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go rename to sdk/resourcemanager/orbital/armorbital/operationsresults_client.go index 316415778047..ffc6bd3c0c50 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go +++ b/sdk/resourcemanager/orbital/armorbital/operationsresults_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go b/sdk/resourcemanager/orbital/armorbital/response_types.go similarity index 99% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go rename to sdk/resourcemanager/orbital/armorbital/response_types.go index bc0f29cdbb34..a8db076caa4f 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go +++ b/sdk/resourcemanager/orbital/armorbital/response_types.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go b/sdk/resourcemanager/orbital/armorbital/spacecrafts_client.go similarity index 96% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go rename to sdk/resourcemanager/orbital/armorbital/spacecrafts_client.go index bf77e7b248c6..a1075681d4da 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go +++ b/sdk/resourcemanager/orbital/armorbital/spacecrafts_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital @@ -54,11 +55,11 @@ func NewSpacecraftsClient(subscriptionID string, credential azcore.TokenCredenti return client, nil } -// BeginCreateOrUpdate - Creates or updates a spacecraft resource +// BeginCreateOrUpdate - Creates or updates a spacecraft resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID +// spacecraftName - Spacecraft ID. // parameters - The parameters to provide for the created spacecraft. // options - SpacecraftsClientBeginCreateOrUpdateOptions contains the optional parameters for the SpacecraftsClient.BeginCreateOrUpdate // method. @@ -76,7 +77,7 @@ func (client *SpacecraftsClient) BeginCreateOrUpdate(ctx context.Context, resour } } -// CreateOrUpdate - Creates or updates a spacecraft resource +// CreateOrUpdate - Creates or updates a spacecraft resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 func (client *SpacecraftsClient) createOrUpdate(ctx context.Context, resourceGroupName string, spacecraftName string, parameters Spacecraft, options *SpacecraftsClientBeginCreateOrUpdateOptions) (*http.Response, error) { @@ -124,7 +125,7 @@ func (client *SpacecraftsClient) createOrUpdateCreateRequest(ctx context.Context // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID +// spacecraftName - Spacecraft ID. // options - SpacecraftsClientBeginDeleteOptions contains the optional parameters for the SpacecraftsClient.BeginDelete method. func (client *SpacecraftsClient) BeginDelete(ctx context.Context, resourceGroupName string, spacecraftName string, options *SpacecraftsClientBeginDeleteOptions) (*runtime.Poller[SpacecraftsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -184,11 +185,11 @@ func (client *SpacecraftsClient) deleteCreateRequest(ctx context.Context, resour return req, nil } -// Get - Gets the specified spacecraft in a specified resource group +// Get - Gets the specified spacecraft in a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID +// spacecraftName - Spacecraft ID. // options - SpacecraftsClientGetOptions contains the optional parameters for the SpacecraftsClient.Get method. func (client *SpacecraftsClient) Get(ctx context.Context, resourceGroupName string, spacecraftName string, options *SpacecraftsClientGetOptions) (SpacecraftsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, spacecraftName, options) @@ -240,7 +241,7 @@ func (client *SpacecraftsClient) getHandleResponse(resp *http.Response) (Spacecr return result, nil } -// NewListPager - Return list of spacecrafts +// NewListPager - Returns list of spacecrafts by resource group. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. @@ -307,11 +308,12 @@ func (client *SpacecraftsClient) listHandleResponse(resp *http.Response) (Spacec return result, nil } -// BeginListAvailableContacts - Return list of available contacts +// BeginListAvailableContacts - Returns list of available contacts. A contact is available if the spacecraft is visible from +// the ground station for more than the minimum viable contact duration provided in the contact profile. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID +// spacecraftName - Spacecraft ID. // parameters - The parameters to provide for the contacts. // options - SpacecraftsClientBeginListAvailableContactsOptions contains the optional parameters for the SpacecraftsClient.BeginListAvailableContacts // method. @@ -351,7 +353,8 @@ func (client *SpacecraftsClient) BeginListAvailableContacts(ctx context.Context, } } -// ListAvailableContacts - Return list of available contacts +// ListAvailableContacts - Returns list of available contacts. A contact is available if the spacecraft is visible from the +// ground station for more than the minimum viable contact duration provided in the contact profile. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 func (client *SpacecraftsClient) listAvailableContacts(ctx context.Context, resourceGroupName string, spacecraftName string, parameters ContactParameters, options *SpacecraftsClientBeginListAvailableContactsOptions) (*http.Response, error) { @@ -404,7 +407,7 @@ func (client *SpacecraftsClient) listAvailableContactsHandleResponse(resp *http. return result, nil } -// NewListBySubscriptionPager - Return list of spacecrafts +// NewListBySubscriptionPager - Returns list of spacecrafts by subscription. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // options - SpacecraftsClientListBySubscriptionOptions contains the optional parameters for the SpacecraftsClient.ListBySubscription @@ -471,7 +474,7 @@ func (client *SpacecraftsClient) listBySubscriptionHandleResponse(resp *http.Res // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// spacecraftName - Spacecraft ID +// spacecraftName - Spacecraft ID. // parameters - Parameters supplied to update spacecraft tags. // options - SpacecraftsClientBeginUpdateTagsOptions contains the optional parameters for the SpacecraftsClient.BeginUpdateTags // method. diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_time_rfc3339.go b/sdk/resourcemanager/orbital/armorbital/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/orbital/armorbital/time_rfc3339.go index 3b19e783796c..5c9b1c483892 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/orbital/armorbital/time_rfc3339.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armorbital 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 59e35ae614da..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_availablegroundstations_client_test.go +++ /dev/null @@ -1,63 +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/stable/2022-03-01/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("subId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByCapabilityPager(armorbital.CapabilityParameterEarthObservation, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "westus_gs1", - 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 159abb3f0188..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_contactprofiles_client_test.go +++ /dev/null @@ -1,230 +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/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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "AQUA_DIRECTPLAYBACK_WITH_UPLINK", - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "AQUA_DIRECTPLAYBACK_WITH_UPLINK", - armorbital.ContactProfile{ - Location: to.Ptr("westus"), - Properties: &armorbital.ContactProfileProperties{ - AutoTrackingConfiguration: to.Ptr(armorbital.AutoTrackingConfigurationXBand), - EventHubURI: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.EventHub/namespaces/orbitalppewestus2-ns/eventhubs/telemetry-hub/"), - Links: []*armorbital.ContactProfileLink{ - { - Name: to.Ptr("RHCP_UL"), - Channels: []*armorbital.ContactProfileLinkChannel{ - { - Name: to.Ptr("channel1"), - BandwidthMHz: to.Ptr[float32](0.036), - CenterFrequencyMHz: to.Ptr[float32](2106.4063), - DecodingConfiguration: to.Ptr("na"), - DemodulationConfiguration: to.Ptr("na"), - EncodingConfiguration: to.Ptr("AQUA_CMD_CCSDS"), - EndPoint: &armorbital.EndPoint{ - EndPointName: to.Ptr("AQUA_command"), - IPAddress: to.Ptr("10.0.1.0"), - Port: to.Ptr("4000"), - Protocol: to.Ptr(armorbital.ProtocolTCP), - }, - ModulationConfiguration: to.Ptr("AQUA_UPLINK_BPSK"), - }}, - Direction: to.Ptr(armorbital.DirectionUplink), - EirpdBW: to.Ptr[float32](45), - GainOverTemperature: to.Ptr[float32](0), - Polarization: to.Ptr(armorbital.PolarizationRHCP), - }, - { - Name: to.Ptr("RHCP_DL"), - Channels: []*armorbital.ContactProfileLinkChannel{ - { - Name: to.Ptr("channel1"), - BandwidthMHz: to.Ptr[float32](150), - CenterFrequencyMHz: to.Ptr[float32](8160), - DecodingConfiguration: to.Ptr("AQUA_DIRECTPLAYBACK_CCSDS"), - DemodulationConfiguration: to.Ptr("AQUA_DOWNLINK_QPSK"), - EncodingConfiguration: to.Ptr("na"), - EndPoint: &armorbital.EndPoint{ - EndPointName: to.Ptr("AQUA_directplayback"), - IPAddress: to.Ptr("10.0.2.0"), - Port: to.Ptr("4000"), - Protocol: to.Ptr(armorbital.ProtocolTCP), - }, - ModulationConfiguration: to.Ptr("na"), - }}, - 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("PT1M"), - NetworkConfiguration: &armorbital.ContactProfilesPropertiesNetworkConfiguration{ - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnetName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "AQUA_DIRECTPLAYBACK_WITH_UPLINK", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - 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/stable/2022-03-01/examples/ContactProfileUpdateTag.json -func ExampleContactProfilesClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewContactProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateTags(ctx, - "rg1", - "AQUA_DIRECTPLAYBACK_WITH_UPLINK", - 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) - } - res, err := poller.PollUntilDone(ctx, nil) - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armorbital.ContactProfilesClientListBySubscriptionOptions{Skiptoken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - &armorbital.ContactProfilesClientListOptions{Skiptoken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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 8940f649ee99..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_contacts_client_test.go +++ /dev/null @@ -1,131 +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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "AQUA", - &armorbital.ContactsClientListOptions{Skiptoken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "AQUA", - "contact1", - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "rg1", - "AQUA", - "contact1", - armorbital.Contact{ - Properties: &armorbital.ContactsProperties{ - ContactProfile: &armorbital.ContactsPropertiesContactProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/Microsoft.Orbital/contactProfiles/AQUA_DIRECTPLAYBACK_WITH_UPLINK"), - }, - GroundStationName: to.Ptr("westus_gs1"), - 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 }()), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "AQUA", - "contact1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - 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 e3f785636671..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +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/stable/2022-03-01/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) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_operationsresults_client_test.go b/sdk/resourcemanager/orbital/armorbital/ze_generated_example_operationsresults_client_test.go deleted file mode 100644 index 2214bd65e95c..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_operationsresults_client_test.go +++ /dev/null @@ -1,43 +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/stable/2022-03-01/examples/OperationResultsGet.json -func ExampleOperationsResultsClient_BeginGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewOperationsResultsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGet(ctx, - "westus", - "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} 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 cf59eafc40c9..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/ze_generated_example_spacecrafts_client_test.go +++ /dev/null @@ -1,239 +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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armorbital.SpacecraftsClientListBySubscriptionOptions{Skiptoken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - &armorbital.SpacecraftsClientListOptions{Skiptoken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "AQUA", - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "AQUA", - armorbital.Spacecraft{ - Location: to.Ptr("westus"), - Properties: &armorbital.SpacecraftsProperties{ - Links: []*armorbital.SpacecraftLink{ - { - Name: to.Ptr("S_RHCP_UL"), - BandwidthMHz: to.Ptr[float32](0.036), - CenterFrequencyMHz: to.Ptr[float32](2106.4063), - Direction: to.Ptr(armorbital.DirectionUplink), - Polarization: to.Ptr(armorbital.PolarizationRHCP), - }, - { - Name: to.Ptr("X_RHCP_DL"), - BandwidthMHz: to.Ptr[float32](150), - CenterFrequencyMHz: to.Ptr[float32](8125), - Direction: to.Ptr(armorbital.DirectionDownlink), - Polarization: to.Ptr(armorbital.PolarizationRHCP), - }}, - NoradID: to.Ptr("27424"), - TitleLine: to.Ptr("(AQUA)"), - TleLine1: to.Ptr("1 27424U 02022A 20195.59202355 .00000039 00000-0 18634-4 0 9991"), - TleLine2: to.Ptr("2 27424 98.2098 135.8486 0000176 28.4050 144.5909 14.57108832967671"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "AQUA", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - 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/stable/2022-03-01/examples/SpacecraftUpdateTags.json -func ExampleSpacecraftsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armorbital.NewSpacecraftsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateTags(ctx, - "rg1", - "AQUA", - 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) - } - res, err := poller.PollUntilDone(ctx, nil) - 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/stable/2022-03-01/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginListAvailableContacts(ctx, - "rgName", - "AQUA", - armorbital.ContactParameters{ - ContactProfile: &armorbital.ContactParametersContactProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/Microsoft.Orbital/contactProfiles/AQUA_DIRECTPLAYBACK_WITH_UPLINK"), - }, - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-17T23:49:40.00Z"); return t }()), - GroundStationName: to.Ptr("westus_gs1"), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-16T05:40:21.00Z"); return t }()), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - for res.More() { - nextResult, err := res.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_models_serde.go b/sdk/resourcemanager/orbital/armorbital/zz_generated_models_serde.go deleted file mode 100644 index 78a1b797c9e3..000000000000 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_models_serde.go +++ /dev/null @@ -1,490 +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 - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "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 fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "expirationDate": - err = unpopulateDateType(val, "ExpirationDate", &a.ExpirationDate) - delete(rawMsg, key) - case "groundStation": - err = unpopulate(val, "GroundStation", &a.GroundStation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endAzimuthDegrees": - err = unpopulate(val, "EndAzimuthDegrees", &a.EndAzimuthDegrees) - delete(rawMsg, key) - case "endElevationDegrees": - err = unpopulate(val, "EndElevationDegrees", &a.EndElevationDegrees) - delete(rawMsg, key) - case "maximumElevationDegrees": - err = unpopulate(val, "MaximumElevationDegrees", &a.MaximumElevationDegrees) - delete(rawMsg, key) - case "rxEndTime": - err = unpopulateTimeRFC3339(val, "RxEndTime", &a.RxEndTime) - delete(rawMsg, key) - case "rxStartTime": - err = unpopulateTimeRFC3339(val, "RxStartTime", &a.RxStartTime) - delete(rawMsg, key) - case "startAzimuthDegrees": - err = unpopulate(val, "StartAzimuthDegrees", &a.StartAzimuthDegrees) - delete(rawMsg, key) - case "startElevationDegrees": - err = unpopulate(val, "StartElevationDegrees", &a.StartElevationDegrees) - delete(rawMsg, key) - case "txEndTime": - err = unpopulateTimeRFC3339(val, "TxEndTime", &a.TxEndTime) - delete(rawMsg, key) - case "txStartTime": - err = unpopulateTimeRFC3339(val, "TxStartTime", &a.TxStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContactInstanceProperties. -func (c *ContactInstanceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endAzimuthDegrees": - err = unpopulate(val, "EndAzimuthDegrees", &c.EndAzimuthDegrees) - delete(rawMsg, key) - case "endElevationDegrees": - err = unpopulate(val, "EndElevationDegrees", &c.EndElevationDegrees) - delete(rawMsg, key) - case "maximumElevationDegrees": - err = unpopulate(val, "MaximumElevationDegrees", &c.MaximumElevationDegrees) - delete(rawMsg, key) - case "rxEndTime": - err = unpopulateTimeRFC3339(val, "RxEndTime", &c.RxEndTime) - delete(rawMsg, key) - case "rxStartTime": - err = unpopulateTimeRFC3339(val, "RxStartTime", &c.RxStartTime) - delete(rawMsg, key) - case "startAzimuthDegrees": - err = unpopulate(val, "StartAzimuthDegrees", &c.StartAzimuthDegrees) - delete(rawMsg, key) - case "startElevationDegrees": - err = unpopulate(val, "StartElevationDegrees", &c.StartElevationDegrees) - delete(rawMsg, key) - case "txEndTime": - err = unpopulateTimeRFC3339(val, "TxEndTime", &c.TxEndTime) - delete(rawMsg, key) - case "txStartTime": - err = unpopulateTimeRFC3339(val, "TxStartTime", &c.TxStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContactParameters. -func (c ContactParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contactProfile", c.ContactProfile) - populateTimeRFC3339(objectMap, "endTime", c.EndTime) - populate(objectMap, "groundStationName", c.GroundStationName) - populateTimeRFC3339(objectMap, "startTime", c.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContactParameters. -func (c *ContactParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "contactProfile": - err = unpopulate(val, "ContactProfile", &c.ContactProfile) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &c.EndTime) - delete(rawMsg, key) - case "groundStationName": - err = unpopulate(val, "GroundStationName", &c.GroundStationName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &c.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContactProfile. -func (c ContactProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ContactProfileLink. -func (c ContactProfileLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "channels", c.Channels) - 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) -} - -// 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{}) - 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 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) - populateTimeRFC3339(objectMap, "rxStartTime", c.RxStartTime) - populate(objectMap, "startAzimuthDegrees", c.StartAzimuthDegrees) - populate(objectMap, "startElevationDegrees", c.StartElevationDegrees) - populate(objectMap, "status", c.Status) - populateTimeRFC3339(objectMap, "txEndTime", c.TxEndTime) - populateTimeRFC3339(objectMap, "txStartTime", c.TxStartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContactsProperties. -func (c *ContactsProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "antennaConfiguration": - err = unpopulate(val, "AntennaConfiguration", &c.AntennaConfiguration) - delete(rawMsg, key) - case "contactProfile": - err = unpopulate(val, "ContactProfile", &c.ContactProfile) - delete(rawMsg, key) - case "endAzimuthDegrees": - err = unpopulate(val, "EndAzimuthDegrees", &c.EndAzimuthDegrees) - delete(rawMsg, key) - case "endElevationDegrees": - err = unpopulate(val, "EndElevationDegrees", &c.EndElevationDegrees) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &c.ErrorMessage) - delete(rawMsg, key) - case "groundStationName": - err = unpopulate(val, "GroundStationName", &c.GroundStationName) - delete(rawMsg, key) - case "maximumElevationDegrees": - err = unpopulate(val, "MaximumElevationDegrees", &c.MaximumElevationDegrees) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "reservationEndTime": - err = unpopulateTimeRFC3339(val, "ReservationEndTime", &c.ReservationEndTime) - delete(rawMsg, key) - case "reservationStartTime": - err = unpopulateTimeRFC3339(val, "ReservationStartTime", &c.ReservationStartTime) - delete(rawMsg, key) - case "rxEndTime": - err = unpopulateTimeRFC3339(val, "RxEndTime", &c.RxEndTime) - delete(rawMsg, key) - case "rxStartTime": - err = unpopulateTimeRFC3339(val, "RxStartTime", &c.RxStartTime) - delete(rawMsg, key) - case "startAzimuthDegrees": - err = unpopulate(val, "StartAzimuthDegrees", &c.StartAzimuthDegrees) - delete(rawMsg, key) - case "startElevationDegrees": - err = unpopulate(val, "StartElevationDegrees", &c.StartElevationDegrees) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - delete(rawMsg, key) - case "txEndTime": - err = unpopulateTimeRFC3339(val, "TxEndTime", &c.TxEndTime) - delete(rawMsg, key) - case "txStartTime": - err = unpopulateTimeRFC3339(val, "TxStartTime", &c.TxStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - 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) -} - -// 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 fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &o.Error) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &o.PercentComplete) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Spacecraft. -func (s Spacecraft) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - 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 SpacecraftsProperties. -func (s SpacecraftsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TagsObject. -func (t TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}