diff --git a/sdk/resourcemanager/marketplace/armmarketplace/CHANGELOG.md b/sdk/resourcemanager/marketplace/armmarketplace/CHANGELOG.md index 78be2831bd7a..527d1ed651ca 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/CHANGELOG.md +++ b/sdk/resourcemanager/marketplace/armmarketplace/CHANGELOG.md @@ -1,5 +1,35 @@ # Release History +## 1.1.0 (2022-06-08) +### Features Added + +- New function `*PrivateStoreCollectionClient.ApproveAllItems(context.Context, string, string, *PrivateStoreCollectionClientApproveAllItemsOptions) (PrivateStoreCollectionClientApproveAllItemsResponse, error)` +- New function `*PrivateStoreClient.AnyExistingOffersInTheCollections(context.Context, string, *PrivateStoreClientAnyExistingOffersInTheCollectionsOptions) (PrivateStoreClientAnyExistingOffersInTheCollectionsResponse, error)` +- New function `*PrivateStoreCollectionClient.DisableApproveAllItems(context.Context, string, string, *PrivateStoreCollectionClientDisableApproveAllItemsOptions) (PrivateStoreCollectionClientDisableApproveAllItemsResponse, error)` +- New function `*PrivateStoreCollectionOfferClient.UpsertOfferWithMultiContext(context.Context, string, string, string, *PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextOptions) (PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse, error)` +- New function `*PrivateStoreClient.QueryUserOffers(context.Context, string, *PrivateStoreClientQueryUserOffersOptions) (PrivateStoreClientQueryUserOffersResponse, error)` +- New struct `AnyExistingOffersInTheCollectionsResponse` +- New struct `ContextAndPlansDetails` +- New struct `MultiContextAndPlansPayload` +- New struct `MultiContextAndPlansProperties` +- New struct `PrivateStoreClientAnyExistingOffersInTheCollectionsOptions` +- New struct `PrivateStoreClientAnyExistingOffersInTheCollectionsResponse` +- New struct `PrivateStoreClientQueryUserOffersOptions` +- New struct `PrivateStoreClientQueryUserOffersResponse` +- New struct `PrivateStoreCollectionClientApproveAllItemsOptions` +- New struct `PrivateStoreCollectionClientApproveAllItemsResponse` +- New struct `PrivateStoreCollectionClientDisableApproveAllItemsOptions` +- New struct `PrivateStoreCollectionClientDisableApproveAllItemsResponse` +- New struct `PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextOptions` +- New struct `PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse` +- New struct `QueryUserOffersDetails` +- New struct `QueryUserOffersProperties` +- New field `SubscriptionIDs` in struct `QueryApprovedPlans` +- New field `AllItemsApproved` in struct `CollectionProperties` +- New field `AllItemsApprovedModifiedAt` in struct `CollectionProperties` +- New field `Icon` in struct `AdminRequestApprovalProperties` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplace/armmarketplace` 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/marketplace/armmarketplace/autorest.md b/sdk/resourcemanager/marketplace/armmarketplace/autorest.md index 5b3167f48a5d..61608cdd3f01 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/autorest.md +++ b/sdk/resourcemanager/marketplace/armmarketplace/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/marketplace/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/marketplace/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/marketplace/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/marketplace/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/marketplace/armmarketplace/go.mod b/sdk/resourcemanager/marketplace/armmarketplace/go.mod index 2139adc1531b..515b8c50e043 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/go.mod +++ b/sdk/resourcemanager/marketplace/armmarketplace/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplace/armmark 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 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 ) diff --git a/sdk/resourcemanager/marketplace/armmarketplace/go.sum b/sdk/resourcemanager/marketplace/armmarketplace/go.sum index ed5b814680ee..3f874a3bc5a6 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/go.sum +++ b/sdk/resourcemanager/marketplace/armmarketplace/go.sum @@ -1,33 +1,12 @@ 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.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_operations_client_test.go deleted file mode 100644 index 8142d5acd9cf..000000000000 --- a/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,37 +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 armmarketplace_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplace/armmarketplace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetOperations.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestore_client_test.go b/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestore_client_test.go deleted file mode 100644 index 9d0d96082c6e..000000000000 --- a/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestore_client_test.go +++ /dev/null @@ -1,570 +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 armmarketplace_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/marketplace/armmarketplace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetPrivateStores.json -func ExamplePrivateStoreClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armmarketplace.PrivateStoreClientListOptions{UseCache: 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetPrivateStore.json -func ExamplePrivateStoreClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/PrivateStores_update.json -func ExamplePrivateStoreClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CreateOrUpdate(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - &armmarketplace.PrivateStoreClientCreateOrUpdateOptions{Payload: &armmarketplace.PrivateStore{ - Properties: &armmarketplace.PrivateStoreProperties{ - Availability: to.Ptr(armmarketplace.AvailabilityDisabled), - ETag: to.Ptr("\"9301f4fd-0000-0100-0000-5e248b350345\""), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/DeletePrivateStore.json -func ExamplePrivateStoreClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/QueryOffers.json -func ExamplePrivateStoreClient_QueryOffers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryOffers(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/BillingAccounts.json -func ExamplePrivateStoreClient_BillingAccounts() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.BillingAccounts(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/CollectionsToSubscriptionsMapping.json -func ExamplePrivateStoreClient_CollectionsToSubscriptionsMapping() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CollectionsToSubscriptionsMapping(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - &armmarketplace.PrivateStoreClientCollectionsToSubscriptionsMappingOptions{Payload: &armmarketplace.CollectionsToSubscriptionsMappingPayload{ - Properties: &armmarketplace.CollectionsToSubscriptionsMappingProperties{ - SubscriptionIDs: []*string{ - to.Ptr("b340914e-353d-453a-85fb-8f9b65b51f91"), - to.Ptr("f2baa04d-5bfc-461b-b6d8-61b403c9ec48")}, - }, - }, - }) - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/QueryApprovedPlans.json -func ExamplePrivateStoreClient_QueryApprovedPlans() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryApprovedPlans(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - &armmarketplace.PrivateStoreClientQueryApprovedPlansOptions{Payload: &armmarketplace.QueryApprovedPlansPayload{ - Properties: &armmarketplace.QueryApprovedPlans{ - OfferID: to.Ptr("marketplacetestthirdparty.md-test-third-party-2"), - PlanIDs: []*string{ - to.Ptr("testPlanA"), - to.Ptr("testPlanB"), - to.Ptr("testPlanC")}, - }, - }, - }) - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/BulkCollectionsAction.json -func ExamplePrivateStoreClient_BulkCollectionsAction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.BulkCollectionsAction(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - &armmarketplace.PrivateStoreClientBulkCollectionsActionOptions{Payload: &armmarketplace.BulkCollectionsPayload{ - Properties: &armmarketplace.BulkCollectionsDetails{ - Action: to.Ptr("EnableCollections"), - CollectionIDs: []*string{ - to.Ptr("c752f021-1c37-4af5-b82f-74c51c27b44a"), - to.Ptr("f47ef1c7-e908-4f39-ae29-db181634ad8d")}, - }, - }, - }) - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetApprovalRequestsList.json -func ExamplePrivateStoreClient_GetApprovalRequestsList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetApprovalRequestsList(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetRequestApproval.json -func ExamplePrivateStoreClient_GetRequestApproval() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetRequestApproval(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/CreateApprovalRequest.json -func ExamplePrivateStoreClient_CreateApprovalRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateApprovalRequest(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - &armmarketplace.PrivateStoreClientCreateApprovalRequestOptions{Payload: 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/QueryRequestApproval.json -func ExamplePrivateStoreClient_QueryRequestApproval() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryRequestApproval(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - &armmarketplace.PrivateStoreClientQueryRequestApprovalOptions{Payload: &armmarketplace.QueryRequestApprovalProperties{ - Properties: &armmarketplace.RequestDetails{ - PlanIDs: []*string{ - to.Ptr("testPlanA"), - to.Ptr("testPlanB"), - to.Ptr("*")}, - PublisherID: to.Ptr("marketplacetestthirdparty"), - }, - }, - }) - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/AdminRequestApprovalsList.json -func ExamplePrivateStoreClient_AdminRequestApprovalsList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AdminRequestApprovalsList(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetAdminRequestApproval.json -func ExamplePrivateStoreClient_GetAdminRequestApproval() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAdminRequestApproval(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - "marketplacetestthirdparty", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/UpdateAdminRequestApproval.json -func ExamplePrivateStoreClient_UpdateAdminRequestApproval() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateAdminRequestApproval(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - &armmarketplace.PrivateStoreClientUpdateAdminRequestApprovalOptions{Payload: &armmarketplace.AdminRequestApprovalsResource{ - Properties: &armmarketplace.AdminRequestApprovalProperties{ - AdminAction: to.Ptr(armmarketplace.AdminActionApproved), - ApprovedPlans: []*string{ - to.Ptr("testPlan")}, - CollectionIDs: []*string{ - to.Ptr("f8ee227e-85d7-477d-abbf-854d6decaf70"), - to.Ptr("39246ad6-c521-4fed-8de7-77dede2e873f")}, - Comment: to.Ptr("I'm ok with that"), - PublisherID: to.Ptr("marketplacetestthirdparty"), - }, - }, - }) - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/NotificationsState.json -func ExamplePrivateStoreClient_QueryNotificationsState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryNotificationsState(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/AcknowledgeNotification.json -func ExamplePrivateStoreClient_AcknowledgeOfferNotification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.AcknowledgeOfferNotification(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - &armmarketplace.PrivateStoreClientAcknowledgeOfferNotificationOptions{Payload: &armmarketplace.AcknowledgeOfferNotificationProperties{ - Properties: &armmarketplace.AcknowledgeOfferNotificationDetails{ - Acknowledge: to.Ptr(false), - Dismiss: to.Ptr(false), - RemoveOffer: to.Ptr(false), - RemovePlans: []*string{ - to.Ptr("testPlanA")}, - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/WithdrawPlan.json -func ExamplePrivateStoreClient_WithdrawPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.WithdrawPlan(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - &armmarketplace.PrivateStoreClientWithdrawPlanOptions{Payload: &armmarketplace.WithdrawProperties{ - Properties: &armmarketplace.WithdrawDetails{ - PlanID: to.Ptr("*"), - PublisherID: to.Ptr("marketplacetestthirdparty"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/FetchAllSubscriptionsInTenant.json -func ExamplePrivateStoreClient_FetchAllSubscriptionsInTenant() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.FetchAllSubscriptionsInTenant(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - &armmarketplace.PrivateStoreClientFetchAllSubscriptionsInTenantOptions{NextPageToken: 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/ListNewPlansNotifications.json -func ExamplePrivateStoreClient_ListNewPlansNotifications() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListNewPlansNotifications(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/ListStopSellOffersPlansNotifications.json -func ExamplePrivateStoreClient_ListStopSellOffersPlansNotifications() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListStopSellOffersPlansNotifications(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - &armmarketplace.PrivateStoreClientListStopSellOffersPlansNotificationsOptions{StopSellSubscriptions: 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/ListSubscriptionsContext.json -func ExamplePrivateStoreClient_ListSubscriptionsContext() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSubscriptionsContext(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestorecollection_client_test.go b/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestorecollection_client_test.go deleted file mode 100644 index a542a2b9d905..000000000000 --- a/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestorecollection_client_test.go +++ /dev/null @@ -1,166 +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 armmarketplace_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/marketplace/armmarketplace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetPrivateStoreCollectionsList.json -func ExamplePrivateStoreCollectionClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetPrivateStoreCollection.json -func ExamplePrivateStoreCollectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "56a1a02d-8cf8-45df-bf37-d5f7120fcb3d", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/CreatePrivateStoreCollection.json -func ExamplePrivateStoreCollectionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "d0f5aa2c-ecc3-4d87-906a-f8c486dcc4f1", - &armmarketplace.PrivateStoreCollectionClientCreateOrUpdateOptions{Payload: &armmarketplace.Collection{ - Properties: &armmarketplace.CollectionProperties{ - AllSubscriptions: to.Ptr(false), - Claim: to.Ptr(""), - CollectionName: to.Ptr("Test Collection"), - SubscriptionsList: []*string{ - to.Ptr("b340914e-353d-453a-85fb-8f9b65b51f91"), - to.Ptr("f2baa04d-5bfc-461b-b6d8-61b403c9ec48")}, - }, - }, - }) - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/DeletePrivateStoreCollection.json -func ExamplePrivateStoreCollectionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "d0f5aa2c-ecc3-4d87-906a-f8c486dcc4f1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/PostPrivateStoreCollection.json -func ExamplePrivateStoreCollectionClient_Post() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Post(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "56a1a02d-8cf8-45df-bf37-d5f7120fcb3d", - &armmarketplace.PrivateStoreCollectionClientPostOptions{Payload: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/TransferOffers.json -func ExamplePrivateStoreCollectionClient_TransferOffers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.TransferOffers(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "56a1a02d-8cf8-45df-bf37-d5f7120fcb3d", - &armmarketplace.PrivateStoreCollectionClientTransferOffersOptions{Payload: &armmarketplace.TransferOffersProperties{ - Properties: &armmarketplace.TransferOffersDetails{ - OfferIDsList: []*string{ - to.Ptr("marketplacetestthirdparty.md-test-third-party-2"), - to.Ptr("marketplacetestthirdparty.md-test-third-party-3")}, - Operation: to.Ptr("copy"), - TargetCollections: []*string{ - to.Ptr("c752f021-1c37-4af5-b82f-74c51c27b44a"), - to.Ptr("f47ef1c7-e908-4f39-ae29-db181634ad8d")}, - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestorecollectionoffer_client_test.go b/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestorecollectionoffer_client_test.go deleted file mode 100644 index ad2c0718ee4e..000000000000 --- a/sdk/resourcemanager/marketplace/armmarketplace/ze_generated_example_privatestorecollectionoffer_client_test.go +++ /dev/null @@ -1,140 +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 armmarketplace_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/marketplace/armmarketplace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetPrivateStoreOffers.json -func ExamplePrivateStoreCollectionOfferClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionOfferClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "56a1a02d-8cf8-45df-bf37-d5f7120fcb3d", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/GetPrivateStoreCollectionOffer.json -func ExamplePrivateStoreCollectionOfferClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionOfferClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - "56a1a02d-8cf8-45df-bf37-d5f7120fcb3d", - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/PrivateStoreOffer_update.json -func ExamplePrivateStoreCollectionOfferClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionOfferClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - "56a1a02d-8cf8-45df-bf37-d5f7120fcb3d", - &armmarketplace.PrivateStoreCollectionOfferClientCreateOrUpdateOptions{Payload: &armmarketplace.Offer{ - Properties: &armmarketplace.OfferProperties{ - ETag: to.Ptr("\"9301f4fd-0000-0100-0000-5e248b350666\""), - SpecificPlanIDsLimitation: []*string{ - to.Ptr("0001"), - to.Ptr("0002")}, - }, - }, - }) - 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/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/DeletePrivateStoreOffer.json -func ExamplePrivateStoreCollectionOfferClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionOfferClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - "56a1a02d-8cf8-45df-bf37-d5f7120fcb3d", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2021-12-01/examples/PostPrivateStoreCollectionOffer.json -func ExamplePrivateStoreCollectionOfferClient_Post() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmarketplace.NewPrivateStoreCollectionOfferClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Post(ctx, - "a0e28e55-90c4-41d8-8e34-bb7ef7775406", - "marketplacetestthirdparty.md-test-third-party-2", - "56a1a02d-8cf8-45df-bf37-d5f7120fcb3d", - &armmarketplace.PrivateStoreCollectionOfferClientPostOptions{Payload: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_constants.go b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_constants.go index 5a9fb8221e2a..3a6c94b898ea 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_constants.go +++ b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_constants.go @@ -10,7 +10,7 @@ package armmarketplace const ( moduleName = "armmarketplace" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) // Accessibility - Plan accessibility diff --git a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_models.go b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_models.go index deb564c299d0..366da5c2db33 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_models.go +++ b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_models.go @@ -60,6 +60,9 @@ type AdminRequestApprovalProperties struct { // READ-ONLY; Gets display name DisplayName *string `json:"displayName,omitempty" azure:"ro"` + // READ-ONLY; The offer icon url. + Icon *string `json:"icon,omitempty" azure:"ro"` + // READ-ONLY; Gets list of plans with requesters details Plans []*PlanRequesterDetails `json:"plans,omitempty" azure:"ro"` } @@ -90,6 +93,12 @@ type AdminRequestApprovalsResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// AnyExistingOffersInTheCollectionsResponse - Response object of query if are there existing offers in the collections. +type AnyExistingOffersInTheCollectionsResponse struct { + // Boolean answer, true if exists at least a single offer in an enabled collection, otherwise, false. + Value *bool `json:"value,omitempty"` +} + // BillingAccountsResponse - Billing accounts response object type BillingAccountsResponse struct { // Billing accounts list @@ -158,6 +167,12 @@ type CollectionProperties struct { // is considered as bad request SubscriptionsList []*string `json:"subscriptionsList,omitempty"` + // READ-ONLY; Indicating whether all items are approved for this collection (=true) or not (=false). + AllItemsApproved *bool `json:"allItemsApproved,omitempty" azure:"ro"` + + // READ-ONLY; Gets the modified date of all items approved. + AllItemsApprovedModifiedAt *time.Time `json:"allItemsApprovedModifiedAt,omitempty" azure:"ro"` + // READ-ONLY; Gets collection Id. CollectionID *string `json:"collectionId,omitempty" azure:"ro"` @@ -207,6 +222,15 @@ type CollectionsToSubscriptionsMappingResponse struct { Details map[string]*CollectionsSubscriptionsMappingDetails `json:"details,omitempty"` } +// ContextAndPlansDetails - Object of plans per context. +type ContextAndPlansDetails struct { + // Plan's context, e.g. subscription ID, tenant ID. + Context *string `json:"context,omitempty"` + + // List of plan IDs. + PlanIDs []*string `json:"planIds,omitempty"` +} + // ErrorResponse - Error response indicates Microsoft.Marketplace service is not able to process the incoming request. The // reason is provided in the error message. type ErrorResponse struct { @@ -223,6 +247,22 @@ type ErrorResponseError struct { Message *string `json:"message,omitempty" azure:"ro"` } +// MultiContextAndPlansPayload - Payload object for upsert offer with multiple context and plans. +type MultiContextAndPlansPayload struct { + // Object describes multiple context and plans. + Properties *MultiContextAndPlansProperties `json:"properties,omitempty"` +} + +// MultiContextAndPlansProperties - Object describes multiple context and plans. +type MultiContextAndPlansProperties struct { + // The offer's eTag. + ETag *string `json:"eTag,omitempty"` + + // The offer ID which contains the plans. + OfferID *string `json:"offerId,omitempty"` + PlansContext []*ContextAndPlansDetails `json:"plansContext,omitempty"` +} + // NewNotifications - New plans notification details type NewNotifications struct { // Gets offer display name @@ -425,6 +465,12 @@ type PrivateStoreClientAdminRequestApprovalsListOptions struct { // placeholder for future optional parameters } +// PrivateStoreClientAnyExistingOffersInTheCollectionsOptions contains the optional parameters for the PrivateStoreClient.AnyExistingOffersInTheCollections +// method. +type PrivateStoreClientAnyExistingOffersInTheCollectionsOptions struct { + // placeholder for future optional parameters +} + // PrivateStoreClientBillingAccountsOptions contains the optional parameters for the PrivateStoreClient.BillingAccounts method. type PrivateStoreClientBillingAccountsOptions struct { // placeholder for future optional parameters @@ -535,6 +581,11 @@ type PrivateStoreClientQueryRequestApprovalOptions struct { Payload *QueryRequestApprovalProperties } +// PrivateStoreClientQueryUserOffersOptions contains the optional parameters for the PrivateStoreClient.QueryUserOffers method. +type PrivateStoreClientQueryUserOffersOptions struct { + Payload *QueryUserOffersProperties +} + // PrivateStoreClientUpdateAdminRequestApprovalOptions contains the optional parameters for the PrivateStoreClient.UpdateAdminRequestApproval // method. type PrivateStoreClientUpdateAdminRequestApprovalOptions struct { @@ -546,6 +597,12 @@ type PrivateStoreClientWithdrawPlanOptions struct { Payload *WithdrawProperties } +// PrivateStoreCollectionClientApproveAllItemsOptions contains the optional parameters for the PrivateStoreCollectionClient.ApproveAllItems +// method. +type PrivateStoreCollectionClientApproveAllItemsOptions struct { + // placeholder for future optional parameters +} + // PrivateStoreCollectionClientCreateOrUpdateOptions contains the optional parameters for the PrivateStoreCollectionClient.CreateOrUpdate // method. type PrivateStoreCollectionClientCreateOrUpdateOptions struct { @@ -558,6 +615,12 @@ type PrivateStoreCollectionClientDeleteOptions struct { // placeholder for future optional parameters } +// PrivateStoreCollectionClientDisableApproveAllItemsOptions contains the optional parameters for the PrivateStoreCollectionClient.DisableApproveAllItems +// method. +type PrivateStoreCollectionClientDisableApproveAllItemsOptions struct { + // placeholder for future optional parameters +} + // PrivateStoreCollectionClientGetOptions contains the optional parameters for the PrivateStoreCollectionClient.Get method. type PrivateStoreCollectionClientGetOptions struct { // placeholder for future optional parameters @@ -609,6 +672,12 @@ type PrivateStoreCollectionOfferClientPostOptions struct { Payload *Operation } +// PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextOptions contains the optional parameters for the PrivateStoreCollectionOfferClient.UpsertOfferWithMultiContext +// method. +type PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextOptions struct { + Payload *MultiContextAndPlansPayload +} + // PrivateStoreList - Describes the json payload for the list of available private stores (between zero and one, inclusive) type PrivateStoreList struct { // URL to get the next set of PrivateStore list results if there are any. @@ -660,6 +729,9 @@ type QueryApprovedPlans struct { // Offer plan ids PlanIDs []*string `json:"planIds,omitempty"` + + // List of subscription IDs + SubscriptionIDs []*string `json:"subscriptionIds,omitempty"` } // QueryApprovedPlansDetails - Query approved plans response @@ -717,6 +789,21 @@ type QueryRequestApprovalProperties struct { Properties *RequestDetails `json:"properties,omitempty"` } +// QueryUserOffersDetails - List of offers IDs and list of user's subscriptions IDs to query the user's approved offers +type QueryUserOffersDetails struct { + // List of offer IDs + OfferIDs []*string `json:"offerIds,omitempty"` + + // List of subscription IDs + SubscriptionIDs []*string `json:"subscriptionIds,omitempty"` +} + +// QueryUserOffersProperties - Query user's offers properties +type QueryUserOffersProperties struct { + // Query user's offers details + Properties *QueryUserOffersDetails `json:"properties,omitempty"` +} + // Recipient - Describes the json payload for a notified recipient for new requests type Recipient struct { // Principal ID diff --git a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_models_serde.go b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_models_serde.go index 6f409045e1ba..ff3cf662a4fe 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_models_serde.go +++ b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_models_serde.go @@ -35,6 +35,7 @@ func (a AdminRequestApprovalProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "collectionIds", a.CollectionIDs) populate(objectMap, "comment", a.Comment) populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "icon", a.Icon) populate(objectMap, "offerId", a.OfferID) populate(objectMap, "plans", a.Plans) populate(objectMap, "publisherId", a.PublisherID) @@ -52,6 +53,8 @@ func (b BulkCollectionsDetails) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type CollectionProperties. func (c CollectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "allItemsApproved", c.AllItemsApproved) + populateTimeRFC3339(objectMap, "allItemsApprovedModifiedAt", c.AllItemsApprovedModifiedAt) populate(objectMap, "allSubscriptions", c.AllSubscriptions) populate(objectMap, "claim", c.Claim) populate(objectMap, "collectionId", c.CollectionID) @@ -62,6 +65,50 @@ func (c CollectionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type CollectionProperties. +func (c *CollectionProperties) 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 "allItemsApproved": + err = unpopulate(val, "AllItemsApproved", &c.AllItemsApproved) + delete(rawMsg, key) + case "allItemsApprovedModifiedAt": + err = unpopulateTimeRFC3339(val, "AllItemsApprovedModifiedAt", &c.AllItemsApprovedModifiedAt) + delete(rawMsg, key) + case "allSubscriptions": + err = unpopulate(val, "AllSubscriptions", &c.AllSubscriptions) + delete(rawMsg, key) + case "claim": + err = unpopulate(val, "Claim", &c.Claim) + delete(rawMsg, key) + case "collectionId": + err = unpopulate(val, "CollectionID", &c.CollectionID) + delete(rawMsg, key) + case "collectionName": + err = unpopulate(val, "CollectionName", &c.CollectionName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &c.Enabled) + delete(rawMsg, key) + case "numberOfOffers": + err = unpopulate(val, "NumberOfOffers", &c.NumberOfOffers) + delete(rawMsg, key) + case "subscriptionsList": + err = unpopulate(val, "SubscriptionsList", &c.SubscriptionsList) + 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 CollectionsToSubscriptionsMappingProperties. func (c CollectionsToSubscriptionsMappingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -69,6 +116,23 @@ func (c CollectionsToSubscriptionsMappingProperties) MarshalJSON() ([]byte, erro return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type ContextAndPlansDetails. +func (c ContextAndPlansDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "context", c.Context) + populate(objectMap, "planIds", c.PlanIDs) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MultiContextAndPlansProperties. +func (m MultiContextAndPlansProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", m.ETag) + populate(objectMap, "offerId", m.OfferID) + populate(objectMap, "plansContext", m.PlansContext) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type NotificationsSettingsProperties. func (n NotificationsSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -123,6 +187,15 @@ func (q QueryApprovedPlans) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "offerId", q.OfferID) populate(objectMap, "planIds", q.PlanIDs) + populate(objectMap, "subscriptionIds", q.SubscriptionIDs) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type QueryUserOffersDetails. +func (q QueryUserOffersDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "offerIds", q.OfferIDs) + populate(objectMap, "subscriptionIds", q.SubscriptionIDs) return json.Marshal(objectMap) } diff --git a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_operations_client.go b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_operations_client.go index 778f0969b96c..f1176342da68 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_operations_client.go +++ b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // List - Lists all of the available Microsoft.Marketplace REST API operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) @@ -75,7 +75,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestore_client.go b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestore_client.go index 8e6d351dfb66..89f3fceb1b29 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestore_client.go +++ b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestore_client.go @@ -53,7 +53,7 @@ func NewPrivateStoreClient(credential azcore.TokenCredential, options *arm.Clien // AcknowledgeOfferNotification - Acknowledge notification for offer // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // offerID - The offer ID to update or delete // options - PrivateStoreClientAcknowledgeOfferNotificationOptions contains the optional parameters for the PrivateStoreClient.AcknowledgeOfferNotification @@ -89,7 +89,7 @@ func (client *PrivateStoreClient) acknowledgeOfferNotificationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -100,7 +100,7 @@ func (client *PrivateStoreClient) acknowledgeOfferNotificationCreateRequest(ctx // AdminRequestApprovalsList - Get list of admin request approvals // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientAdminRequestApprovalsListOptions contains the optional parameters for the PrivateStoreClient.AdminRequestApprovalsList // method. @@ -131,7 +131,7 @@ func (client *PrivateStoreClient) adminRequestApprovalsListCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -146,9 +146,57 @@ func (client *PrivateStoreClient) adminRequestApprovalsListHandleResponse(resp * return result, nil } +// AnyExistingOffersInTheCollections - Query whether exists any offer in the collections. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-01 +// privateStoreID - The store ID - must use the tenant ID +// options - PrivateStoreClientAnyExistingOffersInTheCollectionsOptions contains the optional parameters for the PrivateStoreClient.AnyExistingOffersInTheCollections +// method. +func (client *PrivateStoreClient) AnyExistingOffersInTheCollections(ctx context.Context, privateStoreID string, options *PrivateStoreClientAnyExistingOffersInTheCollectionsOptions) (PrivateStoreClientAnyExistingOffersInTheCollectionsResponse, error) { + req, err := client.anyExistingOffersInTheCollectionsCreateRequest(ctx, privateStoreID, options) + if err != nil { + return PrivateStoreClientAnyExistingOffersInTheCollectionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateStoreClientAnyExistingOffersInTheCollectionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateStoreClientAnyExistingOffersInTheCollectionsResponse{}, runtime.NewResponseError(resp) + } + return client.anyExistingOffersInTheCollectionsHandleResponse(resp) +} + +// anyExistingOffersInTheCollectionsCreateRequest creates the AnyExistingOffersInTheCollections request. +func (client *PrivateStoreClient) anyExistingOffersInTheCollectionsCreateRequest(ctx context.Context, privateStoreID string, options *PrivateStoreClientAnyExistingOffersInTheCollectionsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/anyExistingOffersInTheCollections" + if privateStoreID == "" { + return nil, errors.New("parameter privateStoreID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, 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 +} + +// anyExistingOffersInTheCollectionsHandleResponse handles the AnyExistingOffersInTheCollections response. +func (client *PrivateStoreClient) anyExistingOffersInTheCollectionsHandleResponse(resp *http.Response) (PrivateStoreClientAnyExistingOffersInTheCollectionsResponse, error) { + result := PrivateStoreClientAnyExistingOffersInTheCollectionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AnyExistingOffersInTheCollectionsResponse); err != nil { + return PrivateStoreClientAnyExistingOffersInTheCollectionsResponse{}, err + } + return result, nil +} + // BillingAccounts - Tenant billing accounts names // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientBillingAccountsOptions contains the optional parameters for the PrivateStoreClient.BillingAccounts // method. @@ -179,7 +227,7 @@ func (client *PrivateStoreClient) billingAccountsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +244,7 @@ func (client *PrivateStoreClient) billingAccountsHandleResponse(resp *http.Respo // BulkCollectionsAction - Perform an action on bulk collections // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientBulkCollectionsActionOptions contains the optional parameters for the PrivateStoreClient.BulkCollectionsAction // method. @@ -227,7 +275,7 @@ func (client *PrivateStoreClient) bulkCollectionsActionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -248,7 +296,7 @@ func (client *PrivateStoreClient) bulkCollectionsActionHandleResponse(resp *http // CollectionsToSubscriptionsMapping - For a given subscriptions list, the API will return a map of collections and the related // subscriptions from the supplied list. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientCollectionsToSubscriptionsMappingOptions contains the optional parameters for the PrivateStoreClient.CollectionsToSubscriptionsMapping // method. @@ -279,7 +327,7 @@ func (client *PrivateStoreClient) collectionsToSubscriptionsMappingCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -299,7 +347,7 @@ func (client *PrivateStoreClient) collectionsToSubscriptionsMappingHandleRespons // CreateApprovalRequest - Create approval request // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // requestApprovalID - The request approval ID to get create or update // options - PrivateStoreClientCreateApprovalRequestOptions contains the optional parameters for the PrivateStoreClient.CreateApprovalRequest @@ -335,7 +383,7 @@ func (client *PrivateStoreClient) createApprovalRequestCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -355,7 +403,7 @@ func (client *PrivateStoreClient) createApprovalRequestHandleResponse(resp *http // CreateOrUpdate - Changes private store properties // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientCreateOrUpdateOptions contains the optional parameters for the PrivateStoreClient.CreateOrUpdate // method. @@ -386,7 +434,7 @@ func (client *PrivateStoreClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -397,7 +445,7 @@ func (client *PrivateStoreClient) createOrUpdateCreateRequest(ctx context.Contex // Delete - Deletes the private store. All that is not saved will be lost. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientDeleteOptions contains the optional parameters for the PrivateStoreClient.Delete method. func (client *PrivateStoreClient) Delete(ctx context.Context, privateStoreID string, options *PrivateStoreClientDeleteOptions) (PrivateStoreClientDeleteResponse, error) { @@ -427,7 +475,7 @@ func (client *PrivateStoreClient) deleteCreateRequest(ctx context.Context, priva return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,7 +483,7 @@ func (client *PrivateStoreClient) deleteCreateRequest(ctx context.Context, priva // FetchAllSubscriptionsInTenant - Fetch all subscriptions in tenant, only for marketplace admin // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientFetchAllSubscriptionsInTenantOptions contains the optional parameters for the PrivateStoreClient.FetchAllSubscriptionsInTenant // method. @@ -466,7 +514,7 @@ func (client *PrivateStoreClient) fetchAllSubscriptionsInTenantCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.NextPageToken != nil { req.Raw().Header["next-page-token"] = []string{*options.NextPageToken} @@ -486,7 +534,7 @@ func (client *PrivateStoreClient) fetchAllSubscriptionsInTenantHandleResponse(re // Get - Get information about the private store // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientGetOptions contains the optional parameters for the PrivateStoreClient.Get method. func (client *PrivateStoreClient) Get(ctx context.Context, privateStoreID string, options *PrivateStoreClientGetOptions) (PrivateStoreClientGetResponse, error) { @@ -516,7 +564,7 @@ func (client *PrivateStoreClient) getCreateRequest(ctx context.Context, privateS return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -533,7 +581,7 @@ func (client *PrivateStoreClient) getHandleResponse(resp *http.Response) (Privat // GetAdminRequestApproval - Get open approval requests // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // adminRequestApprovalID - The admin request approval ID to get create or update // publisherID - The publisher id of this offer. @@ -570,7 +618,7 @@ func (client *PrivateStoreClient) getAdminRequestApprovalCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") reqQP.Set("publisherId", publisherID) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -588,7 +636,7 @@ func (client *PrivateStoreClient) getAdminRequestApprovalHandleResponse(resp *ht // GetApprovalRequestsList - Get all open approval requests of current user // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientGetApprovalRequestsListOptions contains the optional parameters for the PrivateStoreClient.GetApprovalRequestsList // method. @@ -619,7 +667,7 @@ func (client *PrivateStoreClient) getApprovalRequestsListCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -636,7 +684,7 @@ func (client *PrivateStoreClient) getApprovalRequestsListHandleResponse(resp *ht // GetRequestApproval - Get open request approval details // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // requestApprovalID - The request approval ID to get create or update // options - PrivateStoreClientGetRequestApprovalOptions contains the optional parameters for the PrivateStoreClient.GetRequestApproval @@ -672,7 +720,7 @@ func (client *PrivateStoreClient) getRequestApprovalCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -689,7 +737,7 @@ func (client *PrivateStoreClient) getRequestApprovalHandleResponse(resp *http.Re // NewListPager - Gets the list of available private stores. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // options - PrivateStoreClientListOptions contains the optional parameters for the PrivateStoreClient.List method. func (client *PrivateStoreClient) NewListPager(options *PrivateStoreClientListOptions) *runtime.Pager[PrivateStoreClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateStoreClientListResponse]{ @@ -727,7 +775,7 @@ func (client *PrivateStoreClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") if options != nil && options.UseCache != nil { reqQP.Set("use-cache", *options.UseCache) } @@ -747,7 +795,7 @@ func (client *PrivateStoreClient) listHandleResponse(resp *http.Response) (Priva // ListNewPlansNotifications - List new plans notifications // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientListNewPlansNotificationsOptions contains the optional parameters for the PrivateStoreClient.ListNewPlansNotifications // method. @@ -778,7 +826,7 @@ func (client *PrivateStoreClient) listNewPlansNotificationsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -795,7 +843,7 @@ func (client *PrivateStoreClient) listNewPlansNotificationsHandleResponse(resp * // ListStopSellOffersPlansNotifications - List stop sell notifications for both stop sell offers and stop sell plans // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientListStopSellOffersPlansNotificationsOptions contains the optional parameters for the PrivateStoreClient.ListStopSellOffersPlansNotifications // method. @@ -826,7 +874,7 @@ func (client *PrivateStoreClient) listStopSellOffersPlansNotificationsCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.StopSellSubscriptions != nil { @@ -846,7 +894,7 @@ func (client *PrivateStoreClient) listStopSellOffersPlansNotificationsHandleResp // ListSubscriptionsContext - List all the subscriptions in the private store context // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientListSubscriptionsContextOptions contains the optional parameters for the PrivateStoreClient.ListSubscriptionsContext // method. @@ -877,7 +925,7 @@ func (client *PrivateStoreClient) listSubscriptionsContextCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -894,7 +942,7 @@ func (client *PrivateStoreClient) listSubscriptionsContextHandleResponse(resp *h // QueryApprovedPlans - Get map of plans and related approved subscriptions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientQueryApprovedPlansOptions contains the optional parameters for the PrivateStoreClient.QueryApprovedPlans // method. @@ -925,7 +973,7 @@ func (client *PrivateStoreClient) queryApprovedPlansCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -945,7 +993,7 @@ func (client *PrivateStoreClient) queryApprovedPlansHandleResponse(resp *http.Re // QueryNotificationsState - Get private store notifications state // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientQueryNotificationsStateOptions contains the optional parameters for the PrivateStoreClient.QueryNotificationsState // method. @@ -976,7 +1024,7 @@ func (client *PrivateStoreClient) queryNotificationsStateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -993,7 +1041,7 @@ func (client *PrivateStoreClient) queryNotificationsStateHandleResponse(resp *ht // QueryOffers - List of offers, regardless the collections // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreClientQueryOffersOptions contains the optional parameters for the PrivateStoreClient.QueryOffers // method. @@ -1024,7 +1072,7 @@ func (client *PrivateStoreClient) queryOffersCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1041,7 +1089,7 @@ func (client *PrivateStoreClient) queryOffersHandleResponse(resp *http.Response) // QueryRequestApproval - Get request statuses foreach plan, this api is used as a complex GET action. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // requestApprovalID - The request approval ID to get create or update // options - PrivateStoreClientQueryRequestApprovalOptions contains the optional parameters for the PrivateStoreClient.QueryRequestApproval @@ -1077,7 +1125,7 @@ func (client *PrivateStoreClient) queryRequestApprovalCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -1095,9 +1143,60 @@ func (client *PrivateStoreClient) queryRequestApprovalHandleResponse(resp *http. return result, nil } +// QueryUserOffers - List of user's approved offers for the provided offers and subscriptions +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-01 +// privateStoreID - The store ID - must use the tenant ID +// options - PrivateStoreClientQueryUserOffersOptions contains the optional parameters for the PrivateStoreClient.QueryUserOffers +// method. +func (client *PrivateStoreClient) QueryUserOffers(ctx context.Context, privateStoreID string, options *PrivateStoreClientQueryUserOffersOptions) (PrivateStoreClientQueryUserOffersResponse, error) { + req, err := client.queryUserOffersCreateRequest(ctx, privateStoreID, options) + if err != nil { + return PrivateStoreClientQueryUserOffersResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateStoreClientQueryUserOffersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateStoreClientQueryUserOffersResponse{}, runtime.NewResponseError(resp) + } + return client.queryUserOffersHandleResponse(resp) +} + +// queryUserOffersCreateRequest creates the QueryUserOffers request. +func (client *PrivateStoreClient) queryUserOffersCreateRequest(ctx context.Context, privateStoreID string, options *PrivateStoreClientQueryUserOffersOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/queryUserOffers" + if privateStoreID == "" { + return nil, errors.New("parameter privateStoreID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, 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"} + if options != nil && options.Payload != nil { + return req, runtime.MarshalAsJSON(req, *options.Payload) + } + return req, nil +} + +// queryUserOffersHandleResponse handles the QueryUserOffers response. +func (client *PrivateStoreClient) queryUserOffersHandleResponse(resp *http.Response) (PrivateStoreClientQueryUserOffersResponse, error) { + result := PrivateStoreClientQueryUserOffersResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.QueryOffers); err != nil { + return PrivateStoreClientQueryUserOffersResponse{}, err + } + return result, nil +} + // UpdateAdminRequestApproval - Update the admin action, weather the request is approved or rejected and the approved plans // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // adminRequestApprovalID - The admin request approval ID to get create or update // options - PrivateStoreClientUpdateAdminRequestApprovalOptions contains the optional parameters for the PrivateStoreClient.UpdateAdminRequestApproval @@ -1133,7 +1232,7 @@ func (client *PrivateStoreClient) updateAdminRequestApprovalCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -1153,7 +1252,7 @@ func (client *PrivateStoreClient) updateAdminRequestApprovalHandleResponse(resp // WithdrawPlan - Withdraw a user request approval on specific plan // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // requestApprovalID - The request approval ID to get create or update // options - PrivateStoreClientWithdrawPlanOptions contains the optional parameters for the PrivateStoreClient.WithdrawPlan @@ -1189,7 +1288,7 @@ func (client *PrivateStoreClient) withdrawPlanCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { diff --git a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestorecollection_client.go b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestorecollection_client.go index b257a8a88051..ed03438d5948 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestorecollection_client.go +++ b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestorecollection_client.go @@ -51,9 +51,62 @@ func NewPrivateStoreCollectionClient(credential azcore.TokenCredential, options return client, nil } +// ApproveAllItems - Delete all existing offers from the collection and enable approve all items. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-01 +// privateStoreID - The store ID - must use the tenant ID +// collectionID - The collection ID +// options - PrivateStoreCollectionClientApproveAllItemsOptions contains the optional parameters for the PrivateStoreCollectionClient.ApproveAllItems +// method. +func (client *PrivateStoreCollectionClient) ApproveAllItems(ctx context.Context, privateStoreID string, collectionID string, options *PrivateStoreCollectionClientApproveAllItemsOptions) (PrivateStoreCollectionClientApproveAllItemsResponse, error) { + req, err := client.approveAllItemsCreateRequest(ctx, privateStoreID, collectionID, options) + if err != nil { + return PrivateStoreCollectionClientApproveAllItemsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateStoreCollectionClientApproveAllItemsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateStoreCollectionClientApproveAllItemsResponse{}, runtime.NewResponseError(resp) + } + return client.approveAllItemsHandleResponse(resp) +} + +// approveAllItemsCreateRequest creates the ApproveAllItems request. +func (client *PrivateStoreCollectionClient) approveAllItemsCreateRequest(ctx context.Context, privateStoreID string, collectionID string, options *PrivateStoreCollectionClientApproveAllItemsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/collections/{collectionId}/approveAllItems" + if privateStoreID == "" { + return nil, errors.New("parameter privateStoreID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) + if collectionID == "" { + return nil, errors.New("parameter collectionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{collectionId}", url.PathEscape(collectionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, 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 +} + +// approveAllItemsHandleResponse handles the ApproveAllItems response. +func (client *PrivateStoreCollectionClient) approveAllItemsHandleResponse(resp *http.Response) (PrivateStoreCollectionClientApproveAllItemsResponse, error) { + result := PrivateStoreCollectionClientApproveAllItemsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Collection); err != nil { + return PrivateStoreCollectionClientApproveAllItemsResponse{}, err + } + return result, nil +} + // CreateOrUpdate - Create or update private store collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // collectionID - The collection ID // options - PrivateStoreCollectionClientCreateOrUpdateOptions contains the optional parameters for the PrivateStoreCollectionClient.CreateOrUpdate @@ -89,7 +142,7 @@ func (client *PrivateStoreCollectionClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -109,7 +162,7 @@ func (client *PrivateStoreCollectionClient) createOrUpdateHandleResponse(resp *h // Delete - Delete a collection from the given private store. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // collectionID - The collection ID // options - PrivateStoreCollectionClientDeleteOptions contains the optional parameters for the PrivateStoreCollectionClient.Delete @@ -145,15 +198,68 @@ func (client *PrivateStoreCollectionClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// DisableApproveAllItems - Disable approve all items for the collection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-01 +// privateStoreID - The store ID - must use the tenant ID +// collectionID - The collection ID +// options - PrivateStoreCollectionClientDisableApproveAllItemsOptions contains the optional parameters for the PrivateStoreCollectionClient.DisableApproveAllItems +// method. +func (client *PrivateStoreCollectionClient) DisableApproveAllItems(ctx context.Context, privateStoreID string, collectionID string, options *PrivateStoreCollectionClientDisableApproveAllItemsOptions) (PrivateStoreCollectionClientDisableApproveAllItemsResponse, error) { + req, err := client.disableApproveAllItemsCreateRequest(ctx, privateStoreID, collectionID, options) + if err != nil { + return PrivateStoreCollectionClientDisableApproveAllItemsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateStoreCollectionClientDisableApproveAllItemsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateStoreCollectionClientDisableApproveAllItemsResponse{}, runtime.NewResponseError(resp) + } + return client.disableApproveAllItemsHandleResponse(resp) +} + +// disableApproveAllItemsCreateRequest creates the DisableApproveAllItems request. +func (client *PrivateStoreCollectionClient) disableApproveAllItemsCreateRequest(ctx context.Context, privateStoreID string, collectionID string, options *PrivateStoreCollectionClientDisableApproveAllItemsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/collections/{collectionId}/disableApproveAllItems" + if privateStoreID == "" { + return nil, errors.New("parameter privateStoreID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) + if collectionID == "" { + return nil, errors.New("parameter collectionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{collectionId}", url.PathEscape(collectionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, 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 +} + +// disableApproveAllItemsHandleResponse handles the DisableApproveAllItems response. +func (client *PrivateStoreCollectionClient) disableApproveAllItemsHandleResponse(resp *http.Response) (PrivateStoreCollectionClientDisableApproveAllItemsResponse, error) { + result := PrivateStoreCollectionClientDisableApproveAllItemsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Collection); err != nil { + return PrivateStoreCollectionClientDisableApproveAllItemsResponse{}, err + } + return result, nil +} + // Get - Gets private store collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // collectionID - The collection ID // options - PrivateStoreCollectionClientGetOptions contains the optional parameters for the PrivateStoreCollectionClient.Get @@ -189,7 +295,7 @@ func (client *PrivateStoreCollectionClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -206,7 +312,7 @@ func (client *PrivateStoreCollectionClient) getHandleResponse(resp *http.Respons // List - Gets private store collections list // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // options - PrivateStoreCollectionClientListOptions contains the optional parameters for the PrivateStoreCollectionClient.List // method. @@ -237,7 +343,7 @@ func (client *PrivateStoreCollectionClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +360,7 @@ func (client *PrivateStoreCollectionClient) listHandleResponse(resp *http.Respon // Post - Delete Private store collection. This is a workaround. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // collectionID - The collection ID // options - PrivateStoreCollectionClientPostOptions contains the optional parameters for the PrivateStoreCollectionClient.Post @@ -290,7 +396,7 @@ func (client *PrivateStoreCollectionClient) postCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -301,7 +407,7 @@ func (client *PrivateStoreCollectionClient) postCreateRequest(ctx context.Contex // TransferOffers - transferring offers (copy or move) from source collection to target collection(s) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // collectionID - The collection ID // options - PrivateStoreCollectionClientTransferOffersOptions contains the optional parameters for the PrivateStoreCollectionClient.TransferOffers @@ -337,7 +443,7 @@ func (client *PrivateStoreCollectionClient) transferOffersCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { diff --git a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestorecollectionoffer_client.go b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestorecollectionoffer_client.go index 306cc3ace34b..91a67eeb54e3 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestorecollectionoffer_client.go +++ b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_privatestorecollectionoffer_client.go @@ -53,14 +53,14 @@ func NewPrivateStoreCollectionOfferClient(credential azcore.TokenCredential, opt // CreateOrUpdate - Update or add an offer to a specific collection of the private store. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID -// offerID - The offer ID to update or delete // collectionID - The collection ID +// offerID - The offer ID to update or delete // options - PrivateStoreCollectionOfferClientCreateOrUpdateOptions contains the optional parameters for the PrivateStoreCollectionOfferClient.CreateOrUpdate // method. -func (client *PrivateStoreCollectionOfferClient) CreateOrUpdate(ctx context.Context, privateStoreID string, offerID string, collectionID string, options *PrivateStoreCollectionOfferClientCreateOrUpdateOptions) (PrivateStoreCollectionOfferClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, privateStoreID, offerID, collectionID, options) +func (client *PrivateStoreCollectionOfferClient) CreateOrUpdate(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientCreateOrUpdateOptions) (PrivateStoreCollectionOfferClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, privateStoreID, collectionID, offerID, options) if err != nil { return PrivateStoreCollectionOfferClientCreateOrUpdateResponse{}, err } @@ -75,26 +75,26 @@ func (client *PrivateStoreCollectionOfferClient) CreateOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PrivateStoreCollectionOfferClient) createOrUpdateCreateRequest(ctx context.Context, privateStoreID string, offerID string, collectionID string, options *PrivateStoreCollectionOfferClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *PrivateStoreCollectionOfferClient) createOrUpdateCreateRequest(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/collections/{collectionId}/offers/{offerId}" if privateStoreID == "" { return nil, errors.New("parameter privateStoreID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) - if offerID == "" { - return nil, errors.New("parameter offerID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offerId}", url.PathEscape(offerID)) if collectionID == "" { return nil, errors.New("parameter collectionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{collectionId}", url.PathEscape(collectionID)) + if offerID == "" { + return nil, errors.New("parameter offerID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{offerId}", url.PathEscape(offerID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -114,14 +114,14 @@ func (client *PrivateStoreCollectionOfferClient) createOrUpdateHandleResponse(re // Delete - Deletes an offer from the given collection of private store. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID -// offerID - The offer ID to update or delete // collectionID - The collection ID +// offerID - The offer ID to update or delete // options - PrivateStoreCollectionOfferClientDeleteOptions contains the optional parameters for the PrivateStoreCollectionOfferClient.Delete // method. -func (client *PrivateStoreCollectionOfferClient) Delete(ctx context.Context, privateStoreID string, offerID string, collectionID string, options *PrivateStoreCollectionOfferClientDeleteOptions) (PrivateStoreCollectionOfferClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, privateStoreID, offerID, collectionID, options) +func (client *PrivateStoreCollectionOfferClient) Delete(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientDeleteOptions) (PrivateStoreCollectionOfferClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, privateStoreID, collectionID, offerID, options) if err != nil { return PrivateStoreCollectionOfferClientDeleteResponse{}, err } @@ -136,26 +136,26 @@ func (client *PrivateStoreCollectionOfferClient) Delete(ctx context.Context, pri } // deleteCreateRequest creates the Delete request. -func (client *PrivateStoreCollectionOfferClient) deleteCreateRequest(ctx context.Context, privateStoreID string, offerID string, collectionID string, options *PrivateStoreCollectionOfferClientDeleteOptions) (*policy.Request, error) { +func (client *PrivateStoreCollectionOfferClient) deleteCreateRequest(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientDeleteOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/collections/{collectionId}/offers/{offerId}" if privateStoreID == "" { return nil, errors.New("parameter privateStoreID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) - if offerID == "" { - return nil, errors.New("parameter offerID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offerId}", url.PathEscape(offerID)) if collectionID == "" { return nil, errors.New("parameter collectionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{collectionId}", url.PathEscape(collectionID)) + if offerID == "" { + return nil, errors.New("parameter offerID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{offerId}", url.PathEscape(offerID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -163,14 +163,14 @@ func (client *PrivateStoreCollectionOfferClient) deleteCreateRequest(ctx context // Get - Gets information about a specific offer. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID -// offerID - The offer ID to update or delete // collectionID - The collection ID +// offerID - The offer ID to update or delete // options - PrivateStoreCollectionOfferClientGetOptions contains the optional parameters for the PrivateStoreCollectionOfferClient.Get // method. -func (client *PrivateStoreCollectionOfferClient) Get(ctx context.Context, privateStoreID string, offerID string, collectionID string, options *PrivateStoreCollectionOfferClientGetOptions) (PrivateStoreCollectionOfferClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, privateStoreID, offerID, collectionID, options) +func (client *PrivateStoreCollectionOfferClient) Get(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientGetOptions) (PrivateStoreCollectionOfferClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, privateStoreID, collectionID, offerID, options) if err != nil { return PrivateStoreCollectionOfferClientGetResponse{}, err } @@ -185,26 +185,26 @@ func (client *PrivateStoreCollectionOfferClient) Get(ctx context.Context, privat } // getCreateRequest creates the Get request. -func (client *PrivateStoreCollectionOfferClient) getCreateRequest(ctx context.Context, privateStoreID string, offerID string, collectionID string, options *PrivateStoreCollectionOfferClientGetOptions) (*policy.Request, error) { +func (client *PrivateStoreCollectionOfferClient) getCreateRequest(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientGetOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/collections/{collectionId}/offers/{offerId}" if privateStoreID == "" { return nil, errors.New("parameter privateStoreID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) - if offerID == "" { - return nil, errors.New("parameter offerID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offerId}", url.PathEscape(offerID)) if collectionID == "" { return nil, errors.New("parameter collectionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{collectionId}", url.PathEscape(collectionID)) + if offerID == "" { + return nil, errors.New("parameter offerID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{offerId}", url.PathEscape(offerID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,7 +221,7 @@ func (client *PrivateStoreCollectionOfferClient) getHandleResponse(resp *http.Re // NewListPager - Get a list of all private offers in the given private store and collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID // collectionID - The collection ID // options - PrivateStoreCollectionOfferClientListOptions contains the optional parameters for the PrivateStoreCollectionOfferClient.List @@ -270,7 +270,7 @@ func (client *PrivateStoreCollectionOfferClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,14 +287,14 @@ func (client *PrivateStoreCollectionOfferClient) listHandleResponse(resp *http.R // Post - Delete Private store offer. This is a workaround. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2022-03-01 // privateStoreID - The store ID - must use the tenant ID -// offerID - The offer ID to update or delete // collectionID - The collection ID +// offerID - The offer ID to update or delete // options - PrivateStoreCollectionOfferClientPostOptions contains the optional parameters for the PrivateStoreCollectionOfferClient.Post // method. -func (client *PrivateStoreCollectionOfferClient) Post(ctx context.Context, privateStoreID string, offerID string, collectionID string, options *PrivateStoreCollectionOfferClientPostOptions) (PrivateStoreCollectionOfferClientPostResponse, error) { - req, err := client.postCreateRequest(ctx, privateStoreID, offerID, collectionID, options) +func (client *PrivateStoreCollectionOfferClient) Post(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientPostOptions) (PrivateStoreCollectionOfferClientPostResponse, error) { + req, err := client.postCreateRequest(ctx, privateStoreID, collectionID, offerID, options) if err != nil { return PrivateStoreCollectionOfferClientPostResponse{}, err } @@ -309,26 +309,78 @@ func (client *PrivateStoreCollectionOfferClient) Post(ctx context.Context, priva } // postCreateRequest creates the Post request. -func (client *PrivateStoreCollectionOfferClient) postCreateRequest(ctx context.Context, privateStoreID string, offerID string, collectionID string, options *PrivateStoreCollectionOfferClientPostOptions) (*policy.Request, error) { +func (client *PrivateStoreCollectionOfferClient) postCreateRequest(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientPostOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/collections/{collectionId}/offers/{offerId}" if privateStoreID == "" { return nil, errors.New("parameter privateStoreID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) + if collectionID == "" { + return nil, errors.New("parameter collectionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{collectionId}", url.PathEscape(collectionID)) if offerID == "" { return nil, errors.New("parameter offerID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{offerId}", url.PathEscape(offerID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, 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"} + if options != nil && options.Payload != nil { + return req, runtime.MarshalAsJSON(req, *options.Payload) + } + return req, nil +} + +// UpsertOfferWithMultiContext - Upsert an offer with multiple context details. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-01 +// privateStoreID - The store ID - must use the tenant ID +// collectionID - The collection ID +// offerID - The offer ID to update or delete +// options - PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextOptions contains the optional parameters for the +// PrivateStoreCollectionOfferClient.UpsertOfferWithMultiContext method. +func (client *PrivateStoreCollectionOfferClient) UpsertOfferWithMultiContext(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextOptions) (PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse, error) { + req, err := client.upsertOfferWithMultiContextCreateRequest(ctx, privateStoreID, collectionID, offerID, options) + if err != nil { + return PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse{}, runtime.NewResponseError(resp) + } + return client.upsertOfferWithMultiContextHandleResponse(resp) +} + +// upsertOfferWithMultiContextCreateRequest creates the UpsertOfferWithMultiContext request. +func (client *PrivateStoreCollectionOfferClient) upsertOfferWithMultiContextCreateRequest(ctx context.Context, privateStoreID string, collectionID string, offerID string, options *PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Marketplace/privateStores/{privateStoreId}/collections/{collectionId}/offers/{offerId}/upsertOfferWithMultiContext" + if privateStoreID == "" { + return nil, errors.New("parameter privateStoreID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateStoreId}", url.PathEscape(privateStoreID)) if collectionID == "" { return nil, errors.New("parameter collectionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{collectionId}", url.PathEscape(collectionID)) + if offerID == "" { + return nil, errors.New("parameter offerID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{offerId}", url.PathEscape(offerID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2022-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Payload != nil { @@ -336,3 +388,12 @@ func (client *PrivateStoreCollectionOfferClient) postCreateRequest(ctx context.C } return req, nil } + +// upsertOfferWithMultiContextHandleResponse handles the UpsertOfferWithMultiContext response. +func (client *PrivateStoreCollectionOfferClient) upsertOfferWithMultiContextHandleResponse(resp *http.Response) (PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse, error) { + result := PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Offer); err != nil { + return PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_response_types.go b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_response_types.go index 41572b435f09..74b01d5c0a4d 100644 --- a/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_response_types.go +++ b/sdk/resourcemanager/marketplace/armmarketplace/zz_generated_response_types.go @@ -23,6 +23,11 @@ type PrivateStoreClientAdminRequestApprovalsListResponse struct { AdminRequestApprovalsList } +// PrivateStoreClientAnyExistingOffersInTheCollectionsResponse contains the response from method PrivateStoreClient.AnyExistingOffersInTheCollections. +type PrivateStoreClientAnyExistingOffersInTheCollectionsResponse struct { + AnyExistingOffersInTheCollectionsResponse +} + // PrivateStoreClientBillingAccountsResponse contains the response from method PrivateStoreClient.BillingAccounts. type PrivateStoreClientBillingAccountsResponse struct { BillingAccountsResponse @@ -118,6 +123,11 @@ type PrivateStoreClientQueryRequestApprovalResponse struct { QueryRequestApproval } +// PrivateStoreClientQueryUserOffersResponse contains the response from method PrivateStoreClient.QueryUserOffers. +type PrivateStoreClientQueryUserOffersResponse struct { + QueryOffers +} + // PrivateStoreClientUpdateAdminRequestApprovalResponse contains the response from method PrivateStoreClient.UpdateAdminRequestApproval. type PrivateStoreClientUpdateAdminRequestApprovalResponse struct { AdminRequestApprovalsResource @@ -128,6 +138,11 @@ type PrivateStoreClientWithdrawPlanResponse struct { // placeholder for future response values } +// PrivateStoreCollectionClientApproveAllItemsResponse contains the response from method PrivateStoreCollectionClient.ApproveAllItems. +type PrivateStoreCollectionClientApproveAllItemsResponse struct { + Collection +} + // PrivateStoreCollectionClientCreateOrUpdateResponse contains the response from method PrivateStoreCollectionClient.CreateOrUpdate. type PrivateStoreCollectionClientCreateOrUpdateResponse struct { Collection @@ -138,6 +153,11 @@ type PrivateStoreCollectionClientDeleteResponse struct { // placeholder for future response values } +// PrivateStoreCollectionClientDisableApproveAllItemsResponse contains the response from method PrivateStoreCollectionClient.DisableApproveAllItems. +type PrivateStoreCollectionClientDisableApproveAllItemsResponse struct { + Collection +} + // PrivateStoreCollectionClientGetResponse contains the response from method PrivateStoreCollectionClient.Get. type PrivateStoreCollectionClientGetResponse struct { Collection @@ -182,3 +202,8 @@ type PrivateStoreCollectionOfferClientListResponse struct { type PrivateStoreCollectionOfferClientPostResponse struct { // placeholder for future response values } + +// PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse contains the response from method PrivateStoreCollectionOfferClient.UpsertOfferWithMultiContext. +type PrivateStoreCollectionOfferClientUpsertOfferWithMultiContextResponse struct { + Offer +}