From bf6ec06a7392fb9a86153e3a1529e331705b3ae9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 2 Mar 2023 05:13:42 +0000 Subject: [PATCH] CodeGen from PR 22080 in Azure/azure-rest-api-specs api-version 2022-11-01 orbital (#22080) * first commit-2022-03-1 version copied as is and named 2022-11-01 * introduced new api-version changes * ran prettier check * updated default values * addressed comments * addressed comments and fix model validation error for contacts * fixed model validation * added description of the value field * added empty x-ms-identifier array for xms validation error * updated swagger specs as per sdk teams' ask * fixed description * addressed comments * added proxy type for available ground stations * removed x-ms-azure-resource as per comment * clearing the allOf tag for swagger lint error due to proxy resource being idenitified as tracked * updated to use common types definition of apiversionParameter * addressed comments * fixed description * fix date on example * fixed casing of enums * removing available ground stations point GET after confirming with the ARM team --- .../orbital/armorbital/CHANGELOG.md | 23 + .../orbital/armorbital/autorest.md | 6 +- ...t.go => availablegroundstations_client.go} | 73 +- ...zz_generated_constants.go => constants.go} | 96 +- ...es_client.go => contactprofiles_client.go} | 101 +- ..._contacts_client.go => contacts_client.go} | 74 +- ...zz_generated_date_type.go => date_type.go} | 3 +- sdk/resourcemanager/orbital/armorbital/go.mod | 16 +- sdk/resourcemanager/orbital/armorbital/go.sum | 24 +- .../{zz_generated_models.go => models.go} | 307 +-- .../orbital/armorbital/models_serde.go | 1895 +++++++++++++++++ ...rations_client.go => operations_client.go} | 13 +- ..._client.go => operationsresults_client.go} | 27 +- ...ed_response_types.go => response_types.go} | 40 +- ...crafts_client.go => spacecrafts_client.go} | 124 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 3 +- ...ple_availablegroundstations_client_test.go | 63 - ...ted_example_contactprofiles_client_test.go | 230 -- ..._generated_example_contacts_client_test.go | 131 -- ...enerated_example_operations_client_test.go | 41 - ...d_example_operationsresults_client_test.go | 43 - ...nerated_example_spacecrafts_client_test.go | 239 --- .../armorbital/zz_generated_models_serde.go | 490 ----- 23 files changed, 2356 insertions(+), 1706 deletions(-) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_availablegroundstations_client.go => availablegroundstations_client.go} (60%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_constants.go => constants.go} (81%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_contactprofiles_client.go => contactprofiles_client.go} (87%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_contacts_client.go => contacts_client.go} (86%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_date_type.go => date_type.go} (94%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_models.go => models.go} (78%) create mode 100644 sdk/resourcemanager/orbital/armorbital/models_serde.go rename sdk/resourcemanager/orbital/armorbital/{zz_generated_operations_client.go => operations_client.go} (89%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_operationsresults_client.go => operationsresults_client.go} (84%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_response_types.go => response_types.go} (78%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_spacecrafts_client.go => spacecrafts_client.go} (86%) rename sdk/resourcemanager/orbital/armorbital/{zz_generated_time_rfc3339.go => time_rfc3339.go} (96%) delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_availablegroundstations_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_contactprofiles_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_contacts_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_operationsresults_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/ze_generated_example_spacecrafts_client_test.go delete mode 100644 sdk/resourcemanager/orbital/armorbital/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md b/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md index 23de10d77feb..a6d085347d96 100644 --- a/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md +++ b/sdk/resourcemanager/orbital/armorbital/CHANGELOG.md @@ -1,5 +1,28 @@ # Release History +## 2.0.0 (2023-03-02) +### Breaking Changes + +- Type alias `APIVersionParameter` has been removed +- Function `*AvailableGroundStationsClient.Get` has been removed +- Struct `CloudError` has been removed +- Struct `CloudErrorBody` has been removed +- Field `Etag` of struct `Contact` has been removed +- Field `Etag` of struct `ContactProfile` has been removed +- Field `Etag` of struct `Spacecraft` has been removed + +### Features Added + +- New struct `ContactProfileThirdPartyConfiguration` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ErrorResponse` +- New field `ThirdPartyConfigurations` in struct `ContactProfileProperties` +- New field `ThirdPartyConfigurations` in struct `ContactProfilesProperties` +- New field `NextLink` in struct `OperationResult` +- New field `Value` in struct `OperationResult` + + ## 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..2c565ccf9047 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: 2.0.0 ``` \ 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 60% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_availablegroundstations_client.go rename to sdk/resourcemanager/orbital/armorbital/availablegroundstations_client.go index 33ddd1fd8fdc..0d23d5386f28 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 @@ -31,9 +32,9 @@ type AvailableGroundStationsClient struct { } // NewAvailableGroundStationsClient creates a new instance of AvailableGroundStationsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAvailableGroundStationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableGroundStationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,64 +55,12 @@ func NewAvailableGroundStationsClient(subscriptionID string, credential azcore.T return client, nil } -// 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 -// options - AvailableGroundStationsClientGetOptions contains the optional parameters for the AvailableGroundStationsClient.Get -// method. -func (client *AvailableGroundStationsClient) Get(ctx context.Context, groundStationName string, options *AvailableGroundStationsClientGetOptions) (AvailableGroundStationsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, groundStationName, options) - if err != nil { - return AvailableGroundStationsClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AvailableGroundStationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailableGroundStationsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *AvailableGroundStationsClient) getCreateRequest(ctx context.Context, groundStationName string, options *AvailableGroundStationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/availableGroundStations/{groundStationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if groundStationName == "" { - return nil, errors.New("parameter groundStationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{groundStationName}", url.PathEscape(groundStationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AvailableGroundStationsClient) getHandleResponse(resp *http.Response) (AvailableGroundStationsClientGetResponse, error) { - result := AvailableGroundStationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailableGroundStation); err != nil { - return AvailableGroundStationsClientGetResponse{}, err - } - return result, nil -} - -// 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 -// options - AvailableGroundStationsClientListByCapabilityOptions contains the optional parameters for the AvailableGroundStationsClient.ListByCapability -// method. +// NewListByCapabilityPager - Returns list of available ground stations. +// +// Generated from API version 2022-11-01 +// - capability - Ground Station Capability. +// - options - AvailableGroundStationsClientListByCapabilityOptions contains the optional parameters for the AvailableGroundStationsClient.NewListByCapabilityPager +// method. func (client *AvailableGroundStationsClient) NewListByCapabilityPager(capability CapabilityParameter, options *AvailableGroundStationsClientListByCapabilityOptions) *runtime.Pager[AvailableGroundStationsClientListByCapabilityResponse] { return runtime.NewPager(runtime.PagingHandler[AvailableGroundStationsClientListByCapabilityResponse]{ More: func(page AvailableGroundStationsClientListByCapabilityResponse) bool { @@ -152,7 +101,7 @@ func (client *AvailableGroundStationsClient) listByCapabilityCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") reqQP.Set("capability", string(capability)) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go b/sdk/resourcemanager/orbital/armorbital/constants.go similarity index 81% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go rename to sdk/resourcemanager/orbital/armorbital/constants.go index 14f241071afd..c7363b1e9848 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_constants.go +++ b/sdk/resourcemanager/orbital/armorbital/constants.go @@ -5,31 +5,15 @@ // 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 = "v2.0.0" ) -type APIVersionParameter string - -const ( - APIVersionParameterTwoThousandTwenty0901Preview APIVersionParameter = "2020-09-01-preview" - APIVersionParameterTwoThousandTwentyOne0404Preview APIVersionParameter = "2021-04-04-preview" - APIVersionParameterTwoThousandTwentyTwo0301 APIVersionParameter = "2022-03-01" -) - -// PossibleAPIVersionParameterValues returns the possible values for the APIVersionParameter const type. -func PossibleAPIVersionParameterValues() []APIVersionParameter { - return []APIVersionParameter{ - APIVersionParameterTwoThousandTwenty0901Preview, - APIVersionParameterTwoThousandTwentyOne0404Preview, - APIVersionParameterTwoThousandTwentyTwo0301, - } -} - // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. type ActionType string @@ -44,7 +28,7 @@ func PossibleActionTypeValues() []ActionType { } } -// AutoTrackingConfiguration - Auto track configuration. +// AutoTrackingConfiguration - Auto-tracking configuration. type AutoTrackingConfiguration string const ( @@ -93,16 +77,16 @@ 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 ( - ContactProfilesPropertiesProvisioningStateCanceled ContactProfilesPropertiesProvisioningState = "Canceled" - ContactProfilesPropertiesProvisioningStateCreating ContactProfilesPropertiesProvisioningState = "Creating" - ContactProfilesPropertiesProvisioningStateDeleting ContactProfilesPropertiesProvisioningState = "Deleting" - ContactProfilesPropertiesProvisioningStateFailed ContactProfilesPropertiesProvisioningState = "Failed" - ContactProfilesPropertiesProvisioningStateSucceeded ContactProfilesPropertiesProvisioningState = "Succeeded" - ContactProfilesPropertiesProvisioningStateUpdating ContactProfilesPropertiesProvisioningState = "Updating" + ContactProfilesPropertiesProvisioningStateCanceled ContactProfilesPropertiesProvisioningState = "canceled" + ContactProfilesPropertiesProvisioningStateCreating ContactProfilesPropertiesProvisioningState = "creating" + ContactProfilesPropertiesProvisioningStateDeleting ContactProfilesPropertiesProvisioningState = "deleting" + ContactProfilesPropertiesProvisioningStateFailed ContactProfilesPropertiesProvisioningState = "failed" + ContactProfilesPropertiesProvisioningStateSucceeded ContactProfilesPropertiesProvisioningState = "succeeded" + ContactProfilesPropertiesProvisioningStateUpdating ContactProfilesPropertiesProvisioningState = "updating" ) // PossibleContactProfilesPropertiesProvisioningStateValues returns the possible values for the ContactProfilesPropertiesProvisioningState const type. @@ -117,16 +101,16 @@ 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 ( - ContactsPropertiesProvisioningStateCanceled ContactsPropertiesProvisioningState = "Canceled" - ContactsPropertiesProvisioningStateCreating ContactsPropertiesProvisioningState = "Creating" - ContactsPropertiesProvisioningStateDeleting ContactsPropertiesProvisioningState = "Deleting" - ContactsPropertiesProvisioningStateFailed ContactsPropertiesProvisioningState = "Failed" - ContactsPropertiesProvisioningStateSucceeded ContactsPropertiesProvisioningState = "Succeeded" - ContactsPropertiesProvisioningStateUpdating ContactsPropertiesProvisioningState = "Updating" + ContactsPropertiesProvisioningStateCanceled ContactsPropertiesProvisioningState = "canceled" + ContactsPropertiesProvisioningStateCreating ContactsPropertiesProvisioningState = "creating" + ContactsPropertiesProvisioningStateDeleting ContactsPropertiesProvisioningState = "deleting" + ContactsPropertiesProvisioningStateFailed ContactsPropertiesProvisioningState = "failed" + ContactsPropertiesProvisioningStateSucceeded ContactsPropertiesProvisioningState = "succeeded" + ContactsPropertiesProvisioningStateUpdating ContactsPropertiesProvisioningState = "updating" ) // PossibleContactsPropertiesProvisioningStateValues returns the possible values for the ContactsPropertiesProvisioningState const type. @@ -145,21 +129,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,12 +167,12 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// Direction - Direction (uplink or downlink) +// Direction - Direction (Uplink or Downlink). type Direction string const ( - DirectionDownlink Direction = "downlink" - DirectionUplink Direction = "uplink" + DirectionDownlink Direction = "Downlink" + DirectionUplink Direction = "Uplink" ) // PossibleDirectionValues returns the possible values for the Direction const type. @@ -218,7 +202,7 @@ func PossibleOriginValues() []Origin { } } -// Polarization - polarization. eg (RHCP, LHCP) +// Polarization - Polarization. e.g. (RHCP, LHCP). type Polarization string const ( @@ -254,16 +238,16 @@ 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 ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" + ProvisioningStateCanceled ProvisioningState = "canceled" + ProvisioningStateCreating ProvisioningState = "creating" + ProvisioningStateDeleting ProvisioningState = "deleting" + ProvisioningStateFailed ProvisioningState = "failed" + ProvisioningStateSucceeded ProvisioningState = "succeeded" + ProvisioningStateUpdating ProvisioningState = "updating" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. @@ -278,7 +262,7 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } -// ReleaseMode - Release Status of a ground station +// ReleaseMode - Release Status of a ground station. type ReleaseMode string const ( @@ -294,16 +278,16 @@ 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 ( - SpacecraftsPropertiesProvisioningStateCanceled SpacecraftsPropertiesProvisioningState = "Canceled" - SpacecraftsPropertiesProvisioningStateCreating SpacecraftsPropertiesProvisioningState = "Creating" - SpacecraftsPropertiesProvisioningStateDeleting SpacecraftsPropertiesProvisioningState = "Deleting" - SpacecraftsPropertiesProvisioningStateFailed SpacecraftsPropertiesProvisioningState = "Failed" - SpacecraftsPropertiesProvisioningStateSucceeded SpacecraftsPropertiesProvisioningState = "Succeeded" - SpacecraftsPropertiesProvisioningStateUpdating SpacecraftsPropertiesProvisioningState = "Updating" + SpacecraftsPropertiesProvisioningStateCanceled SpacecraftsPropertiesProvisioningState = "canceled" + SpacecraftsPropertiesProvisioningStateCreating SpacecraftsPropertiesProvisioningState = "creating" + SpacecraftsPropertiesProvisioningStateDeleting SpacecraftsPropertiesProvisioningState = "deleting" + SpacecraftsPropertiesProvisioningStateFailed SpacecraftsPropertiesProvisioningState = "failed" + SpacecraftsPropertiesProvisioningStateSucceeded SpacecraftsPropertiesProvisioningState = "succeeded" + SpacecraftsPropertiesProvisioningStateUpdating SpacecraftsPropertiesProvisioningState = "updating" ) // PossibleSpacecraftsPropertiesProvisioningStateValues returns the possible values for the SpacecraftsPropertiesProvisioningState const type. diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go b/sdk/resourcemanager/orbital/armorbital/contactprofiles_client.go similarity index 87% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_contactprofiles_client.go rename to sdk/resourcemanager/orbital/armorbital/contactprofiles_client.go index c935248ae0f8..70c1f44430b4 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 @@ -31,9 +32,9 @@ type ContactProfilesClient struct { } // NewContactProfilesClient creates a new instance of ContactProfilesClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewContactProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContactProfilesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,14 +55,15 @@ 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 -// parameters - The parameters to provide for the created Contact Profile. -// options - ContactProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the ContactProfilesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - 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. func (client *ContactProfilesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, contactProfileName string, parameters ContactProfile, options *ContactProfilesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContactProfilesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, contactProfileName, parameters, options) @@ -76,9 +78,10 @@ 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 +// +// Generated from API version 2022-11-01 func (client *ContactProfilesClient) createOrUpdate(ctx context.Context, resourceGroupName string, contactProfileName string, parameters ContactProfile, options *ContactProfilesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, contactProfileName, parameters, options) if err != nil { @@ -114,7 +117,7 @@ func (client *ContactProfilesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,11 +125,12 @@ func (client *ContactProfilesClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes a specified contact profile 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. -// contactProfileName - Contact Profile Name -// options - ContactProfilesClientBeginDeleteOptions contains the optional parameters for the ContactProfilesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - 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) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, contactProfileName, options) @@ -143,7 +147,8 @@ func (client *ContactProfilesClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes a specified contact profile resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *ContactProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, contactProfileName string, options *ContactProfilesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, contactProfileName, options) if err != nil { @@ -179,18 +184,19 @@ func (client *ContactProfilesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} 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 -// options - ContactProfilesClientGetOptions contains the optional parameters for the ContactProfilesClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - 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) if err != nil { @@ -226,7 +232,7 @@ func (client *ContactProfilesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,11 +247,12 @@ func (client *ContactProfilesClient) getHandleResponse(resp *http.Response) (Con return result, nil } -// 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. -// options - ContactProfilesClientListOptions contains the optional parameters for the ContactProfilesClient.List method. +// NewListPager - Returns list of contact profiles by Resource Group. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ContactProfilesClientListOptions contains the optional parameters for the ContactProfilesClient.NewListPager +// method. func (client *ContactProfilesClient) NewListPager(resourceGroupName string, options *ContactProfilesClientListOptions) *runtime.Pager[ContactProfilesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ContactProfilesClientListResponse]{ More: func(page ContactProfilesClientListResponse) bool { @@ -290,7 +297,7 @@ func (client *ContactProfilesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } @@ -308,11 +315,11 @@ func (client *ContactProfilesClient) listHandleResponse(resp *http.Response) (Co return result, nil } -// 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 -// method. +// NewListBySubscriptionPager - Returns list of contact profiles by Subscription. +// +// Generated from API version 2022-11-01 +// - options - ContactProfilesClientListBySubscriptionOptions contains the optional parameters for the ContactProfilesClient.NewListBySubscriptionPager +// method. func (client *ContactProfilesClient) NewListBySubscriptionPager(options *ContactProfilesClientListBySubscriptionOptions) *runtime.Pager[ContactProfilesClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ContactProfilesClientListBySubscriptionResponse]{ More: func(page ContactProfilesClientListBySubscriptionResponse) bool { @@ -353,7 +360,7 @@ func (client *ContactProfilesClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } @@ -373,12 +380,13 @@ func (client *ContactProfilesClient) listBySubscriptionHandleResponse(resp *http // BeginUpdateTags - Updates the specified contact profile tags. // 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 -// parameters - Parameters supplied to update contact profile tags. -// options - ContactProfilesClientBeginUpdateTagsOptions contains the optional parameters for the ContactProfilesClient.BeginUpdateTags -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - contactProfileName - Contact Profile name. +// - parameters - Parameters supplied to update contact profile tags. +// - options - ContactProfilesClientBeginUpdateTagsOptions contains the optional parameters for the ContactProfilesClient.BeginUpdateTags +// method. func (client *ContactProfilesClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, contactProfileName string, parameters TagsObject, options *ContactProfilesClientBeginUpdateTagsOptions) (*runtime.Poller[ContactProfilesClientUpdateTagsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateTags(ctx, resourceGroupName, contactProfileName, parameters, options) @@ -395,7 +403,8 @@ func (client *ContactProfilesClient) BeginUpdateTags(ctx context.Context, resour // UpdateTags - Updates the specified contact profile tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *ContactProfilesClient) updateTags(ctx context.Context, resourceGroupName string, contactProfileName string, parameters TagsObject, options *ContactProfilesClientBeginUpdateTagsOptions) (*http.Response, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, contactProfileName, parameters, options) if err != nil { @@ -431,7 +440,7 @@ func (client *ContactProfilesClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go b/sdk/resourcemanager/orbital/armorbital/contacts_client.go similarity index 86% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_contacts_client.go rename to sdk/resourcemanager/orbital/armorbital/contacts_client.go index 6ba388d32c23..4237809e2164 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 @@ -31,9 +32,9 @@ type ContactsClient struct { } // NewContactsClient creates a new instance of ContactsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewContactsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContactsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewContactsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a 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 -// parameters - The parameters to provide for the created contact. -// options - ContactsClientBeginCreateOptions contains the optional parameters for the ContactsClient.BeginCreate method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - 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) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, spacecraftName, contactName, parameters, options) @@ -78,7 +80,8 @@ func (client *ContactsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a contact. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *ContactsClient) create(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, parameters Contact, options *ContactsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, spacecraftName, contactName, parameters, options) if err != nil { @@ -118,19 +121,20 @@ func (client *ContactsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} 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 -// options - ContactsClientBeginDeleteOptions contains the optional parameters for the ContactsClient.BeginDelete method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - 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 == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, spacecraftName, contactName, options) @@ -145,9 +149,10 @@ 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 +// +// Generated from API version 2022-11-01 func (client *ContactsClient) deleteOperation(ctx context.Context, resourceGroupName string, spacecraftName string, contactName string, options *ContactsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, spacecraftName, contactName, options) if err != nil { @@ -187,19 +192,20 @@ func (client *ContactsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} 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 -// options - ContactsClientGetOptions contains the optional parameters for the ContactsClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - 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) if err != nil { @@ -239,7 +245,7 @@ func (client *ContactsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,12 +260,12 @@ func (client *ContactsClient) getHandleResponse(resp *http.Response) (ContactsCl return result, nil } -// 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 -// options - ContactsClientListOptions contains the optional parameters for the ContactsClient.List method. +// NewListPager - Returns list of contacts by spacecraftName. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - spacecraftName - Spacecraft ID. +// - options - ContactsClientListOptions contains the optional parameters for the ContactsClient.NewListPager method. func (client *ContactsClient) NewListPager(resourceGroupName string, spacecraftName string, options *ContactsClientListOptions) *runtime.Pager[ContactsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ContactsClientListResponse]{ More: func(page ContactsClientListResponse) bool { @@ -308,7 +314,7 @@ func (client *ContactsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go b/sdk/resourcemanager/orbital/armorbital/date_type.go similarity index 94% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_date_type.go rename to sdk/resourcemanager/orbital/armorbital/date_type.go index 8e8dc7249a5f..0e58322ac74c 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 @@ -34,7 +35,7 @@ func (d *dateType) UnmarshalJSON(data []byte) (err error) { return err } -func populateDateType(m map[string]interface{}, k string, t *time.Time) { +func populateDateType(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/orbital/armorbital/go.mod b/sdk/resourcemanager/orbital/armorbital/go.mod index c960d96ee3a1..203f20c53e9a 100644 --- a/sdk/resourcemanager/orbital/armorbital/go.mod +++ b/sdk/resourcemanager/orbital/armorbital/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/orbital/armorbital/v2 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 78% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_models.go rename to sdk/resourcemanager/orbital/armorbital/models.go index 3194a88db9de..1686ffd20b40 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 + // REQUIRED; Date of authorization expiration. ExpirationDate *time.Time `json:"expirationDate,omitempty"` - // Groundstation name + // REQUIRED; 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,28 +65,28 @@ 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"` } // AvailableContactsSpacecraft - The reference to the spacecraft resource. type AvailableContactsSpacecraft struct { - // Resource ID. + // REQUIRED; Resource ID. ID *string `json:"id,omitempty"` } -// AvailableGroundStation - GroundStations available to schedule Contacts +// AvailableGroundStation - Ground Stations available to schedule Contacts. type AvailableGroundStation struct { - // Azure region - Location *string `json:"location,omitempty"` - - // The properties bag for this resource + // REQUIRED; The properties bag for this resource. Properties *AvailableGroundStationProperties `json:"properties,omitempty"` - // READ-ONLY; Id of groundStation + // Azure region. + Location *string `json:"location,omitempty"` + + // 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,50 +143,21 @@ 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"` } -// AvailableGroundStationsClientGetOptions contains the optional parameters for the AvailableGroundStationsClient.Get method. -type AvailableGroundStationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AvailableGroundStationsClientListByCapabilityOptions contains the optional parameters for the AvailableGroundStationsClient.ListByCapability +// AvailableGroundStationsClientListByCapabilityOptions contains the optional parameters for the AvailableGroundStationsClient.NewListByCapabilityPager // method. type AvailableGroundStationsClientListByCapabilityOptions struct { // placeholder for future optional parameters } -// CloudError - An error response from the service. -type CloudError struct { - // An error response from the service. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody - An error response from the service. -type CloudErrorBody struct { - // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - - // A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty"` - - // A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - - // The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty"` -} - // Contact - Customer creates a contact resource for a spacecraft resource. type Contact struct { - // Properties of the Contact Resource. + // REQUIRED; Properties of the Contact Resource. Properties *ContactsProperties `json:"properties,omitempty"` - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` @@ -199,7 +171,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 +182,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 +194,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,19 +215,19 @@ 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"` } // ContactParametersContactProfile - The reference to the contact profile resource. type ContactParametersContactProfile struct { - // Resource ID. + // REQUIRED; Resource ID. ID *string `json:"id,omitempty"` } @@ -265,15 +237,12 @@ type ContactProfile struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Properties of the contact profile resource. + // REQUIRED; Properties of the contact profile resource. Properties *ContactProfileProperties `json:"properties,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` @@ -287,51 +256,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. + // REQUIRED; Customer end point to store and retrieve data during a contact with the spacecraft. 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,26 +319,42 @@ 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"` + + // Third-party mission configuration of the Contact Profile. Describes RF links, modem processing, and IP endpoints. + ThirdPartyConfigurations []*ContactProfileThirdPartyConfiguration `json:"thirdPartyConfigurations,omitempty"` +} + +// ContactProfileThirdPartyConfiguration - Contact Profile third-party partner configuration. +type ContactProfileThirdPartyConfiguration struct { + // REQUIRED; Name of string referencing the configuration describing contact set-up for a particular mission. Expected values + // are those which have been created in collaboration with the partner network. + MissionConfiguration *string `json:"missionConfiguration,omitempty"` + + // REQUIRED; Name of the third-party provider. + ProviderName *string `json:"providerName,omitempty"` } // ContactProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the ContactProfilesClient.BeginCreateOrUpdate @@ -393,7 +382,7 @@ type ContactProfilesClientGetOptions struct { // placeholder for future optional parameters } -// ContactProfilesClientListBySubscriptionOptions contains the optional parameters for the ContactProfilesClient.ListBySubscription +// ContactProfilesClientListBySubscriptionOptions contains the optional parameters for the ContactProfilesClient.NewListBySubscriptionPager // method. type ContactProfilesClientListBySubscriptionOptions struct { // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous @@ -403,7 +392,7 @@ type ContactProfilesClientListBySubscriptionOptions struct { Skiptoken *string } -// ContactProfilesClientListOptions contains the optional parameters for the ContactProfilesClient.List method. +// ContactProfilesClientListOptions contains the optional parameters for the ContactProfilesClient.NewListPager method. type ContactProfilesClientListOptions struct { // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous // list operation call returned a partial result. If a previous response contains a @@ -414,31 +403,38 @@ 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"` + + // Third-party mission configuration of the Contact Profile. Describes RF links, modem processing, and IP endpoints. + ThirdPartyConfigurations []*ContactProfileThirdPartyConfiguration `json:"thirdPartyConfigurations,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"` } @@ -459,7 +455,7 @@ type ContactsClientGetOptions struct { // placeholder for future optional parameters } -// ContactsClientListOptions contains the optional parameters for the ContactsClient.List method. +// ContactsClientListOptions contains the optional parameters for the ContactsClient.NewListPager method. type ContactsClientListOptions struct { // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous // list operation call returned a partial result. If a previous response contains a @@ -476,13 +472,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 +496,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 +511,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"` } @@ -533,16 +529,16 @@ type ContactsPropertiesAntennaConfiguration struct { // ContactsPropertiesContactProfile - The reference to the contact profile resource. type ContactsPropertiesContactProfile struct { - // Resource ID. + // REQUIRED; Resource ID. ID *string `json:"id,omitempty"` } -// EndPoint - Customer End point to store/retrieve data during a contact. +// EndPoint - Customer end point to store and retrieve data during a contact with the spacecraft. type EndPoint struct { // REQUIRED; Name of an end point. EndPointName *string `json:"endPointName,omitempty"` - // REQUIRED; IP Address. + // REQUIRED; IP Address (IPv4). IPAddress *string `json:"ipAddress,omitempty"` // REQUIRED; TCP port to listen on to receive data. @@ -552,6 +548,40 @@ type EndPoint struct { Protocol *Protocol `json:"protocol,omitempty"` } +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any `json:"info,omitempty" azure:"ro"` + + // READ-ONLY; The additional info type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error details. + Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; The error target. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -603,13 +633,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 - Properties interface{} `json:"properties,omitempty"` + // Operation result properties. + Properties any `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. @@ -618,17 +648,23 @@ type OperationResult struct { // READ-ONLY; Name of the resource. Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + // 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"` + + // READ-ONLY; A list of results when the operation returns multiple results. + Value []any `json:"value,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"` @@ -637,7 +673,7 @@ type OperationResultErrorProperties struct { Message *string `json:"message,omitempty" azure:"ro"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -690,13 +726,13 @@ 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. + // REQUIRED; Resource ID. ID *string `json:"id,omitempty"` } @@ -705,15 +741,12 @@ type Spacecraft struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Spacecraft Properties + // REQUIRED; Spacecraft Properties Properties *SpacecraftsProperties `json:"properties,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` @@ -727,21 +760,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 @@ -788,7 +821,7 @@ type SpacecraftsClientGetOptions struct { // placeholder for future optional parameters } -// SpacecraftsClientListBySubscriptionOptions contains the optional parameters for the SpacecraftsClient.ListBySubscription +// SpacecraftsClientListBySubscriptionOptions contains the optional parameters for the SpacecraftsClient.NewListBySubscriptionPager // method. type SpacecraftsClientListBySubscriptionOptions struct { // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous @@ -798,7 +831,7 @@ type SpacecraftsClientListBySubscriptionOptions struct { Skiptoken *string } -// SpacecraftsClientListOptions contains the optional parameters for the SpacecraftsClient.List method. +// SpacecraftsClientListOptions contains the optional parameters for the SpacecraftsClient.NewListPager method. type SpacecraftsClientListOptions struct { // An opaque string that the resource provider uses to skip over previously-returned results. This is used when a previous // list operation call returned a partial result. If a previous response contains a @@ -809,23 +842,23 @@ type SpacecraftsClientListOptions struct { // SpacecraftsProperties - List of Spacecraft Resource Properties. type SpacecraftsProperties struct { - // REQUIRED; NORAD ID of the spacecraft. - NoradID *string `json:"noradId,omitempty"` - - // Links of the Spacecraft + // REQUIRED; Immutable list of Spacecraft links. Links []*SpacecraftLink `json:"links,omitempty"` - // The current state of the resource's creation, deletion, or modification - ProvisioningState *SpacecraftsPropertiesProvisioningState `json:"provisioningState,omitempty"` - - // Title line of Two Line Element (TLE). + // REQUIRED; Title line of the two-line element set (TLE). TitleLine *string `json:"titleLine,omitempty"` - // Line 1 of Two Line Element (TLE). + // REQUIRED; Line 1 of the two-line element set (TLE). TleLine1 *string `json:"tleLine1,omitempty"` - // Line 2 of Two Line Element (TLE). + // REQUIRED; Line 2 of the two-line element set (TLE). TleLine2 *string `json:"tleLine2,omitempty"` + + // NORAD ID of the spacecraft. + NoradID *string `json:"noradId,omitempty"` + + // The current state of the resource's creation, deletion, or modification. + ProvisioningState *SpacecraftsPropertiesProvisioningState `json:"provisioningState,omitempty"` } // SystemData - Metadata pertaining to creation and last modification of the resource. diff --git a/sdk/resourcemanager/orbital/armorbital/models_serde.go b/sdk/resourcemanager/orbital/armorbital/models_serde.go new file mode 100644 index 000000000000..b509abb3e161 --- /dev/null +++ b/sdk/resourcemanager/orbital/armorbital/models_serde.go @@ -0,0 +1,1895 @@ +//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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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 Contact. +func (c Contact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 "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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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 "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]any) + 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]any) + 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]any) + 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]any) + 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) + populate(objectMap, "thirdPartyConfigurations", c.ThirdPartyConfigurations) + 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) + case "thirdPartyConfigurations": + err = unpopulate(val, "ThirdPartyConfigurations", &c.ThirdPartyConfigurations) + 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 ContactProfileThirdPartyConfiguration. +func (c ContactProfileThirdPartyConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "missionConfiguration", c.MissionConfiguration) + populate(objectMap, "providerName", c.ProviderName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProfileThirdPartyConfiguration. +func (c *ContactProfileThirdPartyConfiguration) 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 "missionConfiguration": + err = unpopulate(val, "MissionConfiguration", &c.MissionConfiguration) + delete(rawMsg, key) + case "providerName": + err = unpopulate(val, "ProviderName", &c.ProviderName) + 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]any) + 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) + populate(objectMap, "thirdPartyConfigurations", c.ThirdPartyConfigurations) + 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) + case "thirdPartyConfigurations": + err = unpopulate(val, "ThirdPartyConfigurations", &c.ThirdPartyConfigurations) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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 "error": + err = unpopulate(val, "Error", &e.Error) + 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]any) + 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]any) + 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]any) + 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]any) + populateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "percentComplete", o.PercentComplete) + populate(objectMap, "properties", &o.Properties) + populateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + populate(objectMap, "value", o.Value) + 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 "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + 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) + 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 OperationResultErrorProperties. +func (o OperationResultErrorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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 "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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any) + 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]any, k string, v any) { + 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 any) 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 89% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_operations_client.go rename to sdk/resourcemanager/orbital/armorbital/operations_client.go index 9e13a168d7ad..969a0a6f6168 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 @@ -27,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,9 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available Orbital Rest API operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-11-01 +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -82,7 +83,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go b/sdk/resourcemanager/orbital/armorbital/operationsresults_client.go similarity index 84% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_operationsresults_client.go rename to sdk/resourcemanager/orbital/armorbital/operationsresults_client.go index 316415778047..42a9f8002948 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 @@ -31,9 +32,9 @@ type OperationsResultsClient struct { } // NewOperationsResultsClient creates a new instance of OperationsResultsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,18 +57,21 @@ func NewOperationsResultsClient(subscriptionID string, credential azcore.TokenCr // BeginGet - Returns operation results. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 -// location - The name of Azure region. -// operationID - The ID of an ongoing async operation. -// options - OperationsResultsClientBeginGetOptions contains the optional parameters for the OperationsResultsClient.BeginGet -// method. +// +// Generated from API version 2022-11-01 +// - location - The name of Azure region. +// - operationID - The ID of an ongoing async operation. +// - options - OperationsResultsClientBeginGetOptions contains the optional parameters for the OperationsResultsClient.BeginGet +// method. func (client *OperationsResultsClient) BeginGet(ctx context.Context, location string, operationID string, options *OperationsResultsClientBeginGetOptions) (*runtime.Poller[OperationsResultsClientGetResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.get(ctx, location, operationID, options) if err != nil { return nil, err } - return runtime.NewPoller[OperationsResultsClientGetResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[OperationsResultsClientGetResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) } else { return runtime.NewPollerFromResumeToken[OperationsResultsClientGetResponse](options.ResumeToken, client.pl, nil) } @@ -75,7 +79,8 @@ func (client *OperationsResultsClient) BeginGet(ctx context.Context, location st // Get - Returns operation results. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *OperationsResultsClient) get(ctx context.Context, location string, operationID string, options *OperationsResultsClientBeginGetOptions) (*http.Response, error) { req, err := client.getCreateRequest(ctx, location, operationID, options) if err != nil { @@ -111,7 +116,7 @@ func (client *OperationsResultsClient) getCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go b/sdk/resourcemanager/orbital/armorbital/response_types.go similarity index 78% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go rename to sdk/resourcemanager/orbital/armorbital/response_types.go index bc0f29cdbb34..ced90c8ae98a 100644 --- a/sdk/resourcemanager/orbital/armorbital/zz_generated_response_types.go +++ b/sdk/resourcemanager/orbital/armorbital/response_types.go @@ -5,25 +5,21 @@ // 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 -// AvailableGroundStationsClientGetResponse contains the response from method AvailableGroundStationsClient.Get. -type AvailableGroundStationsClientGetResponse struct { - AvailableGroundStation -} - -// AvailableGroundStationsClientListByCapabilityResponse contains the response from method AvailableGroundStationsClient.ListByCapability. +// AvailableGroundStationsClientListByCapabilityResponse contains the response from method AvailableGroundStationsClient.NewListByCapabilityPager. type AvailableGroundStationsClientListByCapabilityResponse struct { AvailableGroundStationListResult } -// ContactProfilesClientCreateOrUpdateResponse contains the response from method ContactProfilesClient.CreateOrUpdate. +// ContactProfilesClientCreateOrUpdateResponse contains the response from method ContactProfilesClient.BeginCreateOrUpdate. type ContactProfilesClientCreateOrUpdateResponse struct { ContactProfile } -// ContactProfilesClientDeleteResponse contains the response from method ContactProfilesClient.Delete. +// ContactProfilesClientDeleteResponse contains the response from method ContactProfilesClient.BeginDelete. type ContactProfilesClientDeleteResponse struct { // placeholder for future response values } @@ -33,27 +29,27 @@ type ContactProfilesClientGetResponse struct { ContactProfile } -// ContactProfilesClientListBySubscriptionResponse contains the response from method ContactProfilesClient.ListBySubscription. +// ContactProfilesClientListBySubscriptionResponse contains the response from method ContactProfilesClient.NewListBySubscriptionPager. type ContactProfilesClientListBySubscriptionResponse struct { ContactProfileListResult } -// ContactProfilesClientListResponse contains the response from method ContactProfilesClient.List. +// ContactProfilesClientListResponse contains the response from method ContactProfilesClient.NewListPager. type ContactProfilesClientListResponse struct { ContactProfileListResult } -// ContactProfilesClientUpdateTagsResponse contains the response from method ContactProfilesClient.UpdateTags. +// ContactProfilesClientUpdateTagsResponse contains the response from method ContactProfilesClient.BeginUpdateTags. type ContactProfilesClientUpdateTagsResponse struct { ContactProfile } -// ContactsClientCreateResponse contains the response from method ContactsClient.Create. +// ContactsClientCreateResponse contains the response from method ContactsClient.BeginCreate. type ContactsClientCreateResponse struct { Contact } -// ContactsClientDeleteResponse contains the response from method ContactsClient.Delete. +// ContactsClientDeleteResponse contains the response from method ContactsClient.BeginDelete. type ContactsClientDeleteResponse struct { // placeholder for future response values } @@ -63,27 +59,27 @@ type ContactsClientGetResponse struct { Contact } -// ContactsClientListResponse contains the response from method ContactsClient.List. +// ContactsClientListResponse contains the response from method ContactsClient.NewListPager. type ContactsClientListResponse struct { ContactListResult } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } -// OperationsResultsClientGetResponse contains the response from method OperationsResultsClient.Get. +// OperationsResultsClientGetResponse contains the response from method OperationsResultsClient.BeginGet. type OperationsResultsClientGetResponse struct { OperationResult } -// SpacecraftsClientCreateOrUpdateResponse contains the response from method SpacecraftsClient.CreateOrUpdate. +// SpacecraftsClientCreateOrUpdateResponse contains the response from method SpacecraftsClient.BeginCreateOrUpdate. type SpacecraftsClientCreateOrUpdateResponse struct { Spacecraft } -// SpacecraftsClientDeleteResponse contains the response from method SpacecraftsClient.Delete. +// SpacecraftsClientDeleteResponse contains the response from method SpacecraftsClient.BeginDelete. type SpacecraftsClientDeleteResponse struct { // placeholder for future response values } @@ -93,22 +89,22 @@ type SpacecraftsClientGetResponse struct { Spacecraft } -// SpacecraftsClientListAvailableContactsResponse contains the response from method SpacecraftsClient.ListAvailableContacts. +// SpacecraftsClientListAvailableContactsResponse contains the response from method SpacecraftsClient.BeginListAvailableContacts. type SpacecraftsClientListAvailableContactsResponse struct { AvailableContactsListResult } -// SpacecraftsClientListBySubscriptionResponse contains the response from method SpacecraftsClient.ListBySubscription. +// SpacecraftsClientListBySubscriptionResponse contains the response from method SpacecraftsClient.NewListBySubscriptionPager. type SpacecraftsClientListBySubscriptionResponse struct { SpacecraftListResult } -// SpacecraftsClientListResponse contains the response from method SpacecraftsClient.List. +// SpacecraftsClientListResponse contains the response from method SpacecraftsClient.NewListPager. type SpacecraftsClientListResponse struct { SpacecraftListResult } -// SpacecraftsClientUpdateTagsResponse contains the response from method SpacecraftsClient.UpdateTags. +// SpacecraftsClientUpdateTagsResponse contains the response from method SpacecraftsClient.BeginUpdateTags. type SpacecraftsClientUpdateTagsResponse struct { Spacecraft } diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go b/sdk/resourcemanager/orbital/armorbital/spacecrafts_client.go similarity index 86% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_spacecrafts_client.go rename to sdk/resourcemanager/orbital/armorbital/spacecrafts_client.go index bf77e7b248c6..a6d725c2f4a5 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 @@ -31,9 +32,9 @@ type SpacecraftsClient struct { } // NewSpacecraftsClient creates a new instance of SpacecraftsClient with the specified values. -// subscriptionID - The ID of the target subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSpacecraftsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SpacecraftsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,14 +55,15 @@ 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 -// parameters - The parameters to provide for the created spacecraft. -// options - SpacecraftsClientBeginCreateOrUpdateOptions contains the optional parameters for the SpacecraftsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - spacecraftName - Spacecraft ID. +// - parameters - The parameters to provide for the created spacecraft. +// - options - SpacecraftsClientBeginCreateOrUpdateOptions contains the optional parameters for the SpacecraftsClient.BeginCreateOrUpdate +// method. func (client *SpacecraftsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, spacecraftName string, parameters Spacecraft, options *SpacecraftsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SpacecraftsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, spacecraftName, parameters, options) @@ -76,9 +78,10 @@ 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 +// +// Generated from API version 2022-11-01 func (client *SpacecraftsClient) createOrUpdate(ctx context.Context, resourceGroupName string, spacecraftName string, parameters Spacecraft, options *SpacecraftsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, spacecraftName, parameters, options) if err != nil { @@ -114,7 +117,7 @@ func (client *SpacecraftsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,10 +125,11 @@ func (client *SpacecraftsClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a specified 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 -// options - SpacecraftsClientBeginDeleteOptions contains the optional parameters for the SpacecraftsClient.BeginDelete method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - 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 == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, spacecraftName, options) @@ -142,7 +146,8 @@ func (client *SpacecraftsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a specified spacecraft resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *SpacecraftsClient) deleteOperation(ctx context.Context, resourceGroupName string, spacecraftName string, options *SpacecraftsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, spacecraftName, options) if err != nil { @@ -178,18 +183,19 @@ func (client *SpacecraftsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} 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 -// options - SpacecraftsClientGetOptions contains the optional parameters for the SpacecraftsClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - 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) if err != nil { @@ -225,7 +231,7 @@ func (client *SpacecraftsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,11 +246,11 @@ func (client *SpacecraftsClient) getHandleResponse(resp *http.Response) (Spacecr return result, nil } -// NewListPager - Return list of spacecrafts -// 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. -// options - SpacecraftsClientListOptions contains the optional parameters for the SpacecraftsClient.List method. +// NewListPager - Returns list of spacecrafts by resource group. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - SpacecraftsClientListOptions contains the optional parameters for the SpacecraftsClient.NewListPager method. func (client *SpacecraftsClient) NewListPager(resourceGroupName string, options *SpacecraftsClientListOptions) *runtime.Pager[SpacecraftsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SpacecraftsClientListResponse]{ More: func(page SpacecraftsClientListResponse) bool { @@ -289,7 +295,7 @@ func (client *SpacecraftsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } @@ -307,14 +313,15 @@ func (client *SpacecraftsClient) listHandleResponse(resp *http.Response) (Spacec return result, nil } -// BeginListAvailableContacts - Return list of available contacts -// 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 -// parameters - The parameters to provide for the contacts. -// options - SpacecraftsClientBeginListAvailableContactsOptions contains the optional parameters for the SpacecraftsClient.BeginListAvailableContacts -// method. +// 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. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - spacecraftName - Spacecraft ID. +// - parameters - The parameters to provide for the contacts. +// - options - SpacecraftsClientBeginListAvailableContactsOptions contains the optional parameters for the SpacecraftsClient.BeginListAvailableContacts +// method. func (client *SpacecraftsClient) BeginListAvailableContacts(ctx context.Context, resourceGroupName string, spacecraftName string, parameters ContactParameters, options *SpacecraftsClientBeginListAvailableContactsOptions) (*runtime.Poller[*runtime.Pager[SpacecraftsClientListAvailableContactsResponse]], error) { pager := runtime.NewPager(runtime.PagingHandler[SpacecraftsClientListAvailableContactsResponse]{ More: func(page SpacecraftsClientListAvailableContactsResponse) bool { @@ -351,9 +358,10 @@ func (client *SpacecraftsClient) BeginListAvailableContacts(ctx context.Context, } } -// ListAvailableContacts - Return list of available contacts -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// 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. +// +// Generated from API version 2022-11-01 func (client *SpacecraftsClient) listAvailableContacts(ctx context.Context, resourceGroupName string, spacecraftName string, parameters ContactParameters, options *SpacecraftsClientBeginListAvailableContactsOptions) (*http.Response, error) { req, err := client.listAvailableContactsCreateRequest(ctx, resourceGroupName, spacecraftName, parameters, options) if err != nil { @@ -389,7 +397,7 @@ func (client *SpacecraftsClient) listAvailableContactsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -404,11 +412,11 @@ func (client *SpacecraftsClient) listAvailableContactsHandleResponse(resp *http. return result, nil } -// NewListBySubscriptionPager - Return list of spacecrafts -// 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 -// method. +// NewListBySubscriptionPager - Returns list of spacecrafts by subscription. +// +// Generated from API version 2022-11-01 +// - options - SpacecraftsClientListBySubscriptionOptions contains the optional parameters for the SpacecraftsClient.NewListBySubscriptionPager +// method. func (client *SpacecraftsClient) NewListBySubscriptionPager(options *SpacecraftsClientListBySubscriptionOptions) *runtime.Pager[SpacecraftsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[SpacecraftsClientListBySubscriptionResponse]{ More: func(page SpacecraftsClientListBySubscriptionResponse) bool { @@ -449,7 +457,7 @@ func (client *SpacecraftsClient) listBySubscriptionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } @@ -469,12 +477,13 @@ func (client *SpacecraftsClient) listBySubscriptionHandleResponse(resp *http.Res // BeginUpdateTags - Updates the specified spacecraft tags. // 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 -// parameters - Parameters supplied to update spacecraft tags. -// options - SpacecraftsClientBeginUpdateTagsOptions contains the optional parameters for the SpacecraftsClient.BeginUpdateTags -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - spacecraftName - Spacecraft ID. +// - parameters - Parameters supplied to update spacecraft tags. +// - options - SpacecraftsClientBeginUpdateTagsOptions contains the optional parameters for the SpacecraftsClient.BeginUpdateTags +// method. func (client *SpacecraftsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, spacecraftName string, parameters TagsObject, options *SpacecraftsClientBeginUpdateTagsOptions) (*runtime.Poller[SpacecraftsClientUpdateTagsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateTags(ctx, resourceGroupName, spacecraftName, parameters, options) @@ -491,7 +500,8 @@ func (client *SpacecraftsClient) BeginUpdateTags(ctx context.Context, resourceGr // UpdateTags - Updates the specified spacecraft tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-01 +// +// Generated from API version 2022-11-01 func (client *SpacecraftsClient) updateTags(ctx context.Context, resourceGroupName string, spacecraftName string, parameters TagsObject, options *SpacecraftsClientBeginUpdateTagsOptions) (*http.Response, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, spacecraftName, parameters, options) if err != nil { @@ -527,7 +537,7 @@ func (client *SpacecraftsClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/orbital/armorbital/zz_generated_time_rfc3339.go b/sdk/resourcemanager/orbital/armorbital/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/orbital/armorbital/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/orbital/armorbital/time_rfc3339.go index 3b19e783796c..59ceae835720 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 @@ -61,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { 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 -}