From 54e3aa386eef0e6f40eaea43e589ba802dac4b10 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 23 Sep 2024 17:45:19 +0000 Subject: [PATCH] CodeGen from PR 30626 in Azure/azure-rest-api-specs Merge d448de87fa813986b99615c4c193a52d7c53b056 into b0e24ca8d7f0ed95ae33d72abe8ae59bc0750438 --- .../astro/armastro/CHANGELOG.md | 10 + .../astro/armastro/autorest.md | 7 +- .../astro/armastro/constants.go | 20 +- sdk/resourcemanager/astro/armastro/go.mod | 12 +- sdk/resourcemanager/astro/armastro/go.sum | 17 - sdk/resourcemanager/astro/armastro/models.go | 49 +- .../astro/armastro/models_serde.go | 98 ++++ .../astro/armastro/operations_client.go | 4 +- .../operations_client_example_test.go | 58 -- .../astro/armastro/organizations_client.go | 30 +- .../organizations_client_example_test.go | 533 ------------------ 11 files changed, 195 insertions(+), 643 deletions(-) delete mode 100644 sdk/resourcemanager/astro/armastro/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/astro/armastro/organizations_client_example_test.go diff --git a/sdk/resourcemanager/astro/armastro/CHANGELOG.md b/sdk/resourcemanager/astro/armastro/CHANGELOG.md index 1191639b0689..b74deac92d68 100644 --- a/sdk/resourcemanager/astro/armastro/CHANGELOG.md +++ b/sdk/resourcemanager/astro/armastro/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0 (2024-09-23) +### Features Added + +- New enum type `RenewalMode` with values `RenewalModeAuto`, `RenewalModeManual` +- New struct `LiftrBaseMarketplaceDetailsUpdate` +- New struct `LiftrBaseOfferDetailsUpdate` +- New field `EndDate`, `RenewalMode` in struct `LiftrBaseOfferDetails` +- New field `Marketplace` in struct `OrganizationResourceUpdateProperties` + + ## 0.1.0 (2024-02-23) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/astro/armastro` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). diff --git a/sdk/resourcemanager/astro/armastro/autorest.md b/sdk/resourcemanager/astro/armastro/autorest.md index 55c64253bafb..2c928a3ff765 100644 --- a/sdk/resourcemanager/astro/armastro/autorest.md +++ b/sdk/resourcemanager/astro/armastro/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/liftrastronomer/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/liftrastronomer/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 -tag: package-2023-08-01 +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/astro/armastro/constants.go b/sdk/resourcemanager/astro/armastro/constants.go index f2c943d2a871..e619ee2ee57e 100644 --- a/sdk/resourcemanager/astro/armastro/constants.go +++ b/sdk/resourcemanager/astro/armastro/constants.go @@ -10,7 +10,7 @@ package armastro const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/astro/armastro" - moduleVersion = "v0.1.0" + moduleVersion = "v1.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -111,6 +111,24 @@ func PossibleOriginValues() []Origin { } } +// RenewalMode - Subscription renewal mode +type RenewalMode string + +const ( + // RenewalModeAuto - Automatic renewal + RenewalModeAuto RenewalMode = "Auto" + // RenewalModeManual - Manual renewal + RenewalModeManual RenewalMode = "Manual" +) + +// PossibleRenewalModeValues returns the possible values for the RenewalMode const type. +func PossibleRenewalModeValues() []RenewalMode { + return []RenewalMode{ + RenewalModeAuto, + RenewalModeManual, + } +} + // ResourceProvisioningState - The provisioning state of a resource type. type ResourceProvisioningState string diff --git a/sdk/resourcemanager/astro/armastro/go.mod b/sdk/resourcemanager/astro/armastro/go.mod index e2c1aa2450fc..6073a0f29852 100644 --- a/sdk/resourcemanager/astro/armastro/go.mod +++ b/sdk/resourcemanager/astro/armastro/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/astro/armastro go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/astro/armastro/go.sum b/sdk/resourcemanager/astro/armastro/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/astro/armastro/go.sum +++ b/sdk/resourcemanager/astro/armastro/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/astro/armastro/models.go b/sdk/resourcemanager/astro/armastro/models.go index 518f9e88cdf2..705881764351 100644 --- a/sdk/resourcemanager/astro/armastro/models.go +++ b/sdk/resourcemanager/astro/armastro/models.go @@ -66,7 +66,19 @@ type LiftrBaseMarketplaceDetails struct { // REQUIRED; Offer details for the marketplace that is selected by the user OfferDetails *LiftrBaseOfferDetails - // REQUIRED; Azure subscription id for the the marketplace offer is purchased from + // Azure subscription id for the the marketplace offer is purchased from + SubscriptionID *string + + // Marketplace subscription status + SubscriptionStatus *MarketplaceSubscriptionStatus +} + +// LiftrBaseMarketplaceDetailsUpdate - Marketplace details for an organization +type LiftrBaseMarketplaceDetailsUpdate struct { + // Offer details for the marketplace that is selected by the user + OfferDetails *LiftrBaseOfferDetailsUpdate + + // Azure subscription id for the the marketplace offer is purchased from SubscriptionID *string // Marketplace subscription status @@ -87,6 +99,36 @@ type LiftrBaseOfferDetails struct { // Plan Name for the marketplace offer PlanName *string + // Subscription renewal mode + RenewalMode *RenewalMode + + // Plan Display Name for the marketplace offer + TermID *string + + // Plan Display Name for the marketplace offer + TermUnit *string + + // READ-ONLY; Current subscription end date and time + EndDate *time.Time +} + +// LiftrBaseOfferDetailsUpdate - Offer details for the marketplace that is selected by the user +type LiftrBaseOfferDetailsUpdate struct { + // Offer Id for the marketplace offer + OfferID *string + + // Plan Id for the marketplace offer + PlanID *string + + // Plan Name for the marketplace offer + PlanName *string + + // Publisher Id for the marketplace offer + PublisherID *string + + // Subscription renewal mode + RenewalMode *RenewalMode + // Plan Display Name for the marketplace offer TermID *string @@ -258,7 +300,7 @@ type OrganizationResourceUpdate struct { // The managed service identities assigned to this resource. Identity *ManagedServiceIdentity - // The updatable properties of the OrganizationResource. + // The resource-specific properties for this resource. Properties *OrganizationResourceUpdateProperties // Resource tags. @@ -267,6 +309,9 @@ type OrganizationResourceUpdate struct { // OrganizationResourceUpdateProperties - The updatable properties of the OrganizationResource. type OrganizationResourceUpdateProperties struct { + // Marketplace details of the resource. + Marketplace *LiftrBaseMarketplaceDetailsUpdate + // Organization properties PartnerOrganizationProperties *LiftrBaseDataPartnerOrganizationPropertiesUpdate diff --git a/sdk/resourcemanager/astro/armastro/models_serde.go b/sdk/resourcemanager/astro/armastro/models_serde.go index 82bfe9d9b2ee..c3d3e814fe2b 100644 --- a/sdk/resourcemanager/astro/armastro/models_serde.go +++ b/sdk/resourcemanager/astro/armastro/models_serde.go @@ -175,13 +175,50 @@ func (l *LiftrBaseMarketplaceDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LiftrBaseMarketplaceDetailsUpdate. +func (l LiftrBaseMarketplaceDetailsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "offerDetails", l.OfferDetails) + populate(objectMap, "subscriptionId", l.SubscriptionID) + populate(objectMap, "subscriptionStatus", l.SubscriptionStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiftrBaseMarketplaceDetailsUpdate. +func (l *LiftrBaseMarketplaceDetailsUpdate) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "offerDetails": + err = unpopulate(val, "OfferDetails", &l.OfferDetails) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &l.SubscriptionID) + delete(rawMsg, key) + case "subscriptionStatus": + err = unpopulate(val, "SubscriptionStatus", &l.SubscriptionStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type LiftrBaseOfferDetails. func (l LiftrBaseOfferDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "endDate", l.EndDate) populate(objectMap, "offerId", l.OfferID) populate(objectMap, "planId", l.PlanID) populate(objectMap, "planName", l.PlanName) populate(objectMap, "publisherId", l.PublisherID) + populate(objectMap, "renewalMode", l.RenewalMode) populate(objectMap, "termId", l.TermID) populate(objectMap, "termUnit", l.TermUnit) return json.Marshal(objectMap) @@ -196,6 +233,9 @@ func (l *LiftrBaseOfferDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "endDate": + err = unpopulateDateTimeRFC3339(val, "EndDate", &l.EndDate) + delete(rawMsg, key) case "offerId": err = unpopulate(val, "OfferID", &l.OfferID) delete(rawMsg, key) @@ -208,6 +248,60 @@ func (l *LiftrBaseOfferDetails) UnmarshalJSON(data []byte) error { case "publisherId": err = unpopulate(val, "PublisherID", &l.PublisherID) delete(rawMsg, key) + case "renewalMode": + err = unpopulate(val, "RenewalMode", &l.RenewalMode) + delete(rawMsg, key) + case "termId": + err = unpopulate(val, "TermID", &l.TermID) + delete(rawMsg, key) + case "termUnit": + err = unpopulate(val, "TermUnit", &l.TermUnit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiftrBaseOfferDetailsUpdate. +func (l LiftrBaseOfferDetailsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "offerId", l.OfferID) + populate(objectMap, "planId", l.PlanID) + populate(objectMap, "planName", l.PlanName) + populate(objectMap, "publisherId", l.PublisherID) + populate(objectMap, "renewalMode", l.RenewalMode) + populate(objectMap, "termId", l.TermID) + populate(objectMap, "termUnit", l.TermUnit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiftrBaseOfferDetailsUpdate. +func (l *LiftrBaseOfferDetailsUpdate) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "offerId": + err = unpopulate(val, "OfferID", &l.OfferID) + delete(rawMsg, key) + case "planId": + err = unpopulate(val, "PlanID", &l.PlanID) + delete(rawMsg, key) + case "planName": + err = unpopulate(val, "PlanName", &l.PlanName) + delete(rawMsg, key) + case "publisherId": + err = unpopulate(val, "PublisherID", &l.PublisherID) + delete(rawMsg, key) + case "renewalMode": + err = unpopulate(val, "RenewalMode", &l.RenewalMode) + delete(rawMsg, key) case "termId": err = unpopulate(val, "TermID", &l.TermID) delete(rawMsg, key) @@ -627,6 +721,7 @@ func (o *OrganizationResourceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OrganizationResourceUpdateProperties. func (o OrganizationResourceUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "marketplace", o.Marketplace) populate(objectMap, "partnerOrganizationProperties", o.PartnerOrganizationProperties) populate(objectMap, "user", o.User) return json.Marshal(objectMap) @@ -641,6 +736,9 @@ func (o *OrganizationResourceUpdateProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { + case "marketplace": + err = unpopulate(val, "Marketplace", &o.Marketplace) + delete(rawMsg, key) case "partnerOrganizationProperties": err = unpopulate(val, "PartnerOrganizationProperties", &o.PartnerOrganizationProperties) delete(rawMsg, key) diff --git a/sdk/resourcemanager/astro/armastro/operations_client.go b/sdk/resourcemanager/astro/armastro/operations_client.go index 35affd6bfcc5..22c1ce808548 100644 --- a/sdk/resourcemanager/astro/armastro/operations_client.go +++ b/sdk/resourcemanager/astro/armastro/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 // - 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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2024-08-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/astro/armastro/operations_client_example_test.go b/sdk/resourcemanager/astro/armastro/operations_client_example_test.go deleted file mode 100644 index a3d31f4493af..000000000000 --- a/sdk/resourcemanager/astro/armastro/operations_client_example_test.go +++ /dev/null @@ -1,58 +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. -// DO NOT EDIT. - -package armastro_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/astro/armastro" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armastro.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armastro.OperationListResult{ - // Value: []*armastro.Operation{ - // { - // Name: to.Ptr("zabhglnki"), - // ActionType: to.Ptr(armastro.ActionTypeInternal), - // Display: &armastro.OperationDisplay{ - // Description: to.Ptr("nkucjlsbtriwdgedbxlknbwfz"), - // Operation: to.Ptr("teozafbxkiagahfypii"), - // Provider: to.Ptr("hgepwsvbptqbigephgxoxyll"), - // Resource: to.Ptr("thhzqbtxxi"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armastro.OriginUser), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/astro/armastro/organizations_client.go b/sdk/resourcemanager/astro/armastro/organizations_client.go index 1577fb06e0c6..31d008205114 100644 --- a/sdk/resourcemanager/astro/armastro/organizations_client.go +++ b/sdk/resourcemanager/astro/armastro/organizations_client.go @@ -46,7 +46,7 @@ func NewOrganizationsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Create a OrganizationResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - organizationName - Name of the Organizations resource // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *OrganizationsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create a OrganizationResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 func (client *OrganizationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, organizationName string, resource OrganizationResource, options *OrganizationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "OrganizationsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *OrganizationsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2024-08-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *OrganizationsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Delete a OrganizationResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - organizationName - Name of the Organizations resource // - options - OrganizationsClientBeginDeleteOptions contains the optional parameters for the OrganizationsClient.BeginDelete @@ -153,7 +153,7 @@ func (client *OrganizationsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete a OrganizationResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 func (client *OrganizationsClient) deleteOperation(ctx context.Context, resourceGroupName string, organizationName string, options *OrganizationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "OrganizationsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *OrganizationsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2024-08-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,7 @@ func (client *OrganizationsClient) deleteCreateRequest(ctx context.Context, reso // Get - Get a OrganizationResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - organizationName - Name of the Organizations resource // - options - OrganizationsClientGetOptions contains the optional parameters for the OrganizationsClient.Get method. @@ -250,7 +250,7 @@ func (client *OrganizationsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2024-08-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *OrganizationsClient) getHandleResponse(resp *http.Response) (Organ // NewListByResourceGroupPager - List OrganizationResource resources by resource group // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - OrganizationsClientListByResourceGroupOptions contains the optional parameters for the OrganizationsClient.NewListByResourceGroupPager // method. @@ -310,7 +310,7 @@ func (client *OrganizationsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2024-08-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +327,7 @@ func (client *OrganizationsClient) listByResourceGroupHandleResponse(resp *http. // NewListBySubscriptionPager - List OrganizationResource resources by subscription ID // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 // - options - OrganizationsClientListBySubscriptionOptions contains the optional parameters for the OrganizationsClient.NewListBySubscriptionPager // method. func (client *OrganizationsClient) NewListBySubscriptionPager(options *OrganizationsClientListBySubscriptionOptions) *runtime.Pager[OrganizationsClientListBySubscriptionResponse] { @@ -365,7 +365,7 @@ func (client *OrganizationsClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2024-08-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,7 +383,7 @@ func (client *OrganizationsClient) listBySubscriptionHandleResponse(resp *http.R // BeginUpdate - Update a OrganizationResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - organizationName - Name of the Organizations resource // - properties - The resource properties to be updated. @@ -410,7 +410,7 @@ func (client *OrganizationsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Update a OrganizationResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-08-01 +// Generated from API version 2024-08-27 func (client *OrganizationsClient) update(ctx context.Context, resourceGroupName string, organizationName string, properties OrganizationResourceUpdate, options *OrganizationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "OrganizationsClient.BeginUpdate" @@ -452,7 +452,7 @@ func (client *OrganizationsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-08-01") + reqQP.Set("api-version", "2024-08-27") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/astro/armastro/organizations_client_example_test.go b/sdk/resourcemanager/astro/armastro/organizations_client_example_test.go deleted file mode 100644 index 68713e68d066..000000000000 --- a/sdk/resourcemanager/astro/armastro/organizations_client_example_test.go +++ /dev/null @@ -1,533 +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. -// DO NOT EDIT. - -package armastro_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/astro/armastro" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/Organizations_ListBySubscription_MaximumSet_Gen.json -func ExampleOrganizationsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armastro.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOrganizationsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OrganizationResourceListResult = armastro.OrganizationResourceListResult{ - // Value: []*armastro.OrganizationResource{ - // { - // Name: to.Ptr("ycyrfvupthkudm"), - // Type: to.Ptr("ldwwclcpqssjomo"), - // ID: to.Ptr("bhslekyvgkfomahtvjiin"), - // SystemData: &armastro.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // CreatedBy: to.Ptr("zw"), - // CreatedByType: to.Ptr(armastro.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // LastModifiedBy: to.Ptr("isirkhwcppaqoqzoebybzikzbzkjzf"), - // LastModifiedByType: to.Ptr(armastro.CreatedByTypeUser), - // }, - // Location: to.Ptr("mhqthlsatwvqkl"), - // Tags: map[string]*string{ - // }, - // Identity: &armastro.ManagedServiceIdentity{ - // Type: to.Ptr(armastro.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // TenantID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // UserAssignedIdentities: map[string]*armastro.UserAssignedIdentity{ - // }, - // }, - // Properties: &armastro.LiftrBaseDataOrganizationProperties{ - // Marketplace: &armastro.LiftrBaseMarketplaceDetails{ - // OfferDetails: &armastro.LiftrBaseOfferDetails{ - // OfferID: to.Ptr("krzkefmpxztqyusidzgpchfaswuyce"), - // PlanID: to.Ptr("kndxzygsanuiqzwbfbbvoipv"), - // PlanName: to.Ptr("pwqjwlq"), - // PublisherID: to.Ptr("gfsqxygpnerxmvols"), - // TermID: to.Ptr("pwds"), - // TermUnit: to.Ptr("xyygyzcazkuelz"), - // }, - // SubscriptionID: to.Ptr("ntthclydlpqmasr"), - // SubscriptionStatus: to.Ptr(armastro.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // }, - // PartnerOrganizationProperties: &armastro.LiftrBaseDataPartnerOrganizationProperties{ - // OrganizationID: to.Ptr("lskgzdmziusgrsucv"), - // OrganizationName: to.Ptr("3-"), - // SingleSignOnProperties: &armastro.LiftrBaseSingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("kfbleh")}, - // EnterpriseAppID: to.Ptr("mklfypyujwumgwdzae"), - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armastro.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("ymmtzkyghvinvhgnqlzwrr"), - // }, - // WorkspaceID: to.Ptr("vcrupxwpaba"), - // WorkspaceName: to.Ptr("9.:06"), - // }, - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // User: &armastro.LiftrBaseUserDetails{ - // EmailAddress: to.Ptr(".K_@e7N-g1.xjqnbPs"), - // FirstName: to.Ptr("nfh"), - // LastName: to.Ptr("lazfbstcccykibvcrxpmglqam"), - // PhoneNumber: to.Ptr("inxkscllh"), - // Upn: to.Ptr("xtutvycpxjrtoftx"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/Organizations_ListByResourceGroup_MaximumSet_Gen.json -func ExampleOrganizationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armastro.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOrganizationsClient().NewListByResourceGroupPager("rgastronomer", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OrganizationResourceListResult = armastro.OrganizationResourceListResult{ - // Value: []*armastro.OrganizationResource{ - // { - // Name: to.Ptr("ycyrfvupthkudm"), - // Type: to.Ptr("ldwwclcpqssjomo"), - // ID: to.Ptr("bhslekyvgkfomahtvjiin"), - // SystemData: &armastro.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // CreatedBy: to.Ptr("zw"), - // CreatedByType: to.Ptr(armastro.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // LastModifiedBy: to.Ptr("isirkhwcppaqoqzoebybzikzbzkjzf"), - // LastModifiedByType: to.Ptr(armastro.CreatedByTypeUser), - // }, - // Location: to.Ptr("mhqthlsatwvqkl"), - // Tags: map[string]*string{ - // }, - // Identity: &armastro.ManagedServiceIdentity{ - // Type: to.Ptr(armastro.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // TenantID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // UserAssignedIdentities: map[string]*armastro.UserAssignedIdentity{ - // }, - // }, - // Properties: &armastro.LiftrBaseDataOrganizationProperties{ - // Marketplace: &armastro.LiftrBaseMarketplaceDetails{ - // OfferDetails: &armastro.LiftrBaseOfferDetails{ - // OfferID: to.Ptr("krzkefmpxztqyusidzgpchfaswuyce"), - // PlanID: to.Ptr("kndxzygsanuiqzwbfbbvoipv"), - // PlanName: to.Ptr("pwqjwlq"), - // PublisherID: to.Ptr("gfsqxygpnerxmvols"), - // TermID: to.Ptr("pwds"), - // TermUnit: to.Ptr("xyygyzcazkuelz"), - // }, - // SubscriptionID: to.Ptr("ntthclydlpqmasr"), - // SubscriptionStatus: to.Ptr(armastro.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // }, - // PartnerOrganizationProperties: &armastro.LiftrBaseDataPartnerOrganizationProperties{ - // OrganizationID: to.Ptr("lskgzdmziusgrsucv"), - // OrganizationName: to.Ptr("3-"), - // SingleSignOnProperties: &armastro.LiftrBaseSingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("kfbleh")}, - // EnterpriseAppID: to.Ptr("mklfypyujwumgwdzae"), - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armastro.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("ymmtzkyghvinvhgnqlzwrr"), - // }, - // WorkspaceID: to.Ptr("vcrupxwpaba"), - // WorkspaceName: to.Ptr("9.:06"), - // }, - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // User: &armastro.LiftrBaseUserDetails{ - // EmailAddress: to.Ptr(".K_@e7N-g1.xjqnbPs"), - // FirstName: to.Ptr("nfh"), - // LastName: to.Ptr("lazfbstcccykibvcrxpmglqam"), - // PhoneNumber: to.Ptr("inxkscllh"), - // Upn: to.Ptr("xtutvycpxjrtoftx"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/Organizations_Get_MaximumSet_Gen.json -func ExampleOrganizationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armastro.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOrganizationsClient().Get(ctx, "rgastronomer", "S PS", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OrganizationResource = armastro.OrganizationResource{ - // Name: to.Ptr("ycyrfvupthkudm"), - // Type: to.Ptr("ldwwclcpqssjomo"), - // ID: to.Ptr("bhslekyvgkfomahtvjiin"), - // SystemData: &armastro.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // CreatedBy: to.Ptr("zw"), - // CreatedByType: to.Ptr(armastro.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // LastModifiedBy: to.Ptr("isirkhwcppaqoqzoebybzikzbzkjzf"), - // LastModifiedByType: to.Ptr(armastro.CreatedByTypeUser), - // }, - // Location: to.Ptr("mhqthlsatwvqkl"), - // Tags: map[string]*string{ - // }, - // Identity: &armastro.ManagedServiceIdentity{ - // Type: to.Ptr(armastro.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // TenantID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // UserAssignedIdentities: map[string]*armastro.UserAssignedIdentity{ - // }, - // }, - // Properties: &armastro.LiftrBaseDataOrganizationProperties{ - // Marketplace: &armastro.LiftrBaseMarketplaceDetails{ - // OfferDetails: &armastro.LiftrBaseOfferDetails{ - // OfferID: to.Ptr("krzkefmpxztqyusidzgpchfaswuyce"), - // PlanID: to.Ptr("kndxzygsanuiqzwbfbbvoipv"), - // PlanName: to.Ptr("pwqjwlq"), - // PublisherID: to.Ptr("gfsqxygpnerxmvols"), - // TermID: to.Ptr("pwds"), - // TermUnit: to.Ptr("xyygyzcazkuelz"), - // }, - // SubscriptionID: to.Ptr("ntthclydlpqmasr"), - // SubscriptionStatus: to.Ptr(armastro.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // }, - // PartnerOrganizationProperties: &armastro.LiftrBaseDataPartnerOrganizationProperties{ - // OrganizationID: to.Ptr("lskgzdmziusgrsucv"), - // OrganizationName: to.Ptr("3-"), - // SingleSignOnProperties: &armastro.LiftrBaseSingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("kfbleh")}, - // EnterpriseAppID: to.Ptr("mklfypyujwumgwdzae"), - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armastro.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("ymmtzkyghvinvhgnqlzwrr"), - // }, - // WorkspaceID: to.Ptr("vcrupxwpaba"), - // WorkspaceName: to.Ptr("9.:06"), - // }, - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // User: &armastro.LiftrBaseUserDetails{ - // EmailAddress: to.Ptr(".K_@e7N-g1.xjqnbPs"), - // FirstName: to.Ptr("nfh"), - // LastName: to.Ptr("lazfbstcccykibvcrxpmglqam"), - // PhoneNumber: to.Ptr("inxkscllh"), - // Upn: to.Ptr("xtutvycpxjrtoftx"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/Organizations_CreateOrUpdate_MaximumSet_Gen.json -func ExampleOrganizationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armastro.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOrganizationsClient().BeginCreateOrUpdate(ctx, "rgastronomer", "U.1-:7", armastro.OrganizationResource{ - Location: to.Ptr("mhqthlsatwvqkl"), - Tags: map[string]*string{}, - Identity: &armastro.ManagedServiceIdentity{ - Type: to.Ptr(armastro.ManagedServiceIdentityTypeNone), - UserAssignedIdentities: map[string]*armastro.UserAssignedIdentity{}, - }, - Properties: &armastro.LiftrBaseDataOrganizationProperties{ - Marketplace: &armastro.LiftrBaseMarketplaceDetails{ - OfferDetails: &armastro.LiftrBaseOfferDetails{ - OfferID: to.Ptr("krzkefmpxztqyusidzgpchfaswuyce"), - PlanID: to.Ptr("kndxzygsanuiqzwbfbbvoipv"), - PlanName: to.Ptr("pwqjwlq"), - PublisherID: to.Ptr("gfsqxygpnerxmvols"), - TermID: to.Ptr("pwds"), - TermUnit: to.Ptr("xyygyzcazkuelz"), - }, - SubscriptionID: to.Ptr("ntthclydlpqmasr"), - SubscriptionStatus: to.Ptr(armastro.MarketplaceSubscriptionStatusPendingFulfillmentStart), - }, - PartnerOrganizationProperties: &armastro.LiftrBaseDataPartnerOrganizationProperties{ - OrganizationID: to.Ptr("lskgzdmziusgrsucv"), - OrganizationName: to.Ptr("3-"), - SingleSignOnProperties: &armastro.LiftrBaseSingleSignOnProperties{ - AADDomains: []*string{ - to.Ptr("kfbleh")}, - EnterpriseAppID: to.Ptr("mklfypyujwumgwdzae"), - ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - SingleSignOnState: to.Ptr(armastro.SingleSignOnStatesInitial), - SingleSignOnURL: to.Ptr("ymmtzkyghvinvhgnqlzwrr"), - }, - WorkspaceID: to.Ptr("vcrupxwpaba"), - WorkspaceName: to.Ptr("9.:06"), - }, - ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - User: &armastro.LiftrBaseUserDetails{ - EmailAddress: to.Ptr(".K_@e7N-g1.xjqnbPs"), - FirstName: to.Ptr("nfh"), - LastName: to.Ptr("lazfbstcccykibvcrxpmglqam"), - PhoneNumber: to.Ptr("inxkscllh"), - Upn: to.Ptr("xtutvycpxjrtoftx"), - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OrganizationResource = armastro.OrganizationResource{ - // Name: to.Ptr("ycyrfvupthkudm"), - // Type: to.Ptr("ldwwclcpqssjomo"), - // ID: to.Ptr("bhslekyvgkfomahtvjiin"), - // SystemData: &armastro.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // CreatedBy: to.Ptr("zw"), - // CreatedByType: to.Ptr(armastro.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // LastModifiedBy: to.Ptr("isirkhwcppaqoqzoebybzikzbzkjzf"), - // LastModifiedByType: to.Ptr(armastro.CreatedByTypeUser), - // }, - // Location: to.Ptr("mhqthlsatwvqkl"), - // Tags: map[string]*string{ - // }, - // Identity: &armastro.ManagedServiceIdentity{ - // Type: to.Ptr(armastro.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // TenantID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // UserAssignedIdentities: map[string]*armastro.UserAssignedIdentity{ - // }, - // }, - // Properties: &armastro.LiftrBaseDataOrganizationProperties{ - // Marketplace: &armastro.LiftrBaseMarketplaceDetails{ - // OfferDetails: &armastro.LiftrBaseOfferDetails{ - // OfferID: to.Ptr("krzkefmpxztqyusidzgpchfaswuyce"), - // PlanID: to.Ptr("kndxzygsanuiqzwbfbbvoipv"), - // PlanName: to.Ptr("pwqjwlq"), - // PublisherID: to.Ptr("gfsqxygpnerxmvols"), - // TermID: to.Ptr("pwds"), - // TermUnit: to.Ptr("xyygyzcazkuelz"), - // }, - // SubscriptionID: to.Ptr("ntthclydlpqmasr"), - // SubscriptionStatus: to.Ptr(armastro.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // }, - // PartnerOrganizationProperties: &armastro.LiftrBaseDataPartnerOrganizationProperties{ - // OrganizationID: to.Ptr("lskgzdmziusgrsucv"), - // OrganizationName: to.Ptr("3-"), - // SingleSignOnProperties: &armastro.LiftrBaseSingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("kfbleh")}, - // EnterpriseAppID: to.Ptr("mklfypyujwumgwdzae"), - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armastro.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("ymmtzkyghvinvhgnqlzwrr"), - // }, - // WorkspaceID: to.Ptr("vcrupxwpaba"), - // WorkspaceName: to.Ptr("9.:06"), - // }, - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // User: &armastro.LiftrBaseUserDetails{ - // EmailAddress: to.Ptr(".K_@e7N-g1.xjqnbPs"), - // FirstName: to.Ptr("nfh"), - // LastName: to.Ptr("lazfbstcccykibvcrxpmglqam"), - // PhoneNumber: to.Ptr("inxkscllh"), - // Upn: to.Ptr("xtutvycpxjrtoftx"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/Organizations_Update_MaximumSet_Gen.json -func ExampleOrganizationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armastro.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOrganizationsClient().BeginUpdate(ctx, "rgastronomer", "6.", armastro.OrganizationResourceUpdate{ - Identity: &armastro.ManagedServiceIdentity{ - Type: to.Ptr(armastro.ManagedServiceIdentityTypeNone), - UserAssignedIdentities: map[string]*armastro.UserAssignedIdentity{}, - }, - Properties: &armastro.OrganizationResourceUpdateProperties{ - PartnerOrganizationProperties: &armastro.LiftrBaseDataPartnerOrganizationPropertiesUpdate{ - OrganizationID: to.Ptr("lrtmbkvyvvoszhjevohkmyjhfyty"), - OrganizationName: to.Ptr("U2P_"), - SingleSignOnProperties: &armastro.LiftrBaseSingleSignOnProperties{ - AADDomains: []*string{ - to.Ptr("kfbleh")}, - EnterpriseAppID: to.Ptr("mklfypyujwumgwdzae"), - ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - SingleSignOnState: to.Ptr(armastro.SingleSignOnStatesInitial), - SingleSignOnURL: to.Ptr("ymmtzkyghvinvhgnqlzwrr"), - }, - WorkspaceID: to.Ptr("xsepuskdhejaadusyxq"), - WorkspaceName: to.Ptr("L.-y_--:"), - }, - User: &armastro.LiftrBaseUserDetailsUpdate{ - EmailAddress: to.Ptr(".K_@e7N-g1.xjqnbPs"), - FirstName: to.Ptr("qeuofehzypzljgcuysugefbgxde"), - LastName: to.Ptr("g"), - PhoneNumber: to.Ptr("aqpyxznvqpgkzohevynofrjdfgoo"), - Upn: to.Ptr("uwtprzdfpsqmktx"), - }, - }, - Tags: map[string]*string{ - "key1474": to.Ptr("bqqyipxnbbxryhznyaosmtpo"), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OrganizationResource = armastro.OrganizationResource{ - // Name: to.Ptr("ycyrfvupthkudm"), - // Type: to.Ptr("ldwwclcpqssjomo"), - // ID: to.Ptr("bhslekyvgkfomahtvjiin"), - // SystemData: &armastro.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // CreatedBy: to.Ptr("zw"), - // CreatedByType: to.Ptr(armastro.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-25T11:16:12.868Z"); return t}()), - // LastModifiedBy: to.Ptr("isirkhwcppaqoqzoebybzikzbzkjzf"), - // LastModifiedByType: to.Ptr(armastro.CreatedByTypeUser), - // }, - // Location: to.Ptr("mhqthlsatwvqkl"), - // Tags: map[string]*string{ - // }, - // Identity: &armastro.ManagedServiceIdentity{ - // Type: to.Ptr(armastro.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // TenantID: to.Ptr("b5684bd7-7958-4c0e-9795-d686c31746d2"), - // UserAssignedIdentities: map[string]*armastro.UserAssignedIdentity{ - // }, - // }, - // Properties: &armastro.LiftrBaseDataOrganizationProperties{ - // Marketplace: &armastro.LiftrBaseMarketplaceDetails{ - // OfferDetails: &armastro.LiftrBaseOfferDetails{ - // OfferID: to.Ptr("krzkefmpxztqyusidzgpchfaswuyce"), - // PlanID: to.Ptr("kndxzygsanuiqzwbfbbvoipv"), - // PlanName: to.Ptr("pwqjwlq"), - // PublisherID: to.Ptr("gfsqxygpnerxmvols"), - // TermID: to.Ptr("pwds"), - // TermUnit: to.Ptr("xyygyzcazkuelz"), - // }, - // SubscriptionID: to.Ptr("ntthclydlpqmasr"), - // SubscriptionStatus: to.Ptr(armastro.MarketplaceSubscriptionStatusPendingFulfillmentStart), - // }, - // PartnerOrganizationProperties: &armastro.LiftrBaseDataPartnerOrganizationProperties{ - // OrganizationID: to.Ptr("lrtmbkvyvvoszhjevohkmyjhfyty"), - // OrganizationName: to.Ptr("U2P_"), - // SingleSignOnProperties: &armastro.LiftrBaseSingleSignOnProperties{ - // AADDomains: []*string{ - // to.Ptr("kfbleh")}, - // EnterpriseAppID: to.Ptr("mklfypyujwumgwdzae"), - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armastro.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("ymmtzkyghvinvhgnqlzwrr"), - // }, - // WorkspaceID: to.Ptr("xsepuskdhejaadusyxq"), - // WorkspaceName: to.Ptr("L.-y_--:"), - // }, - // ProvisioningState: to.Ptr(armastro.ResourceProvisioningStateSucceeded), - // User: &armastro.LiftrBaseUserDetails{ - // EmailAddress: to.Ptr(".K_@e7N-g1.xjqnbPs"), - // FirstName: to.Ptr("qeuofehzypzljgcuysugefbgxde"), - // LastName: to.Ptr("g"), - // PhoneNumber: to.Ptr("aqpyxznvqpgkzohevynofrjdfgoo"), - // Upn: to.Ptr("uwtprzdfpsqmktx"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/liftrastronomer/resource-manager/Astronomer.Astro/stable/2023-08-01/examples/Organizations_Delete_MaximumSet_Gen.json -func ExampleOrganizationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armastro.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOrganizationsClient().BeginDelete(ctx, "rgastronomer", "q:", 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) - } -}