diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/CHANGELOG.md b/sdk/resourcemanager/connectedcache/armconnectedcache/CHANGELOG.md index 04b0ce1c62da..63ca1dc6766b 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/CHANGELOG.md +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 0.1.1 (2025-05-13) +### Other Changes + + ## 0.1.0 (2024-11-20) ### Other Changes diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/constants.go b/sdk/resourcemanager/connectedcache/armconnectedcache/constants.go index 9a67cde6c50a..d82fb049fd35 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/constants.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/constants.go @@ -6,7 +6,7 @@ package armconnectedcache const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/connectedcache/armconnectedcache" - moduleVersion = "v0.1.0" + moduleVersion = "v0.1.1" ) // ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/enterprisemcccustomers_client_example_test.go b/sdk/resourcemanager/connectedcache/armconnectedcache/enterprisemcccustomers_client_example_test.go index ce3c3099eabc..52a0e8de92a7 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/enterprisemcccustomers_client_example_test.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/enterprisemcccustomers_client_example_test.go @@ -44,6 +44,7 @@ func ExampleEnterpriseMccCustomersClient_BeginCreateOrUpdate() { AdditionalCustomerProperties: &armconnectedcache.AdditionalCustomerProperties{ CustomerEmail: to.Ptr("zdjgibsidydyzm"), CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), CustomerEntitlementSKUID: to.Ptr("b"), CustomerEntitlementSKUGUID: to.Ptr("rvzmdpxyflgqetvpwupnfaxsweiiz"), @@ -115,6 +116,7 @@ func ExampleEnterpriseMccCustomersClient_BeginCreateOrUpdate() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -239,6 +241,7 @@ func ExampleEnterpriseMccCustomersClient_Get() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -348,6 +351,7 @@ func ExampleEnterpriseMccCustomersClient_NewListByResourceGroupPager() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -461,6 +465,7 @@ func ExampleEnterpriseMccCustomersClient_NewListBySubscriptionPager() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -576,6 +581,7 @@ func ExampleEnterpriseMccCustomersClient_Update() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/cachenodesoperations_server.go b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/cachenodesoperations_server.go index d85abb59b355..77002d442f51 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/cachenodesoperations_server.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/cachenodesoperations_server.go @@ -129,7 +129,7 @@ func (c *CacheNodesOperationsServerTransport) dispatchBeginCreateorUpdate(req *h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/cacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.CacheNodePreviewResource](req) @@ -175,7 +175,7 @@ func (c *CacheNodesOperationsServerTransport) dispatchDelete(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/cacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -208,7 +208,7 @@ func (c *CacheNodesOperationsServerTransport) dispatchGet(req *http.Request) (*h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/cacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -243,7 +243,7 @@ func (c *CacheNodesOperationsServerTransport) dispatchNewListByResourceGroupPage const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/cacheNodes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -280,7 +280,7 @@ func (c *CacheNodesOperationsServerTransport) dispatchNewListBySubscriptionPager const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/cacheNodes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := c.srv.NewListBySubscriptionPager(nil) @@ -311,7 +311,7 @@ func (c *CacheNodesOperationsServerTransport) dispatchUpdate(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/cacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.PatchResource](req) diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisecustomeroperations_server.go b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisecustomeroperations_server.go index e7955086b130..2a06a5109019 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisecustomeroperations_server.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisecustomeroperations_server.go @@ -129,7 +129,7 @@ func (e *EnterpriseCustomerOperationsServerTransport) dispatchBeginCreateOrUpdat const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.EnterprisePreviewResource](req) @@ -175,7 +175,7 @@ func (e *EnterpriseCustomerOperationsServerTransport) dispatchDelete(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -208,7 +208,7 @@ func (e *EnterpriseCustomerOperationsServerTransport) dispatchGet(req *http.Requ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -243,7 +243,7 @@ func (e *EnterpriseCustomerOperationsServerTransport) dispatchNewListByResourceG const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseCustomers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -280,7 +280,7 @@ func (e *EnterpriseCustomerOperationsServerTransport) dispatchNewListBySubscript const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseCustomers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := e.srv.NewListBySubscriptionPager(nil) @@ -311,7 +311,7 @@ func (e *EnterpriseCustomerOperationsServerTransport) dispatchUpdate(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.PatchResource](req) diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisemcccachenodesoperations_server.go b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisemcccachenodesoperations_server.go index d4e726786935..2b86602cb8ec 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisemcccachenodesoperations_server.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisemcccachenodesoperations_server.go @@ -129,7 +129,7 @@ func (e *EnterpriseMccCacheNodesOperationsServerTransport) dispatchBeginCreateOr const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enterpriseMccCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.EnterpriseMccCacheNodeResource](req) @@ -181,7 +181,7 @@ func (e *EnterpriseMccCacheNodesOperationsServerTransport) dispatchBeginDelete(r const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enterpriseMccCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -227,7 +227,7 @@ func (e *EnterpriseMccCacheNodesOperationsServerTransport) dispatchGet(req *http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enterpriseMccCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -264,7 +264,7 @@ func (e *EnterpriseMccCacheNodesOperationsServerTransport) dispatchGetCacheNodeI const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enterpriseMccCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getCacheNodeInstallDetails` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -303,7 +303,7 @@ func (e *EnterpriseMccCacheNodesOperationsServerTransport) dispatchNewListByEnte const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enterpriseMccCacheNodes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -342,7 +342,7 @@ func (e *EnterpriseMccCacheNodesOperationsServerTransport) dispatchUpdate(req *h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enterpriseMccCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.PatchResource](req) diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisemcccustomers_server.go b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisemcccustomers_server.go index ca8d452a5a75..00ac241125b1 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisemcccustomers_server.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/enterprisemcccustomers_server.go @@ -131,7 +131,7 @@ func (e *EnterpriseMccCustomersServerTransport) dispatchBeginCreateOrUpdate(req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.EnterpriseMccCustomerResource](req) @@ -179,7 +179,7 @@ func (e *EnterpriseMccCustomersServerTransport) dispatchBeginDelete(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -221,7 +221,7 @@ func (e *EnterpriseMccCustomersServerTransport) dispatchGet(req *http.Request) ( const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -256,7 +256,7 @@ func (e *EnterpriseMccCustomersServerTransport) dispatchNewListByResourceGroupPa const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -293,7 +293,7 @@ func (e *EnterpriseMccCustomersServerTransport) dispatchNewListBySubscriptionPag const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := e.srv.NewListBySubscriptionPager(nil) @@ -324,7 +324,7 @@ func (e *EnterpriseMccCustomersServerTransport) dispatchUpdate(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/enterpriseMccCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.PatchResource](req) diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/ispcachenodesoperations_server.go b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/ispcachenodesoperations_server.go index 61d62032ad5d..a9c6df8fb4cd 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/ispcachenodesoperations_server.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/ispcachenodesoperations_server.go @@ -135,7 +135,7 @@ func (i *IspCacheNodesOperationsServerTransport) dispatchBeginCreateOrUpdate(req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ispCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.IspCacheNodeResource](req) @@ -187,7 +187,7 @@ func (i *IspCacheNodesOperationsServerTransport) dispatchBeginDelete(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ispCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -233,7 +233,7 @@ func (i *IspCacheNodesOperationsServerTransport) dispatchGet(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ispCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -270,7 +270,7 @@ func (i *IspCacheNodesOperationsServerTransport) dispatchGetBgpCidrs(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ispCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getBgpCidrs` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -307,7 +307,7 @@ func (i *IspCacheNodesOperationsServerTransport) dispatchGetCacheNodeInstallDeta const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ispCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getCacheNodeInstallDetails` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -346,7 +346,7 @@ func (i *IspCacheNodesOperationsServerTransport) dispatchNewListByIspCustomerRes const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ispCacheNodes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -385,7 +385,7 @@ func (i *IspCacheNodesOperationsServerTransport) dispatchUpdate(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/ispCacheNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.PatchResource](req) diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/ispcustomers_server.go b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/ispcustomers_server.go index 1fb980a4bd60..3f7b9b9e5375 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/ispcustomers_server.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/ispcustomers_server.go @@ -131,7 +131,7 @@ func (i *IspCustomersServerTransport) dispatchBeginCreateOrUpdate(req *http.Requ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.IspCustomerResource](req) @@ -179,7 +179,7 @@ func (i *IspCustomersServerTransport) dispatchBeginDelete(req *http.Request) (*h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -221,7 +221,7 @@ func (i *IspCustomersServerTransport) dispatchGet(req *http.Request) (*http.Resp const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -256,7 +256,7 @@ func (i *IspCustomersServerTransport) dispatchNewListByResourceGroupPager(req *h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -293,7 +293,7 @@ func (i *IspCustomersServerTransport) dispatchNewListBySubscriptionPager(req *ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := i.srv.NewListBySubscriptionPager(nil) @@ -324,7 +324,7 @@ func (i *IspCustomersServerTransport) dispatchUpdate(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ConnectedCache/ispCustomers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armconnectedcache.PatchResource](req) diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/time_rfc3339.go b/sdk/resourcemanager/connectedcache/armconnectedcache/fake/time_rfc3339.go deleted file mode 100644 index 87ee11e83b32..000000000000 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/fake/time_rfc3339.go +++ /dev/null @@ -1,109 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/ispcustomers_client_example_test.go b/sdk/resourcemanager/connectedcache/armconnectedcache/ispcustomers_client_example_test.go index f03849689aa1..f713d6936e10 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/ispcustomers_client_example_test.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/ispcustomers_client_example_test.go @@ -45,6 +45,7 @@ func ExampleIspCustomersClient_BeginCreateOrUpdate() { AdditionalCustomerProperties: &armconnectedcache.AdditionalCustomerProperties{ CustomerEmail: to.Ptr("zdjgibsidydyzm"), CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), CustomerEntitlementSKUID: to.Ptr("b"), CustomerEntitlementSKUGUID: to.Ptr("rvzmdpxyflgqetvpwupnfaxsweiiz"), @@ -119,6 +120,7 @@ func ExampleIspCustomersClient_BeginCreateOrUpdate() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -242,6 +244,7 @@ func ExampleIspCustomersClient_Get() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -351,6 +354,7 @@ func ExampleIspCustomersClient_NewListByResourceGroupPager() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -432,6 +436,7 @@ func ExampleIspCustomersClient_NewListByResourceGroupPager() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -545,6 +550,7 @@ func ExampleIspCustomersClient_NewListBySubscriptionPager() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -626,6 +632,7 @@ func ExampleIspCustomersClient_NewListBySubscriptionPager() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), @@ -737,6 +744,7 @@ func ExampleIspCustomersClient_Update() { // CustomerOrgName: to.Ptr("nshrwjhhggmdaqlpc"), // CustomerEmail: to.Ptr("zdjgibsidydyzm"), // CustomerTransitAsn: to.Ptr("habgklnxqzmozqpazoyejwiphezpi"), + // CustomerTransitState: to.Ptr(armconnectedcache.CustomerTransitState("voblixkxfejbmhxilb")), // CustomerAsn: to.Ptr("hgrelgnrtdkleisnepfolu"), // CustomerAsnEstimatedEgressPeekGbps: to.Ptr[float32](10), // CustomerEntitlementSKUID: to.Ptr("b"), diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/models.go b/sdk/resourcemanager/connectedcache/armconnectedcache/models.go index 0809ee407c17..6a7ff2e3138e 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/models.go +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/models.go @@ -813,14 +813,16 @@ type MccCacheNodeInstallDetails struct { Type *string } -// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +// Operation - REST API Operation +// +// Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { - // Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType - - // READ-ONLY; Localized display information for this particular operation. + // Localized display information for this particular operation. Display *OperationDisplay + // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure // Resource Manager/control-plane operations. IsDataAction *bool diff --git a/sdk/resourcemanager/connectedcache/armconnectedcache/tsp-location.yaml b/sdk/resourcemanager/connectedcache/armconnectedcache/tsp-location.yaml index 1ebce821159f..b9e6e911a033 100644 --- a/sdk/resourcemanager/connectedcache/armconnectedcache/tsp-location.yaml +++ b/sdk/resourcemanager/connectedcache/armconnectedcache/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/connectedcache/ConnectedCache.Management -commit: d477c7caa09bf82e22c419be0a99d170552b5892 +commit: b9a8c9e8eb8998a222f126a005d1ab633f1daad9 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/resourcemanager/fabric/armfabric/CHANGELOG.md b/sdk/resourcemanager/fabric/armfabric/CHANGELOG.md index ca9847d062ac..a8c3881b656f 100644 --- a/sdk/resourcemanager/fabric/armfabric/CHANGELOG.md +++ b/sdk/resourcemanager/fabric/armfabric/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History +## 1.1.0-beta.1 (2025-05-13) +### Features Added + +- New function `*CapacitiesClient.NewListUsagesPager(string, *CapacitiesClientListUsagesOptions) *runtime.Pager[CapacitiesClientListUsagesResponse]` +- New struct `PagedQuota` +- New struct `Quota` +- New struct `QuotaName` + + ## 1.0.0 (2024-10-22) ### Other Changes diff --git a/sdk/resourcemanager/fabric/armfabric/capacities_client.go b/sdk/resourcemanager/fabric/armfabric/capacities_client.go index 53232ffbf5ad..458c3985e5c5 100644 --- a/sdk/resourcemanager/fabric/armfabric/capacities_client.go +++ b/sdk/resourcemanager/fabric/armfabric/capacities_client.go @@ -42,8 +42,8 @@ func NewCapacitiesClient(subscriptionID string, credential azcore.TokenCredentia // CheckNameAvailability - Implements local CheckNameAvailability operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 -// - location - The location name. +// Generated from API version 2025-01-15-preview +// - location - The name of the Azure region. // - body - The CheckAvailability request // - options - CapacitiesClientCheckNameAvailabilityOptions contains the optional parameters for the CapacitiesClient.CheckNameAvailability // method. @@ -85,7 +85,7 @@ func (client *CapacitiesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -107,7 +107,7 @@ func (client *CapacitiesClient) checkNameAvailabilityHandleResponse(resp *http.R // BeginCreateOrUpdate - Create a FabricCapacity // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - capacityName - The name of the Microsoft Fabric capacity. It must be a minimum of 3 characters, and a maximum of 63. // - resource - Resource create parameters. @@ -133,7 +133,7 @@ func (client *CapacitiesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create a FabricCapacity // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview func (client *CapacitiesClient) createOrUpdate(ctx context.Context, resourceGroupName string, capacityName string, resource Capacity, options *CapacitiesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CapacitiesClient.BeginCreateOrUpdate" @@ -175,7 +175,7 @@ func (client *CapacitiesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} @@ -188,7 +188,7 @@ func (client *CapacitiesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete a FabricCapacity // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - capacityName - The name of the Microsoft Fabric capacity. It must be a minimum of 3 characters, and a maximum of 63. // - options - CapacitiesClientBeginDeleteOptions contains the optional parameters for the CapacitiesClient.BeginDelete method. @@ -212,7 +212,7 @@ func (client *CapacitiesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete a FabricCapacity // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview func (client *CapacitiesClient) deleteOperation(ctx context.Context, resourceGroupName string, capacityName string, options *CapacitiesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CapacitiesClient.BeginDelete" @@ -254,7 +254,7 @@ func (client *CapacitiesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *CapacitiesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get a FabricCapacity // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - capacityName - The name of the Microsoft Fabric capacity. It must be a minimum of 3 characters, and a maximum of 63. // - options - CapacitiesClientGetOptions contains the optional parameters for the CapacitiesClient.Get method. @@ -309,7 +309,7 @@ func (client *CapacitiesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +326,7 @@ func (client *CapacitiesClient) getHandleResponse(resp *http.Response) (Capaciti // NewListByResourceGroupPager - List FabricCapacity resources by resource group // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CapacitiesClientListByResourceGroupOptions contains the optional parameters for the CapacitiesClient.NewListByResourceGroupPager // method. @@ -369,7 +369,7 @@ func (client *CapacitiesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,7 @@ func (client *CapacitiesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List FabricCapacity resources by subscription ID // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - options - CapacitiesClientListBySubscriptionOptions contains the optional parameters for the CapacitiesClient.NewListBySubscriptionPager // method. func (client *CapacitiesClient) NewListBySubscriptionPager(options *CapacitiesClientListBySubscriptionOptions) *runtime.Pager[CapacitiesClientListBySubscriptionResponse] { @@ -424,7 +424,7 @@ func (client *CapacitiesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -441,7 +441,7 @@ func (client *CapacitiesClient) listBySubscriptionHandleResponse(resp *http.Resp // NewListSKUsPager - List eligible SKUs for Microsoft Fabric resource provider // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - options - CapacitiesClientListSKUsOptions contains the optional parameters for the CapacitiesClient.NewListSKUsPager method. func (client *CapacitiesClient) NewListSKUsPager(options *CapacitiesClientListSKUsOptions) *runtime.Pager[CapacitiesClientListSKUsResponse] { return runtime.NewPager(runtime.PagingHandler[CapacitiesClientListSKUsResponse]{ @@ -478,7 +478,7 @@ func (client *CapacitiesClient) listSKUsCreateRequest(ctx context.Context, _ *Ca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -495,7 +495,7 @@ func (client *CapacitiesClient) listSKUsHandleResponse(resp *http.Response) (Cap // NewListSKUsForCapacityPager - List eligible SKUs for a Microsoft Fabric resource // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - capacityName - The name of the capacity. // - options - CapacitiesClientListSKUsForCapacityOptions contains the optional parameters for the CapacitiesClient.NewListSKUsForCapacityPager @@ -543,7 +543,7 @@ func (client *CapacitiesClient) listSKUsForCapacityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -558,10 +558,70 @@ func (client *CapacitiesClient) listSKUsForCapacityHandleResponse(resp *http.Res return result, nil } +// NewListUsagesPager - List the current consumption and limit in this location for the provided subscription +// +// Generated from API version 2025-01-15-preview +// - location - The location name. +// - options - CapacitiesClientListUsagesOptions contains the optional parameters for the CapacitiesClient.NewListUsagesPager +// method. +func (client *CapacitiesClient) NewListUsagesPager(location string, options *CapacitiesClientListUsagesOptions) *runtime.Pager[CapacitiesClientListUsagesResponse] { + return runtime.NewPager(runtime.PagingHandler[CapacitiesClientListUsagesResponse]{ + More: func(page CapacitiesClientListUsagesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CapacitiesClientListUsagesResponse) (CapacitiesClientListUsagesResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacitiesClient.NewListUsagesPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listUsagesCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return CapacitiesClientListUsagesResponse{}, err + } + return client.listUsagesHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listUsagesCreateRequest creates the ListUsages request. +func (client *CapacitiesClient) listUsagesCreateRequest(ctx context.Context, location string, _ *CapacitiesClientListUsagesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Fabric/locations/{location}/usages" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listUsagesHandleResponse handles the ListUsages response. +func (client *CapacitiesClient) listUsagesHandleResponse(resp *http.Response) (CapacitiesClientListUsagesResponse, error) { + result := CapacitiesClientListUsagesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PagedQuota); err != nil { + return CapacitiesClientListUsagesResponse{}, err + } + return result, nil +} + // BeginResume - Resume operation of the specified Fabric capacity instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - capacityName - The name of the Microsoft Fabric capacity. It must be a minimum of 3 characters, and a maximum of 63. // - options - CapacitiesClientBeginResumeOptions contains the optional parameters for the CapacitiesClient.BeginResume method. @@ -585,7 +645,7 @@ func (client *CapacitiesClient) BeginResume(ctx context.Context, resourceGroupNa // Resume - Resume operation of the specified Fabric capacity instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview func (client *CapacitiesClient) resume(ctx context.Context, resourceGroupName string, capacityName string, options *CapacitiesClientBeginResumeOptions) (*http.Response, error) { var err error const operationName = "CapacitiesClient.BeginResume" @@ -627,7 +687,7 @@ func (client *CapacitiesClient) resumeCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -636,7 +696,7 @@ func (client *CapacitiesClient) resumeCreateRequest(ctx context.Context, resourc // BeginSuspend - Suspend operation of the specified Fabric capacity instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - capacityName - The name of the Microsoft Fabric capacity. It must be a minimum of 3 characters, and a maximum of 63. // - options - CapacitiesClientBeginSuspendOptions contains the optional parameters for the CapacitiesClient.BeginSuspend method. @@ -660,7 +720,7 @@ func (client *CapacitiesClient) BeginSuspend(ctx context.Context, resourceGroupN // Suspend - Suspend operation of the specified Fabric capacity instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview func (client *CapacitiesClient) suspend(ctx context.Context, resourceGroupName string, capacityName string, options *CapacitiesClientBeginSuspendOptions) (*http.Response, error) { var err error const operationName = "CapacitiesClient.BeginSuspend" @@ -702,7 +762,7 @@ func (client *CapacitiesClient) suspendCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -711,7 +771,7 @@ func (client *CapacitiesClient) suspendCreateRequest(ctx context.Context, resour // BeginUpdate - Update a FabricCapacity // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - capacityName - The name of the Microsoft Fabric capacity. It must be a minimum of 3 characters, and a maximum of 63. // - properties - The resource properties to be updated. @@ -736,7 +796,7 @@ func (client *CapacitiesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Update a FabricCapacity // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview func (client *CapacitiesClient) update(ctx context.Context, resourceGroupName string, capacityName string, properties CapacityUpdate, options *CapacitiesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CapacitiesClient.BeginUpdate" @@ -778,7 +838,7 @@ func (client *CapacitiesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} diff --git a/sdk/resourcemanager/fabric/armfabric/capacities_client_example_test.go b/sdk/resourcemanager/fabric/armfabric/capacities_client_example_test.go index 58b8beee0c84..3ca525439d01 100644 --- a/sdk/resourcemanager/fabric/armfabric/capacities_client_example_test.go +++ b/sdk/resourcemanager/fabric/armfabric/capacities_client_example_test.go @@ -12,7 +12,7 @@ import ( "log" ) -// Generated from example definition: 2023-11-01/FabricCapacities_CheckNameAvailability.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_CheckNameAvailability.json func ExampleCapacitiesClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleCapacitiesClient_CheckNameAvailability() { // } } -// Generated from example definition: 2023-11-01/FabricCapacities_CreateOrUpdate.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_CreateOrUpdate.json func ExampleCapacitiesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleCapacitiesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: 2023-11-01/FabricCapacities_Delete.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_Delete.json func ExampleCapacitiesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -124,7 +124,7 @@ func ExampleCapacitiesClient_BeginDelete() { } } -// Generated from example definition: 2023-11-01/FabricCapacities_Get.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_Get.json func ExampleCapacitiesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -168,7 +168,7 @@ func ExampleCapacitiesClient_Get() { // } } -// Generated from example definition: 2023-11-01/FabricCapacities_ListByResourceGroup.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_ListByResourceGroup.json func ExampleCapacitiesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -242,7 +242,7 @@ func ExampleCapacitiesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: 2023-11-01/FabricCapacities_ListBySubscription.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_ListBySubscription.json func ExampleCapacitiesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -316,7 +316,7 @@ func ExampleCapacitiesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: 2023-11-01/FabricCapacities_ListSkus.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_ListSkus.json func ExampleCapacitiesClient_NewListSKUsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -375,7 +375,7 @@ func ExampleCapacitiesClient_NewListSKUsPager() { } } -// Generated from example definition: 2023-11-01/FabricCapacities_ListSkusForCapacity.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_ListSkusForCapacity.json func ExampleCapacitiesClient_NewListSKUsForCapacityPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -483,7 +483,47 @@ func ExampleCapacitiesClient_NewListSKUsForCapacityPager() { } } -// Generated from example definition: 2023-11-01/FabricCapacities_Resume.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_ListUsagesBySubscription.json +func ExampleCapacitiesClient_NewListUsagesPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armfabric.NewClientFactory("548B7FB7-3B2A-4F46-BB02-66473F1FC22C", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewCapacitiesClient().NewListUsagesPager("centraluseuap", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armfabric.CapacitiesClientListUsagesResponse{ + // PagedQuota: armfabric.PagedQuota{ + // Value: []*armfabric.Quota{ + // { + // Name: &armfabric.QuotaName{ + // Value: to.Ptr("CapacityQuota"), + // LocalizedValue: to.Ptr("CapacityQuota"), + // }, + // Unit: to.Ptr("CU"), + // CurrentValue: to.Ptr[int64](378), + // Limit: to.Ptr[int64](512), + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-01-15-preview/FabricCapacities_Resume.json func ExampleCapacitiesClient_BeginResume() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -509,7 +549,7 @@ func ExampleCapacitiesClient_BeginResume() { // } } -// Generated from example definition: 2023-11-01/FabricCapacities_Suspend.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_Suspend.json func ExampleCapacitiesClient_BeginSuspend() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -535,7 +575,7 @@ func ExampleCapacitiesClient_BeginSuspend() { // } } -// Generated from example definition: 2023-11-01/FabricCapacities_Update.json +// Generated from example definition: 2025-01-15-preview/FabricCapacities_Update.json func ExampleCapacitiesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/fabric/armfabric/constants.go b/sdk/resourcemanager/fabric/armfabric/constants.go index c6bf0e2ecc4f..52addf8cfeaa 100644 --- a/sdk/resourcemanager/fabric/armfabric/constants.go +++ b/sdk/resourcemanager/fabric/armfabric/constants.go @@ -6,7 +6,7 @@ package armfabric const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/fabric/armfabric" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) // ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/fabric/armfabric/fake/capacities_server.go b/sdk/resourcemanager/fabric/armfabric/fake/capacities_server.go index e9598083e361..1910e2d7babb 100644 --- a/sdk/resourcemanager/fabric/armfabric/fake/capacities_server.go +++ b/sdk/resourcemanager/fabric/armfabric/fake/capacities_server.go @@ -29,7 +29,7 @@ type CapacitiesServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, capacityName string, resource armfabric.Capacity, options *armfabric.CapacitiesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armfabric.CapacitiesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method CapacitiesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, capacityName string, options *armfabric.CapacitiesClientBeginDeleteOptions) (resp azfake.PollerResponder[armfabric.CapacitiesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method CapacitiesClient.Get @@ -52,12 +52,16 @@ type CapacitiesServer struct { // HTTP status codes to indicate success: http.StatusOK NewListSKUsForCapacityPager func(resourceGroupName string, capacityName string, options *armfabric.CapacitiesClientListSKUsForCapacityOptions) (resp azfake.PagerResponder[armfabric.CapacitiesClientListSKUsForCapacityResponse]) + // NewListUsagesPager is the fake for method CapacitiesClient.NewListUsagesPager + // HTTP status codes to indicate success: http.StatusOK + NewListUsagesPager func(location string, options *armfabric.CapacitiesClientListUsagesOptions) (resp azfake.PagerResponder[armfabric.CapacitiesClientListUsagesResponse]) + // BeginResume is the fake for method CapacitiesClient.BeginResume - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResume func(ctx context.Context, resourceGroupName string, capacityName string, options *armfabric.CapacitiesClientBeginResumeOptions) (resp azfake.PollerResponder[armfabric.CapacitiesClientResumeResponse], errResp azfake.ErrorResponder) // BeginSuspend is the fake for method CapacitiesClient.BeginSuspend - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginSuspend func(ctx context.Context, resourceGroupName string, capacityName string, options *armfabric.CapacitiesClientBeginSuspendOptions) (resp azfake.PollerResponder[armfabric.CapacitiesClientSuspendResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method CapacitiesClient.BeginUpdate @@ -77,6 +81,7 @@ func NewCapacitiesServerTransport(srv *CapacitiesServer) *CapacitiesServerTransp newListBySubscriptionPager: newTracker[azfake.PagerResponder[armfabric.CapacitiesClientListBySubscriptionResponse]](), newListSKUsPager: newTracker[azfake.PagerResponder[armfabric.CapacitiesClientListSKUsResponse]](), newListSKUsForCapacityPager: newTracker[azfake.PagerResponder[armfabric.CapacitiesClientListSKUsForCapacityResponse]](), + newListUsagesPager: newTracker[azfake.PagerResponder[armfabric.CapacitiesClientListUsagesResponse]](), beginResume: newTracker[azfake.PollerResponder[armfabric.CapacitiesClientResumeResponse]](), beginSuspend: newTracker[azfake.PollerResponder[armfabric.CapacitiesClientSuspendResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armfabric.CapacitiesClientUpdateResponse]](), @@ -93,6 +98,7 @@ type CapacitiesServerTransport struct { newListBySubscriptionPager *tracker[azfake.PagerResponder[armfabric.CapacitiesClientListBySubscriptionResponse]] newListSKUsPager *tracker[azfake.PagerResponder[armfabric.CapacitiesClientListSKUsResponse]] newListSKUsForCapacityPager *tracker[azfake.PagerResponder[armfabric.CapacitiesClientListSKUsForCapacityResponse]] + newListUsagesPager *tracker[azfake.PagerResponder[armfabric.CapacitiesClientListUsagesResponse]] beginResume *tracker[azfake.PollerResponder[armfabric.CapacitiesClientResumeResponse]] beginSuspend *tracker[azfake.PollerResponder[armfabric.CapacitiesClientSuspendResponse]] beginUpdate *tracker[azfake.PollerResponder[armfabric.CapacitiesClientUpdateResponse]] @@ -110,37 +116,58 @@ func (c *CapacitiesServerTransport) Do(req *http.Request) (*http.Response, error } func (c *CapacitiesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - var resp *http.Response - var err error - - switch method { - case "CapacitiesClient.CheckNameAvailability": - resp, err = c.dispatchCheckNameAvailability(req) - case "CapacitiesClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "CapacitiesClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "CapacitiesClient.Get": - resp, err = c.dispatchGet(req) - case "CapacitiesClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "CapacitiesClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - case "CapacitiesClient.NewListSKUsPager": - resp, err = c.dispatchNewListSKUsPager(req) - case "CapacitiesClient.NewListSKUsForCapacityPager": - resp, err = c.dispatchNewListSKUsForCapacityPager(req) - case "CapacitiesClient.BeginResume": - resp, err = c.dispatchBeginResume(req) - case "CapacitiesClient.BeginSuspend": - resp, err = c.dispatchBeginSuspend(req) - case "CapacitiesClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - return resp, err + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if capacitiesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = capacitiesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CapacitiesClient.CheckNameAvailability": + res.resp, res.err = c.dispatchCheckNameAvailability(req) + case "CapacitiesClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "CapacitiesClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "CapacitiesClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CapacitiesClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "CapacitiesClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + case "CapacitiesClient.NewListSKUsPager": + res.resp, res.err = c.dispatchNewListSKUsPager(req) + case "CapacitiesClient.NewListSKUsForCapacityPager": + res.resp, res.err = c.dispatchNewListSKUsForCapacityPager(req) + case "CapacitiesClient.NewListUsagesPager": + res.resp, res.err = c.dispatchNewListUsagesPager(req) + case "CapacitiesClient.BeginResume": + res.resp, res.err = c.dispatchBeginResume(req) + case "CapacitiesClient.BeginSuspend": + res.resp, res.err = c.dispatchBeginSuspend(req) + case "CapacitiesClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CapacitiesServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { @@ -150,7 +177,7 @@ func (c *CapacitiesServerTransport) dispatchCheckNameAvailability(req *http.Requ const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkNameAvailability` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armfabric.CheckNameAvailabilityRequest](req) @@ -185,7 +212,7 @@ func (c *CapacitiesServerTransport) dispatchBeginCreateOrUpdate(req *http.Reques const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armfabric.Capacity](req) @@ -233,7 +260,7 @@ func (c *CapacitiesServerTransport) dispatchBeginDelete(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -257,9 +284,9 @@ func (c *CapacitiesServerTransport) dispatchBeginDelete(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { c.beginDelete.remove(req) @@ -275,7 +302,7 @@ func (c *CapacitiesServerTransport) dispatchGet(req *http.Request) (*http.Respon const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -310,7 +337,7 @@ func (c *CapacitiesServerTransport) dispatchNewListByResourceGroupPager(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -347,7 +374,7 @@ func (c *CapacitiesServerTransport) dispatchNewListBySubscriptionPager(req *http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := c.srv.NewListBySubscriptionPager(nil) @@ -380,7 +407,7 @@ func (c *CapacitiesServerTransport) dispatchNewListSKUsPager(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/skus` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := c.srv.NewListSKUsPager(nil) @@ -413,7 +440,7 @@ func (c *CapacitiesServerTransport) dispatchNewListSKUsForCapacityPager(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skus` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -445,6 +472,43 @@ func (c *CapacitiesServerTransport) dispatchNewListSKUsForCapacityPager(req *htt return resp, nil } +func (c *CapacitiesServerTransport) dispatchNewListUsagesPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListUsagesPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListUsagesPager not implemented")} + } + newListUsagesPager := c.newListUsagesPager.get(req) + if newListUsagesPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/usages` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + resp := c.srv.NewListUsagesPager(locationParam, nil) + newListUsagesPager = &resp + c.newListUsagesPager.add(req, newListUsagesPager) + server.PagerResponderInjectNextLinks(newListUsagesPager, req, func(page *armfabric.CapacitiesClientListUsagesResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListUsagesPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListUsagesPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListUsagesPager) { + c.newListUsagesPager.remove(req) + } + return resp, nil +} + func (c *CapacitiesServerTransport) dispatchBeginResume(req *http.Request) (*http.Response, error) { if c.srv.BeginResume == nil { return nil, &nonRetriableError{errors.New("fake for method BeginResume not implemented")} @@ -454,7 +518,7 @@ func (c *CapacitiesServerTransport) dispatchBeginResume(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resume` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -478,9 +542,9 @@ func (c *CapacitiesServerTransport) dispatchBeginResume(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginResume.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResume) { c.beginResume.remove(req) @@ -498,7 +562,7 @@ func (c *CapacitiesServerTransport) dispatchBeginSuspend(req *http.Request) (*ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/suspend` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -522,9 +586,9 @@ func (c *CapacitiesServerTransport) dispatchBeginSuspend(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginSuspend.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginSuspend) { c.beginSuspend.remove(req) @@ -542,7 +606,7 @@ func (c *CapacitiesServerTransport) dispatchBeginUpdate(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Fabric/capacities/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armfabric.CapacityUpdate](req) @@ -580,3 +644,9 @@ func (c *CapacitiesServerTransport) dispatchBeginUpdate(req *http.Request) (*htt return resp, nil } + +// set this to conditionally intercept incoming requests to CapacitiesServerTransport +var capacitiesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/fabric/armfabric/fake/internal.go b/sdk/resourcemanager/fabric/armfabric/fake/internal.go index 56a8f624f5f3..7425b6a669e2 100644 --- a/sdk/resourcemanager/fabric/armfabric/fake/internal.go +++ b/sdk/resourcemanager/fabric/armfabric/fake/internal.go @@ -10,6 +10,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/fabric/armfabric/fake/operations_server.go b/sdk/resourcemanager/fabric/armfabric/fake/operations_server.go index aef0b331c388..b37b6f368961 100644 --- a/sdk/resourcemanager/fabric/armfabric/fake/operations_server.go +++ b/sdk/resourcemanager/fabric/armfabric/fake/operations_server.go @@ -51,17 +51,36 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error } func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - var resp *http.Response - var err error + resultChan := make(chan result) + defer close(resultChan) - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, err + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -90,3 +109,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/fabric/armfabric/fake/time_rfc3339.go b/sdk/resourcemanager/fabric/armfabric/fake/time_rfc3339.go deleted file mode 100644 index 87ee11e83b32..000000000000 --- a/sdk/resourcemanager/fabric/armfabric/fake/time_rfc3339.go +++ /dev/null @@ -1,109 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/fabric/armfabric/models.go b/sdk/resourcemanager/fabric/armfabric/models.go index 618a47a859c2..f629e3d5f6c4 100644 --- a/sdk/resourcemanager/fabric/armfabric/models.go +++ b/sdk/resourcemanager/fabric/armfabric/models.go @@ -100,14 +100,16 @@ type CheckNameAvailabilityResponse struct { Reason *CheckNameAvailabilityReason } -// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +// Operation - REST API Operation +// +// Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { - // Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType - - // READ-ONLY; Localized display information for this particular operation. + // Localized display information for this particular operation. Display *OperationDisplay + // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure // Resource Manager/control-plane operations. IsDataAction *bool @@ -149,6 +151,39 @@ type OperationListResult struct { NextLink *string } +// PagedQuota - Paged collection of Quota items +type PagedQuota struct { + // REQUIRED; The Quota items on this page + Value []*Quota + + // The link to the next page of items + NextLink *string +} + +// Quota - Describes Resource Quota +type Quota struct { + // REQUIRED; The current usage of the resource. + CurrentValue *int64 + + // REQUIRED; The maximum permitted usage of the resource. + Limit *int64 + + // REQUIRED; The unit of usage measurement. + Unit *string + + // READ-ONLY; The name of the quota. + Name *QuotaName +} + +// QuotaName - The Quota Names +type QuotaName struct { + // The localized name of the resource. + LocalizedValue *string + + // The name of the resource. + Value *string +} + // RpSKU - Represents the SKU name and Azure pricing tier for Microsoft Fabric capacity resource. type RpSKU struct { // REQUIRED; The name of the SKU level. diff --git a/sdk/resourcemanager/fabric/armfabric/models_serde.go b/sdk/resourcemanager/fabric/armfabric/models_serde.go index e7c7e1dcb1a5..ebbb34b1b0e2 100644 --- a/sdk/resourcemanager/fabric/armfabric/models_serde.go +++ b/sdk/resourcemanager/fabric/armfabric/models_serde.go @@ -400,6 +400,107 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PagedQuota. +func (p PagedQuota) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PagedQuota. +func (p *PagedQuota) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Quota. +func (q Quota) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", q.CurrentValue) + populate(objectMap, "limit", q.Limit) + populate(objectMap, "name", q.Name) + populate(objectMap, "unit", q.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Quota. +func (q *Quota) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &q.CurrentValue) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &q.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaName. +func (q QuotaName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localizedValue", q.LocalizedValue) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaName. +func (q *QuotaName) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &q.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RpSKU. func (r RpSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/fabric/armfabric/operations_client.go b/sdk/resourcemanager/fabric/armfabric/operations_client.go index 8b8c355efd2a..7e1bf1afbccd 100644 --- a/sdk/resourcemanager/fabric/armfabric/operations_client.go +++ b/sdk/resourcemanager/fabric/armfabric/operations_client.go @@ -35,7 +35,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-11-01 +// Generated from API version 2025-01-15-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -68,7 +68,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2025-01-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/fabric/armfabric/operations_client_example_test.go b/sdk/resourcemanager/fabric/armfabric/operations_client_example_test.go index b16accbd798d..08e28eee0cc9 100644 --- a/sdk/resourcemanager/fabric/armfabric/operations_client_example_test.go +++ b/sdk/resourcemanager/fabric/armfabric/operations_client_example_test.go @@ -11,7 +11,7 @@ import ( "log" ) -// Generated from example definition: 2023-11-01/Operations_List.json +// Generated from example definition: 2025-01-15-preview/Operations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/fabric/armfabric/options.go b/sdk/resourcemanager/fabric/armfabric/options.go index 0a19abe35209..183ddedbf67c 100644 --- a/sdk/resourcemanager/fabric/armfabric/options.go +++ b/sdk/resourcemanager/fabric/armfabric/options.go @@ -69,6 +69,11 @@ type CapacitiesClientListSKUsOptions struct { // placeholder for future optional parameters } +// CapacitiesClientListUsagesOptions contains the optional parameters for the CapacitiesClient.NewListUsagesPager method. +type CapacitiesClientListUsagesOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/fabric/armfabric/responses.go b/sdk/resourcemanager/fabric/armfabric/responses.go index 4b603a062cd5..04ba346cf2d4 100644 --- a/sdk/resourcemanager/fabric/armfabric/responses.go +++ b/sdk/resourcemanager/fabric/armfabric/responses.go @@ -51,6 +51,12 @@ type CapacitiesClientListSKUsResponse struct { RpSKUEnumerationForNewResourceResult } +// CapacitiesClientListUsagesResponse contains the response from method CapacitiesClient.NewListUsagesPager. +type CapacitiesClientListUsagesResponse struct { + // Paged collection of Quota items + PagedQuota +} + // CapacitiesClientResumeResponse contains the response from method CapacitiesClient.BeginResume. type CapacitiesClientResumeResponse struct { // placeholder for future response values diff --git a/sdk/resourcemanager/fabric/armfabric/tsp-location.yaml b/sdk/resourcemanager/fabric/armfabric/tsp-location.yaml index 9c366cac6466..72deb27a0de5 100644 --- a/sdk/resourcemanager/fabric/armfabric/tsp-location.yaml +++ b/sdk/resourcemanager/fabric/armfabric/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/fabric/Microsoft.Fabric.Management -commit: 366aaa13cdd218b9adac716680e49473673410c8 +commit: b9a8c9e8eb8998a222f126a005d1ab633f1daad9 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/CHANGELOG.md b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/CHANGELOG.md index 7bcbafa76855..25bd2cc4c662 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/CHANGELOG.md +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/CHANGELOG.md @@ -1,5 +1,75 @@ # Release History +## 2.0.0 (2025-05-13) +### Breaking Changes + +- Type of `ErrorAdditionalInfo.Info` has been changed from `any` to `*ErrorAdditionalInfoInfo` +- Struct `ErrorResponse` has been removed +- Struct `ProxyResource` has been removed +- Struct `Resource` has been removed + +### Features Added + +- New enum type `CloudNativeType` with values `CloudNativeTypeEc2` +- New enum type `HostType` with values `HostTypeAWS` +- New enum type `ResourceProvisioningState` with values `ResourceProvisioningStateCanceled`, `ResourceProvisioningStateFailed`, `ResourceProvisioningStateSucceeded` +- New enum type `SolutionConfigurationStatus` with values `SolutionConfigurationStatusCompleted`, `SolutionConfigurationStatusFailed`, `SolutionConfigurationStatusInProgress`, `SolutionConfigurationStatusNew` +- New function `*ClientFactory.NewGenerateAwsTemplateClient(string) *GenerateAwsTemplateClient` +- New function `*ClientFactory.NewInventoryClient() *InventoryClient` +- New function `*ClientFactory.NewPublicCloudConnectorsClient(string) *PublicCloudConnectorsClient` +- New function `*ClientFactory.NewSolutionConfigurationsClient() *SolutionConfigurationsClient` +- New function `*ClientFactory.NewSolutionTypesClient(string) *SolutionTypesClient` +- New function `NewGenerateAwsTemplateClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GenerateAwsTemplateClient, error)` +- New function `*GenerateAwsTemplateClient.Post(context.Context, GenerateAwsTemplateRequest, *GenerateAwsTemplateClientPostOptions) (GenerateAwsTemplateClientPostResponse, error)` +- New function `NewInventoryClient(azcore.TokenCredential, *arm.ClientOptions) (*InventoryClient, error)` +- New function `*InventoryClient.Get(context.Context, string, string, string, *InventoryClientGetOptions) (InventoryClientGetResponse, error)` +- New function `*InventoryClient.NewListBySolutionConfigurationPager(string, string, *InventoryClientListBySolutionConfigurationOptions) *runtime.Pager[InventoryClientListBySolutionConfigurationResponse]` +- New function `NewPublicCloudConnectorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PublicCloudConnectorsClient, error)` +- New function `*PublicCloudConnectorsClient.BeginCreateOrUpdate(context.Context, string, string, PublicCloudConnector, *PublicCloudConnectorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PublicCloudConnectorsClientCreateOrUpdateResponse], error)` +- New function `*PublicCloudConnectorsClient.Delete(context.Context, string, string, *PublicCloudConnectorsClientDeleteOptions) (PublicCloudConnectorsClientDeleteResponse, error)` +- New function `*PublicCloudConnectorsClient.Get(context.Context, string, string, *PublicCloudConnectorsClientGetOptions) (PublicCloudConnectorsClientGetResponse, error)` +- New function `*PublicCloudConnectorsClient.NewListByResourceGroupPager(string, *PublicCloudConnectorsClientListByResourceGroupOptions) *runtime.Pager[PublicCloudConnectorsClientListByResourceGroupResponse]` +- New function `*PublicCloudConnectorsClient.NewListBySubscriptionPager(*PublicCloudConnectorsClientListBySubscriptionOptions) *runtime.Pager[PublicCloudConnectorsClientListBySubscriptionResponse]` +- New function `*PublicCloudConnectorsClient.BeginTestPermissions(context.Context, string, string, *PublicCloudConnectorsClientBeginTestPermissionsOptions) (*runtime.Poller[PublicCloudConnectorsClientTestPermissionsResponse], error)` +- New function `*PublicCloudConnectorsClient.Update(context.Context, string, string, PublicCloudConnectorUpdate, *PublicCloudConnectorsClientUpdateOptions) (PublicCloudConnectorsClientUpdateResponse, error)` +- New function `NewSolutionConfigurationsClient(azcore.TokenCredential, *arm.ClientOptions) (*SolutionConfigurationsClient, error)` +- New function `*SolutionConfigurationsClient.CreateOrUpdate(context.Context, string, string, SolutionConfiguration, *SolutionConfigurationsClientCreateOrUpdateOptions) (SolutionConfigurationsClientCreateOrUpdateResponse, error)` +- New function `*SolutionConfigurationsClient.Delete(context.Context, string, string, *SolutionConfigurationsClientDeleteOptions) (SolutionConfigurationsClientDeleteResponse, error)` +- New function `*SolutionConfigurationsClient.Get(context.Context, string, string, *SolutionConfigurationsClientGetOptions) (SolutionConfigurationsClientGetResponse, error)` +- New function `*SolutionConfigurationsClient.NewListPager(string, *SolutionConfigurationsClientListOptions) *runtime.Pager[SolutionConfigurationsClientListResponse]` +- New function `*SolutionConfigurationsClient.BeginSyncNow(context.Context, string, string, *SolutionConfigurationsClientBeginSyncNowOptions) (*runtime.Poller[SolutionConfigurationsClientSyncNowResponse], error)` +- New function `*SolutionConfigurationsClient.Update(context.Context, string, string, SolutionConfigurationUpdate, *SolutionConfigurationsClientUpdateOptions) (SolutionConfigurationsClientUpdateResponse, error)` +- New function `NewSolutionTypesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SolutionTypesClient, error)` +- New function `*SolutionTypesClient.Get(context.Context, string, string, *SolutionTypesClientGetOptions) (SolutionTypesClientGetResponse, error)` +- New function `*SolutionTypesClient.NewListByResourceGroupPager(string, *SolutionTypesClientListByResourceGroupOptions) *runtime.Pager[SolutionTypesClientListByResourceGroupResponse]` +- New function `*SolutionTypesClient.NewListBySubscriptionPager(*SolutionTypesClientListBySubscriptionOptions) *runtime.Pager[SolutionTypesClientListBySubscriptionResponse]` +- New struct `AwsCloudProfile` +- New struct `AwsCloudProfileUpdate` +- New struct `ErrorAdditionalInfoInfo` +- New struct `GenerateAwsTemplateRequest` +- New struct `GenerateAwsTemplateResponse` +- New struct `InventoryProperties` +- New struct `InventoryResource` +- New struct `InventoryResourceListResult` +- New struct `OperationStatusResult` +- New struct `PublicCloudConnector` +- New struct `PublicCloudConnectorListResult` +- New struct `PublicCloudConnectorProperties` +- New struct `PublicCloudConnectorPropertiesUpdate` +- New struct `PublicCloudConnectorUpdate` +- New struct `SolutionConfiguration` +- New struct `SolutionConfigurationListResult` +- New struct `SolutionConfigurationProperties` +- New struct `SolutionConfigurationPropertiesUpdate` +- New struct `SolutionConfigurationUpdate` +- New struct `SolutionSettings` +- New struct `SolutionTypeProperties` +- New struct `SolutionTypeResource` +- New struct `SolutionTypeResourceListResult` +- New struct `SolutionTypeSettings` +- New struct `SolutionTypeSettingsProperties` + + ## 1.2.0-beta.1 (2025-02-27) ### Features Added diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/README.md b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/README.md index e106a85421c3..f58350fc924a 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/README.md +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Arc Connectivity module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2 ``` ## Authorization @@ -36,7 +36,7 @@ For more information on authentication, please see the documentation for `aziden Azure Arc Connectivity module consists of one or more clients. We provide a client factory which could be used to create any client in this module. ```go -clientFactory, err := armhybridconnectivity.NewClientFactory(, cred, nil) +clientFactory, err := armhybridconnectivity.NewClientFactory(cred, nil) ``` You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). @@ -47,7 +47,7 @@ options := arm.ClientOptions { Cloud: cloud.AzureChina, }, } -clientFactory, err := armhybridconnectivity.NewClientFactory(, cred, &options) +clientFactory, err := armhybridconnectivity.NewClientFactory(cred, &options) ``` ## Clients diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/constants.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/constants.go index fdad98be1429..ad9c7249c38a 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/constants.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/constants.go @@ -6,7 +6,7 @@ package armhybridconnectivity const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" - moduleVersion = "v1.2.0-beta.1" + moduleVersion = "v2.0.0" ) // ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client_example_test.go index 735aff7d2697..38c4b8c4054e 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/endpoints_client_example_test.go @@ -8,7 +8,7 @@ import ( "context" "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/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "log" ) @@ -23,7 +23,12 @@ func ExampleEndpointsClient_CreateOrUpdate_hybridConnectivityEndpointsPutCustom( if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", "custom", armhybridconnectivity.EndpointResource{}, nil) + res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", "custom", armhybridconnectivity.EndpointResource{ + Properties: &armhybridconnectivity.EndpointProperties{ + Type: to.Ptr(armhybridconnectivity.TypeCustom), + ResourceID: to.Ptr("/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -55,7 +60,11 @@ func ExampleEndpointsClient_CreateOrUpdate_hybridConnectivityEndpointsPutDefault if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", "default", armhybridconnectivity.EndpointResource{}, nil) + res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", "default", armhybridconnectivity.EndpointResource{ + Properties: &armhybridconnectivity.EndpointProperties{ + Type: to.Ptr(armhybridconnectivity.TypeDefault), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -293,7 +302,11 @@ func ExampleEndpointsClient_ListManagedProxyDetails() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewEndpointsClient().ListManagedProxyDetails(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006", "default", armhybridconnectivity.ManagedProxyRequest{}, nil) + res, err := clientFactory.NewEndpointsClient().ListManagedProxyDetails(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006", "default", armhybridconnectivity.ManagedProxyRequest{ + Hostname: to.Ptr("r.proxy.arc.com"), + Service: to.Ptr("127.0.0.1:65035"), + ServiceName: to.Ptr(armhybridconnectivity.ServiceNameWAC), + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -319,7 +332,11 @@ func ExampleEndpointsClient_Update() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewEndpointsClient().Update(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", "default", armhybridconnectivity.EndpointResource{}, nil) + res, err := clientFactory.NewEndpointsClient().Update(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", "default", armhybridconnectivity.EndpointResource{ + Properties: &armhybridconnectivity.EndpointProperties{ + Type: to.Ptr(armhybridconnectivity.TypeDefault), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/endpoints_server.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/endpoints_server.go index c72ed0812c87..960e757c0a6e 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/endpoints_server.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/endpoints_server.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "net/http" "net/url" "reflect" @@ -137,7 +137,7 @@ func (e *EndpointsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*h const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.EndpointResource](req) @@ -174,7 +174,7 @@ func (e *EndpointsServerTransport) dispatchDelete(req *http.Request) (*http.Resp const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -207,7 +207,7 @@ func (e *EndpointsServerTransport) dispatchGet(req *http.Request) (*http.Respons const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -242,7 +242,7 @@ func (e *EndpointsServerTransport) dispatchNewListPager(req *http.Request) (*htt const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -277,7 +277,7 @@ func (e *EndpointsServerTransport) dispatchListCredentials(req *http.Request) (* const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listCredentials` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() @@ -336,7 +336,7 @@ func (e *EndpointsServerTransport) dispatchListIngressGatewayCredentials(req *ht const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listIngressGatewayCredentials` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } qp := req.URL.Query() @@ -395,7 +395,7 @@ func (e *EndpointsServerTransport) dispatchListManagedProxyDetails(req *http.Req const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listManagedProxyDetails` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.ManagedProxyRequest](req) @@ -432,7 +432,7 @@ func (e *EndpointsServerTransport) dispatchUpdate(req *http.Request) (*http.Resp const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.EndpointResource](req) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/generateawstemplate_server.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/generateawstemplate_server.go index 41fac446844d..26c435e4146c 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/generateawstemplate_server.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/generateawstemplate_server.go @@ -11,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "net/http" "regexp" ) @@ -87,7 +87,7 @@ func (g *GenerateAwsTemplateServerTransport) dispatchPost(req *http.Request) (*h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/generateAwsTemplate` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.GenerateAwsTemplateRequest](req) @@ -102,7 +102,7 @@ func (g *GenerateAwsTemplateServerTransport) dispatchPost(req *http.Request) (*h if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PostResponse, req) + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GenerateAwsTemplateResponse, req) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/inventory_server.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/inventory_server.go index 6176ac210603..225ee2b01774 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/inventory_server.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/inventory_server.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "net/http" "net/url" "regexp" @@ -99,7 +99,7 @@ func (i *InventoryServerTransport) dispatchGet(req *http.Request) (*http.Respons const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inventory/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -138,7 +138,7 @@ func (i *InventoryServerTransport) dispatchNewListBySolutionConfigurationPager(r const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inventory` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/operations_server.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/operations_server.go index 528d3811ce14..52715dd2b0a3 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/operations_server.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/operations_server.go @@ -11,7 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "net/http" ) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/publiccloudconnectors_server.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/publiccloudconnectors_server.go index c9c8bd1e17cf..c86c830da554 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/publiccloudconnectors_server.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/publiccloudconnectors_server.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "net/http" "net/url" "regexp" @@ -46,7 +46,7 @@ type PublicCloudConnectorsServer struct { // Update is the fake for method PublicCloudConnectorsClient.Update // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, publicCloudConnector string, properties armhybridconnectivity.PublicCloudConnector, options *armhybridconnectivity.PublicCloudConnectorsClientUpdateOptions) (resp azfake.Responder[armhybridconnectivity.PublicCloudConnectorsClientUpdateResponse], errResp azfake.ErrorResponder) + Update func(ctx context.Context, resourceGroupName string, publicCloudConnector string, properties armhybridconnectivity.PublicCloudConnectorUpdate, options *armhybridconnectivity.PublicCloudConnectorsClientUpdateOptions) (resp azfake.Responder[armhybridconnectivity.PublicCloudConnectorsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewPublicCloudConnectorsServerTransport creates a new instance of PublicCloudConnectorsServerTransport with the provided implementation. @@ -137,7 +137,7 @@ func (p *PublicCloudConnectorsServerTransport) dispatchBeginCreateOrUpdate(req * const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/publicCloudConnectors/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.PublicCloudConnector](req) @@ -183,7 +183,7 @@ func (p *PublicCloudConnectorsServerTransport) dispatchDelete(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/publicCloudConnectors/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -216,7 +216,7 @@ func (p *PublicCloudConnectorsServerTransport) dispatchGet(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/publicCloudConnectors/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -251,7 +251,7 @@ func (p *PublicCloudConnectorsServerTransport) dispatchNewListByResourceGroupPag const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/publicCloudConnectors` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -288,7 +288,7 @@ func (p *PublicCloudConnectorsServerTransport) dispatchNewListBySubscriptionPage const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/publicCloudConnectors` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := p.srv.NewListBySubscriptionPager(nil) @@ -321,7 +321,7 @@ func (p *PublicCloudConnectorsServerTransport) dispatchBeginTestPermissions(req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/publicCloudConnectors/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/testPermissions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -363,10 +363,10 @@ func (p *PublicCloudConnectorsServerTransport) dispatchUpdate(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/publicCloudConnectors/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.PublicCloudConnector](req) + body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.PublicCloudConnectorUpdate](req) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/serviceconfigurations_server.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/serviceconfigurations_server.go index c62c23c93448..f96e09047dcf 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/serviceconfigurations_server.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/serviceconfigurations_server.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "net/http" "net/url" "regexp" @@ -117,7 +117,7 @@ func (s *ServiceConfigurationsServerTransport) dispatchCreateOrupdate(req *http. const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serviceConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.ServiceConfigurationResource](req) @@ -158,7 +158,7 @@ func (s *ServiceConfigurationsServerTransport) dispatchDelete(req *http.Request) const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serviceConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -195,7 +195,7 @@ func (s *ServiceConfigurationsServerTransport) dispatchGet(req *http.Request) (* const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serviceConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -234,7 +234,7 @@ func (s *ServiceConfigurationsServerTransport) dispatchNewListByEndpointResource const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serviceConfigurations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -273,7 +273,7 @@ func (s *ServiceConfigurationsServerTransport) dispatchUpdate(req *http.Request) const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/endpoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serviceConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.ServiceConfigurationResourcePatch](req) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/solutionconfigurations_server.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/solutionconfigurations_server.go index 3d5e16bd7e34..d395838263fa 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/solutionconfigurations_server.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/solutionconfigurations_server.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "net/http" "net/url" "regexp" @@ -42,7 +42,7 @@ type SolutionConfigurationsServer struct { // Update is the fake for method SolutionConfigurationsClient.Update // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceURI string, solutionConfiguration string, properties armhybridconnectivity.SolutionConfiguration, options *armhybridconnectivity.SolutionConfigurationsClientUpdateOptions) (resp azfake.Responder[armhybridconnectivity.SolutionConfigurationsClientUpdateResponse], errResp azfake.ErrorResponder) + Update func(ctx context.Context, resourceURI string, solutionConfiguration string, properties armhybridconnectivity.SolutionConfigurationUpdate, options *armhybridconnectivity.SolutionConfigurationsClientUpdateOptions) (resp azfake.Responder[armhybridconnectivity.SolutionConfigurationsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewSolutionConfigurationsServerTransport creates a new instance of SolutionConfigurationsServerTransport with the provided implementation. @@ -125,7 +125,7 @@ func (s *SolutionConfigurationsServerTransport) dispatchCreateOrUpdate(req *http const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.SolutionConfiguration](req) @@ -162,7 +162,7 @@ func (s *SolutionConfigurationsServerTransport) dispatchDelete(req *http.Request const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -195,7 +195,7 @@ func (s *SolutionConfigurationsServerTransport) dispatchGet(req *http.Request) ( const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -230,7 +230,7 @@ func (s *SolutionConfigurationsServerTransport) dispatchNewListPager(req *http.R const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionConfigurations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -267,7 +267,7 @@ func (s *SolutionConfigurationsServerTransport) dispatchBeginSyncNow(req *http.R const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/syncNow` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceURIParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceUri")]) @@ -309,10 +309,10 @@ func (s *SolutionConfigurationsServerTransport) dispatchUpdate(req *http.Request const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.SolutionConfiguration](req) + body, err := server.UnmarshalRequestAsJSON[armhybridconnectivity.SolutionConfigurationUpdate](req) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/solutiontypes_server.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/solutiontypes_server.go index 49771ddfed71..4ea6d1f5a2be 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/solutiontypes_server.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/solutiontypes_server.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "net/http" "net/url" "regexp" @@ -107,7 +107,7 @@ func (s *SolutionTypesServerTransport) dispatchGet(req *http.Request) (*http.Res const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -142,7 +142,7 @@ func (s *SolutionTypesServerTransport) dispatchNewListByResourceGroupPager(req * const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionTypes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -179,7 +179,7 @@ func (s *SolutionTypesServerTransport) dispatchNewListBySubscriptionPager(req *h const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HybridConnectivity/solutionTypes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := s.srv.NewListBySubscriptionPager(nil) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/time_rfc3339.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/time_rfc3339.go deleted file mode 100644 index 87ee11e83b32..000000000000 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/fake/time_rfc3339.go +++ /dev/null @@ -1,109 +0,0 @@ -// 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) Go Code Generator. DO NOT EDIT. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/generateawstemplate_client.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/generateawstemplate_client.go index 76eba82d7603..c00a7a5957c0 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/generateawstemplate_client.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/generateawstemplate_client.go @@ -93,7 +93,7 @@ func (client *GenerateAwsTemplateClient) postCreateRequest(ctx context.Context, // postHandleResponse handles the Post response. func (client *GenerateAwsTemplateClient) postHandleResponse(resp *http.Response) (GenerateAwsTemplateClientPostResponse, error) { result := GenerateAwsTemplateClientPostResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PostResponse); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.GenerateAwsTemplateResponse); err != nil { return GenerateAwsTemplateClientPostResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/generateawstemplate_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/generateawstemplate_client_example_test.go index d48645a9362b..18d53f2d5c90 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/generateawstemplate_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/generateawstemplate_client_example_test.go @@ -8,7 +8,7 @@ import ( "context" "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/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "log" ) @@ -39,7 +39,7 @@ func ExampleGenerateAwsTemplateClient_Post() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res = armhybridconnectivity.GenerateAwsTemplateClientPostResponse{ - // PostResponse: &armhybridconnectivity.PostResponse{ + // GenerateAwsTemplateResponse: &armhybridconnectivity.GenerateAwsTemplateResponse{ // }, // } } diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.mod b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.mod index c60c012edfd0..64e2e15773c7 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.mod +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/go.mod @@ -1,4 +1,4 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2 go 1.23.0 diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/inventory_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/inventory_client_example_test.go index b2e19968ab5f..f644042de9d1 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/inventory_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/inventory_client_example_test.go @@ -7,7 +7,7 @@ package armhybridconnectivity_test import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "log" ) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models.go index 89edf51d4017..4483fb9f605e 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models.go @@ -28,6 +28,12 @@ type AwsCloudProfile struct { IsOrganizationalAccount *bool } +// AwsCloudProfileUpdate - cloud profile for AWS. +type AwsCloudProfileUpdate struct { + // List of AWS accounts which need to be excluded. + ExcludedAccounts []*string +} + // EndpointAccessResource - The endpoint access for the target resource. type EndpointAccessResource struct { // Azure relay hybrid connection access properties @@ -112,6 +118,10 @@ type GenerateAwsTemplateRequest struct { SolutionTypes []*SolutionTypeSettings } +// GenerateAwsTemplateResponse - The HybridConnectivity post operation response +type GenerateAwsTemplateResponse struct { +} + // IngressGatewayResource - The ingress gateway access credentials type IngressGatewayResource struct { // Ingress gateway profile @@ -212,7 +222,9 @@ type ManagedProxyResource struct { Proxy *string } -// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +// Operation - REST API Operation +// +// Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. Display *OperationDisplay @@ -291,9 +303,6 @@ type OperationStatusResult struct { ResourceID *string } -type PostResponse struct { -} - // PublicCloudConnector - Public Cloud Connector type PublicCloudConnector struct { // REQUIRED; The geo-location where the resource lives @@ -342,6 +351,33 @@ type PublicCloudConnectorProperties struct { ProvisioningState *ResourceProvisioningState } +// PublicCloudConnectorPropertiesUpdate - Properties of public cloud connectors. +type PublicCloudConnectorPropertiesUpdate struct { + // Cloud profile for AWS. + AwsCloudProfile *AwsCloudProfileUpdate +} + +// PublicCloudConnectorUpdate - Public Cloud Connector +type PublicCloudConnectorUpdate struct { + // The resource-specific properties for this resource. + Properties *PublicCloudConnectorPropertiesUpdate + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // RelayNamespaceAccessProperties - Azure relay hybrid connection access properties type RelayNamespaceAccessProperties struct { // REQUIRED; Azure Relay hybrid connection name for the resource. @@ -465,6 +501,33 @@ type SolutionConfigurationProperties struct { StatusDetails *string } +// SolutionConfigurationPropertiesUpdate - Solution configuration resource. +type SolutionConfigurationPropertiesUpdate struct { + // Solution settings + SolutionSettings *SolutionSettings + + // The type of the solution + SolutionType *string +} + +// SolutionConfigurationUpdate - Solution Configuration +type SolutionConfigurationUpdate struct { + // The resource-specific properties for this resource. + Properties *SolutionConfigurationPropertiesUpdate + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // SolutionSettings - Solution settings type SolutionSettings struct { AdditionalProperties map[string]*string diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models_serde.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models_serde.go index 9ca32ddad55c..a49a77f79e88 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models_serde.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/models_serde.go @@ -77,6 +77,33 @@ func (a *AwsCloudProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AwsCloudProfileUpdate. +func (a AwsCloudProfileUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "excludedAccounts", a.ExcludedAccounts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCloudProfileUpdate. +func (a *AwsCloudProfileUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "excludedAccounts": + err = unpopulate(val, "ExcludedAccounts", &a.ExcludedAccounts) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type EndpointAccessResource. func (e EndpointAccessResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -914,6 +941,80 @@ func (p *PublicCloudConnectorProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PublicCloudConnectorPropertiesUpdate. +func (p PublicCloudConnectorPropertiesUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "awsCloudProfile", p.AwsCloudProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicCloudConnectorPropertiesUpdate. +func (p *PublicCloudConnectorPropertiesUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "awsCloudProfile": + err = unpopulate(val, "AwsCloudProfile", &p.AwsCloudProfile) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PublicCloudConnectorUpdate. +func (p PublicCloudConnectorUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicCloudConnectorUpdate. +func (p *PublicCloudConnectorUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RelayNamespaceAccessProperties. func (r RelayNamespaceAccessProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1249,6 +1350,80 @@ func (s *SolutionConfigurationProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SolutionConfigurationPropertiesUpdate. +func (s SolutionConfigurationPropertiesUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "solutionSettings", s.SolutionSettings) + populate(objectMap, "solutionType", s.SolutionType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionConfigurationPropertiesUpdate. +func (s *SolutionConfigurationPropertiesUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "solutionSettings": + err = unpopulate(val, "SolutionSettings", &s.SolutionSettings) + delete(rawMsg, key) + case "solutionType": + err = unpopulate(val, "SolutionType", &s.SolutionType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SolutionConfigurationUpdate. +func (s SolutionConfigurationUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionConfigurationUpdate. +func (s *SolutionConfigurationUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SolutionSettings. func (s SolutionSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client_example_test.go index 85db23c73333..4fd8edc508f6 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/operations_client_example_test.go @@ -7,7 +7,7 @@ package armhybridconnectivity_test import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "log" ) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/publiccloudconnectors_client.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/publiccloudconnectors_client.go index 28eb57d5d6ce..d377c4b44559 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/publiccloudconnectors_client.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/publiccloudconnectors_client.go @@ -440,7 +440,7 @@ func (client *PublicCloudConnectorsClient) testPermissionsCreateRequest(ctx cont // - properties - The resource properties to be updated. // - options - PublicCloudConnectorsClientUpdateOptions contains the optional parameters for the PublicCloudConnectorsClient.Update // method. -func (client *PublicCloudConnectorsClient) Update(ctx context.Context, resourceGroupName string, publicCloudConnector string, properties PublicCloudConnector, options *PublicCloudConnectorsClientUpdateOptions) (PublicCloudConnectorsClientUpdateResponse, error) { +func (client *PublicCloudConnectorsClient) Update(ctx context.Context, resourceGroupName string, publicCloudConnector string, properties PublicCloudConnectorUpdate, options *PublicCloudConnectorsClientUpdateOptions) (PublicCloudConnectorsClientUpdateResponse, error) { var err error const operationName = "PublicCloudConnectorsClient.Update" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -463,7 +463,7 @@ func (client *PublicCloudConnectorsClient) Update(ctx context.Context, resourceG } // updateCreateRequest creates the Update request. -func (client *PublicCloudConnectorsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publicCloudConnector string, properties PublicCloudConnector, _ *PublicCloudConnectorsClientUpdateOptions) (*policy.Request, error) { +func (client *PublicCloudConnectorsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, publicCloudConnector string, properties PublicCloudConnectorUpdate, _ *PublicCloudConnectorsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/publiccloudconnectors_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/publiccloudconnectors_client_example_test.go index a462661bef4d..9c32b34e05af 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/publiccloudconnectors_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/publiccloudconnectors_client_example_test.go @@ -8,7 +8,7 @@ import ( "context" "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/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "log" ) @@ -358,10 +358,10 @@ func ExamplePublicCloudConnectorsClient_Update() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPublicCloudConnectorsClient("5ACC4579-DB34-4C2F-8F8C-25061168F342").Update(ctx, "rgpublicCloud", "svtirlbyqpepbzyessjenlueeznhg", armhybridconnectivity.PublicCloudConnector{ + res, err := clientFactory.NewPublicCloudConnectorsClient("5ACC4579-DB34-4C2F-8F8C-25061168F342").Update(ctx, "rgpublicCloud", "svtirlbyqpepbzyessjenlueeznhg", armhybridconnectivity.PublicCloudConnectorUpdate{ Tags: map[string]*string{}, - Properties: &armhybridconnectivity.PublicCloudConnectorProperties{ - AwsCloudProfile: &armhybridconnectivity.AwsCloudProfile{ + Properties: &armhybridconnectivity.PublicCloudConnectorPropertiesUpdate{ + AwsCloudProfile: &armhybridconnectivity.AwsCloudProfileUpdate{ ExcludedAccounts: []*string{ to.Ptr("zrbtd"), }, diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/responses.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/responses.go index d036bd1df71a..17424c3b8162 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/responses.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/responses.go @@ -53,7 +53,8 @@ type EndpointsClientUpdateResponse struct { // GenerateAwsTemplateClientPostResponse contains the response from method GenerateAwsTemplateClient.Post. type GenerateAwsTemplateClientPostResponse struct { - PostResponse + // The HybridConnectivity post operation response + GenerateAwsTemplateResponse } // InventoryClientGetResponse contains the response from method InventoryClient.Get. diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client_example_test.go index f19358e24452..6db88d5dd9c7 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/serviceconfigurations_client_example_test.go @@ -6,8 +6,9 @@ package armhybridconnectivity_test import ( "context" + "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/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "log" ) @@ -22,7 +23,12 @@ func ExampleServiceConfigurationsClient_CreateOrupdate_serviceConfigurationsPutS if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServiceConfigurationsClient().CreateOrupdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "SSH", armhybridconnectivity.ServiceConfigurationResource{}, nil) + res, err := clientFactory.NewServiceConfigurationsClient().CreateOrupdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "SSH", armhybridconnectivity.ServiceConfigurationResource{ + Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + Port: to.Ptr[int64](22), + ServiceName: to.Ptr(armhybridconnectivity.ServiceNameSSH), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -53,7 +59,12 @@ func ExampleServiceConfigurationsClient_CreateOrupdate_serviceConfigurationsPutW if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServiceConfigurationsClient().CreateOrupdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "WAC", armhybridconnectivity.ServiceConfigurationResource{}, nil) + res, err := clientFactory.NewServiceConfigurationsClient().CreateOrupdate(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "WAC", armhybridconnectivity.ServiceConfigurationResource{ + Properties: &armhybridconnectivity.ServiceConfigurationProperties{ + Port: to.Ptr[int64](6516), + ServiceName: to.Ptr(armhybridconnectivity.ServiceNameWAC), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -213,7 +224,11 @@ func ExampleServiceConfigurationsClient_Update() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServiceConfigurationsClient().Update(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "SSH", armhybridconnectivity.ServiceConfigurationResourcePatch{}, nil) + res, err := clientFactory.NewServiceConfigurationsClient().Update(ctx, "subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", "default", "SSH", armhybridconnectivity.ServiceConfigurationResourcePatch{ + Properties: &armhybridconnectivity.ServiceConfigurationPropertiesPatch{ + Port: to.Ptr[int64](22), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutionconfigurations_client.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutionconfigurations_client.go index 62d0293c43cd..02e27a31ffea 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutionconfigurations_client.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutionconfigurations_client.go @@ -336,7 +336,7 @@ func (client *SolutionConfigurationsClient) syncNowCreateRequest(ctx context.Con // - properties - The resource properties to be updated. // - options - SolutionConfigurationsClientUpdateOptions contains the optional parameters for the SolutionConfigurationsClient.Update // method. -func (client *SolutionConfigurationsClient) Update(ctx context.Context, resourceURI string, solutionConfiguration string, properties SolutionConfiguration, options *SolutionConfigurationsClientUpdateOptions) (SolutionConfigurationsClientUpdateResponse, error) { +func (client *SolutionConfigurationsClient) Update(ctx context.Context, resourceURI string, solutionConfiguration string, properties SolutionConfigurationUpdate, options *SolutionConfigurationsClientUpdateOptions) (SolutionConfigurationsClientUpdateResponse, error) { var err error const operationName = "SolutionConfigurationsClient.Update" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -359,7 +359,7 @@ func (client *SolutionConfigurationsClient) Update(ctx context.Context, resource } // updateCreateRequest creates the Update request. -func (client *SolutionConfigurationsClient) updateCreateRequest(ctx context.Context, resourceURI string, solutionConfiguration string, properties SolutionConfiguration, _ *SolutionConfigurationsClientUpdateOptions) (*policy.Request, error) { +func (client *SolutionConfigurationsClient) updateCreateRequest(ctx context.Context, resourceURI string, solutionConfiguration string, properties SolutionConfigurationUpdate, _ *SolutionConfigurationsClientUpdateOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) if solutionConfiguration == "" { diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutionconfigurations_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutionconfigurations_client_example_test.go index f1051d436fc8..4165fe471b10 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutionconfigurations_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutionconfigurations_client_example_test.go @@ -8,7 +8,7 @@ import ( "context" "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/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "log" ) @@ -158,6 +158,7 @@ func ExampleSolutionConfigurationsClient_NewListPager() { // SolutionSettings: &armhybridconnectivity.SolutionSettings{ // }, // ProvisioningState: to.Ptr(armhybridconnectivity.ResourceProvisioningStateSucceeded), + // Status: to.Ptr(armhybridconnectivity.SolutionConfigurationStatus("AuthorizationPending")), // StatusDetails: to.Ptr("Aws authorization validation pending in Aws account"), // LastSyncTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-20T03:24:15.820Z"); return t}()), // }, @@ -179,6 +180,7 @@ func ExampleSolutionConfigurationsClient_NewListPager() { // SolutionSettings: &armhybridconnectivity.SolutionSettings{ // }, // ProvisioningState: to.Ptr(armhybridconnectivity.ResourceProvisioningStateSucceeded), + // Status: to.Ptr(armhybridconnectivity.SolutionConfigurationStatus("AuthorizationSuccess")), // StatusDetails: to.Ptr("Aws authorization validation succeeded in Aws account"), // LastSyncTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-20T03:24:15.820Z"); return t}()), // }, @@ -263,8 +265,8 @@ func ExampleSolutionConfigurationsClient_Update() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewSolutionConfigurationsClient().Update(ctx, "ymuj", "dxt", armhybridconnectivity.SolutionConfiguration{ - Properties: &armhybridconnectivity.SolutionConfigurationProperties{ + res, err := clientFactory.NewSolutionConfigurationsClient().Update(ctx, "ymuj", "dxt", armhybridconnectivity.SolutionConfigurationUpdate{ + Properties: &armhybridconnectivity.SolutionConfigurationPropertiesUpdate{ SolutionType: to.Ptr("myzljlstvmgkp"), SolutionSettings: &armhybridconnectivity.SolutionSettings{}, }, diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutiontypes_client_example_test.go b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutiontypes_client_example_test.go index 25c4f2a97dc8..2307ef148af4 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutiontypes_client_example_test.go +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/solutiontypes_client_example_test.go @@ -7,7 +7,7 @@ package armhybridconnectivity_test import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/v2" "log" ) diff --git a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/tsp-location.yaml b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/tsp-location.yaml index 34b0c0dceb55..dc4575aaefe2 100644 --- a/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/tsp-location.yaml +++ b/sdk/resourcemanager/hybridconnectivity/armhybridconnectivity/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/hybridconnectivity/HybridConnectivity.Management -commit: 9d3547622288137fd36f086afcdaea5408dbe48c +commit: b9a8c9e8eb8998a222f126a005d1ab633f1daad9 repo: Azure/azure-rest-api-specs -additionalDirectories: \ No newline at end of file +additionalDirectories: diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/CHANGELOG.md b/sdk/resourcemanager/oracledatabase/armoracledatabase/CHANGELOG.md index 075358ad45d9..5d42ac90b119 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/CHANGELOG.md +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/CHANGELOG.md @@ -1,5 +1,107 @@ # Release History +## 2.0.0 (2025-05-13) +### Breaking Changes + +- Type of `AutonomousDatabaseBackupUpdate.Properties` has been changed from `*AutonomousDatabaseBackupUpdateProperties` to `*AutonomousDatabaseBackupProperties` +- Function `*AutonomousDatabaseBackupsClient.NewListByAutonomousDatabasePager` has been removed +- Function `*DbNodesClient.NewListByCloudVMClusterPager` has been removed +- Function `*DbServersClient.NewListByCloudExadataInfrastructurePager` has been removed +- Function `*VirtualNetworkAddressesClient.NewListByCloudVMClusterPager` has been removed +- Struct `AutonomousDatabaseBackupUpdateProperties` has been removed + +### Features Added + +- New value `DataBaseTypeCloneFromBackupTimestamp`, `DataBaseTypeCrossRegionDisasterRecovery` added to enum type `DataBaseType` +- New enum type `AddSubscriptionOperationState` with values `AddSubscriptionOperationStateFailed`, `AddSubscriptionOperationStateSucceeded`, `AddSubscriptionOperationStateUpdating` +- New enum type `ExadbVMClusterLifecycleState` with values `ExadbVMClusterLifecycleStateAvailable`, `ExadbVMClusterLifecycleStateFailed`, `ExadbVMClusterLifecycleStateMaintenanceInProgress`, `ExadbVMClusterLifecycleStateProvisioning`, `ExadbVMClusterLifecycleStateTerminated`, `ExadbVMClusterLifecycleStateTerminating`, `ExadbVMClusterLifecycleStateUpdating` +- New enum type `ExascaleDbStorageVaultLifecycleState` with values `ExascaleDbStorageVaultLifecycleStateAvailable`, `ExascaleDbStorageVaultLifecycleStateFailed`, `ExascaleDbStorageVaultLifecycleStateProvisioning`, `ExascaleDbStorageVaultLifecycleStateTerminated`, `ExascaleDbStorageVaultLifecycleStateTerminating`, `ExascaleDbStorageVaultLifecycleStateUpdating` +- New enum type `GridImageType` with values `GridImageTypeCustomImage`, `GridImageTypeReleaseUpdate` +- New enum type `HardwareType` with values `HardwareTypeCELL`, `HardwareTypeCOMPUTE` +- New enum type `ShapeFamily` with values `ShapeFamilyExadata`, `ShapeFamilyExadbXs` +- New enum type `SystemShapes` with values `SystemShapesExaDbXs`, `SystemShapesExadataX11M`, `SystemShapesExadataX9M` +- New function `*AutonomousDatabaseBackupsClient.NewListByParentPager(string, string, *AutonomousDatabaseBackupsClientListByParentOptions) *runtime.Pager[AutonomousDatabaseBackupsClientListByParentResponse]` +- New function `*AutonomousDatabaseCrossRegionDisasterRecoveryProperties.GetAutonomousDatabaseBaseProperties() *AutonomousDatabaseBaseProperties` +- New function `*AutonomousDatabaseFromBackupTimestampProperties.GetAutonomousDatabaseBaseProperties() *AutonomousDatabaseBaseProperties` +- New function `*AutonomousDatabasesClient.BeginChangeDisasterRecoveryConfiguration(context.Context, string, string, DisasterRecoveryConfigurationDetails, *AutonomousDatabasesClientBeginChangeDisasterRecoveryConfigurationOptions) (*runtime.Poller[AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse], error)` +- New function `*ClientFactory.NewExadbVMClustersClient() *ExadbVMClustersClient` +- New function `*ClientFactory.NewExascaleDbNodesClient() *ExascaleDbNodesClient` +- New function `*ClientFactory.NewExascaleDbStorageVaultsClient() *ExascaleDbStorageVaultsClient` +- New function `*ClientFactory.NewFlexComponentsClient() *FlexComponentsClient` +- New function `*ClientFactory.NewGiMinorVersionsClient() *GiMinorVersionsClient` +- New function `*DbNodesClient.NewListByParentPager(string, string, *DbNodesClientListByParentOptions) *runtime.Pager[DbNodesClientListByParentResponse]` +- New function `*DbServersClient.NewListByParentPager(string, string, *DbServersClientListByParentOptions) *runtime.Pager[DbServersClientListByParentResponse]` +- New function `NewExadbVMClustersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ExadbVMClustersClient, error)` +- New function `*ExadbVMClustersClient.BeginCreateOrUpdate(context.Context, string, string, ExadbVMCluster, *ExadbVMClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExadbVMClustersClientCreateOrUpdateResponse], error)` +- New function `*ExadbVMClustersClient.BeginDelete(context.Context, string, string, *ExadbVMClustersClientBeginDeleteOptions) (*runtime.Poller[ExadbVMClustersClientDeleteResponse], error)` +- New function `*ExadbVMClustersClient.Get(context.Context, string, string, *ExadbVMClustersClientGetOptions) (ExadbVMClustersClientGetResponse, error)` +- New function `*ExadbVMClustersClient.NewListByResourceGroupPager(string, *ExadbVMClustersClientListByResourceGroupOptions) *runtime.Pager[ExadbVMClustersClientListByResourceGroupResponse]` +- New function `*ExadbVMClustersClient.NewListBySubscriptionPager(*ExadbVMClustersClientListBySubscriptionOptions) *runtime.Pager[ExadbVMClustersClientListBySubscriptionResponse]` +- New function `*ExadbVMClustersClient.BeginRemoveVMs(context.Context, string, string, RemoveVirtualMachineFromExadbVMClusterDetails, *ExadbVMClustersClientBeginRemoveVMsOptions) (*runtime.Poller[ExadbVMClustersClientRemoveVMsResponse], error)` +- New function `*ExadbVMClustersClient.BeginUpdate(context.Context, string, string, ExadbVMClusterUpdate, *ExadbVMClustersClientBeginUpdateOptions) (*runtime.Poller[ExadbVMClustersClientUpdateResponse], error)` +- New function `NewExascaleDbNodesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ExascaleDbNodesClient, error)` +- New function `*ExascaleDbNodesClient.BeginAction(context.Context, string, string, string, DbNodeAction, *ExascaleDbNodesClientBeginActionOptions) (*runtime.Poller[ExascaleDbNodesClientActionResponse], error)` +- New function `*ExascaleDbNodesClient.Get(context.Context, string, string, string, *ExascaleDbNodesClientGetOptions) (ExascaleDbNodesClientGetResponse, error)` +- New function `*ExascaleDbNodesClient.NewListByParentPager(string, string, *ExascaleDbNodesClientListByParentOptions) *runtime.Pager[ExascaleDbNodesClientListByParentResponse]` +- New function `NewExascaleDbStorageVaultsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ExascaleDbStorageVaultsClient, error)` +- New function `*ExascaleDbStorageVaultsClient.BeginCreate(context.Context, string, string, ExascaleDbStorageVault, *ExascaleDbStorageVaultsClientBeginCreateOptions) (*runtime.Poller[ExascaleDbStorageVaultsClientCreateResponse], error)` +- New function `*ExascaleDbStorageVaultsClient.BeginDelete(context.Context, string, string, *ExascaleDbStorageVaultsClientBeginDeleteOptions) (*runtime.Poller[ExascaleDbStorageVaultsClientDeleteResponse], error)` +- New function `*ExascaleDbStorageVaultsClient.Get(context.Context, string, string, *ExascaleDbStorageVaultsClientGetOptions) (ExascaleDbStorageVaultsClientGetResponse, error)` +- New function `*ExascaleDbStorageVaultsClient.NewListByResourceGroupPager(string, *ExascaleDbStorageVaultsClientListByResourceGroupOptions) *runtime.Pager[ExascaleDbStorageVaultsClientListByResourceGroupResponse]` +- New function `*ExascaleDbStorageVaultsClient.NewListBySubscriptionPager(*ExascaleDbStorageVaultsClientListBySubscriptionOptions) *runtime.Pager[ExascaleDbStorageVaultsClientListBySubscriptionResponse]` +- New function `*ExascaleDbStorageVaultsClient.BeginUpdate(context.Context, string, string, ExascaleDbStorageVaultTagsUpdate, *ExascaleDbStorageVaultsClientBeginUpdateOptions) (*runtime.Poller[ExascaleDbStorageVaultsClientUpdateResponse], error)` +- New function `NewFlexComponentsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FlexComponentsClient, error)` +- New function `*FlexComponentsClient.Get(context.Context, string, string, *FlexComponentsClientGetOptions) (FlexComponentsClientGetResponse, error)` +- New function `*FlexComponentsClient.NewListByParentPager(string, *FlexComponentsClientListByParentOptions) *runtime.Pager[FlexComponentsClientListByParentResponse]` +- New function `NewGiMinorVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GiMinorVersionsClient, error)` +- New function `*GiMinorVersionsClient.Get(context.Context, string, string, string, *GiMinorVersionsClientGetOptions) (GiMinorVersionsClientGetResponse, error)` +- New function `*GiMinorVersionsClient.NewListByParentPager(string, string, *GiMinorVersionsClientListByParentOptions) *runtime.Pager[GiMinorVersionsClientListByParentResponse]` +- New function `*OracleSubscriptionsClient.BeginAddAzureSubscriptions(context.Context, AzureSubscriptions, *OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (*runtime.Poller[OracleSubscriptionsClientAddAzureSubscriptionsResponse], error)` +- New function `*VirtualNetworkAddressesClient.NewListByParentPager(string, string, *VirtualNetworkAddressesClientListByParentOptions) *runtime.Pager[VirtualNetworkAddressesClientListByParentResponse]` +- New struct `AutonomousDatabaseCrossRegionDisasterRecoveryProperties` +- New struct `AutonomousDatabaseFromBackupTimestampProperties` +- New struct `AzureSubscriptions` +- New struct `DbActionResponse` +- New struct `DbNodeDetails` +- New struct `DefinedFileSystemConfiguration` +- New struct `DisasterRecoveryConfigurationDetails` +- New struct `ExadbVMCluster` +- New struct `ExadbVMClusterListResult` +- New struct `ExadbVMClusterProperties` +- New struct `ExadbVMClusterStorageDetails` +- New struct `ExadbVMClusterUpdate` +- New struct `ExadbVMClusterUpdateProperties` +- New struct `ExascaleDbNode` +- New struct `ExascaleDbNodeListResult` +- New struct `ExascaleDbNodeProperties` +- New struct `ExascaleDbStorageDetails` +- New struct `ExascaleDbStorageInputDetails` +- New struct `ExascaleDbStorageVault` +- New struct `ExascaleDbStorageVaultListResult` +- New struct `ExascaleDbStorageVaultProperties` +- New struct `ExascaleDbStorageVaultTagsUpdate` +- New struct `FileSystemConfigurationDetails` +- New struct `FlexComponent` +- New struct `FlexComponentListResult` +- New struct `FlexComponentProperties` +- New struct `GiMinorVersion` +- New struct `GiMinorVersionListResult` +- New struct `GiMinorVersionProperties` +- New struct `RemoveVirtualMachineFromExadbVMClusterDetails` +- New field `ID`, `Name`, `SystemData`, `Type` in struct `AutonomousDatabaseBackupUpdate` +- New field `RemoteDisasterRecoveryConfiguration`, `TimeDisasterRecoveryRoleChanged` in struct `AutonomousDatabaseCloneProperties` +- New field `RemoteDisasterRecoveryConfiguration`, `TimeDisasterRecoveryRoleChanged` in struct `AutonomousDatabaseProperties` +- New field `ComputeModel`, `DatabaseServerType`, `DefinedFileSystemConfiguration`, `StorageServerType` in struct `CloudExadataInfrastructureProperties` +- New field `ComputeModel`, `FileSystemConfigurationDetails` in struct `CloudVMClusterProperties` +- New field `FileSystemConfigurationDetails` in struct `CloudVMClusterUpdateProperties` +- New field `ComputeModel` in struct `DbServerProperties` +- New field `AreServerTypesSupported`, `ComputeModel`, `DisplayName`, `ShapeName` in struct `DbSystemShapeProperties` +- New field `Zone` in struct `DbSystemShapesClientListByLocationOptions` +- New field `Shape`, `Zone` in struct `GiVersionsClientListByLocationOptions` +- New field `AddSubscriptionOperationState`, `AzureSubscriptionIDs`, `LastOperationStatusDetail` in struct `OracleSubscriptionProperties` +- New field `PeerDbLocation`, `PeerDbOcid` in struct `PeerDbDetails` + + ## 1.0.0 (2024-06-28) ### Other Changes diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/README.md b/sdk/resourcemanager/oracledatabase/armoracledatabase/README.md index 98d27c777970..f0ee4ce2399f 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/README.md +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Oracle Database module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2 ``` ## Authorization diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client.go index d58cf43d6ebc..cb90704da4f9 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAutonomousDatabaseBackupsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Create a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - adbbackupid - AutonomousDatabaseBackup id @@ -74,7 +71,7 @@ func (client *AutonomousDatabaseBackupsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Create a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabaseBackupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, resource AutonomousDatabaseBackup, options *AutonomousDatabaseBackupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabaseBackupsClient.BeginCreateOrUpdate" @@ -97,7 +94,7 @@ func (client *AutonomousDatabaseBackupsClient) createOrUpdate(ctx context.Contex } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AutonomousDatabaseBackupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, resource AutonomousDatabaseBackup, options *AutonomousDatabaseBackupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseBackupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, resource AutonomousDatabaseBackup, _ *AutonomousDatabaseBackupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -120,7 +117,7 @@ func (client *AutonomousDatabaseBackupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -132,7 +129,7 @@ func (client *AutonomousDatabaseBackupsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Delete a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - adbbackupid - AutonomousDatabaseBackup id @@ -159,7 +156,7 @@ func (client *AutonomousDatabaseBackupsClient) BeginDelete(ctx context.Context, // Delete - Delete a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabaseBackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, options *AutonomousDatabaseBackupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabaseBackupsClient.BeginDelete" @@ -182,7 +179,7 @@ func (client *AutonomousDatabaseBackupsClient) deleteOperation(ctx context.Conte } // deleteCreateRequest creates the Delete request. -func (client *AutonomousDatabaseBackupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, options *AutonomousDatabaseBackupsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseBackupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, _ *AutonomousDatabaseBackupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -205,7 +202,7 @@ func (client *AutonomousDatabaseBackupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *AutonomousDatabaseBackupsClient) deleteCreateRequest(ctx context.C // Get - Get a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - adbbackupid - AutonomousDatabaseBackup id @@ -243,7 +240,7 @@ func (client *AutonomousDatabaseBackupsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *AutonomousDatabaseBackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, options *AutonomousDatabaseBackupsClientGetOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseBackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, _ *AutonomousDatabaseBackupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -266,7 +263,7 @@ func (client *AutonomousDatabaseBackupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,38 +278,38 @@ func (client *AutonomousDatabaseBackupsClient) getHandleResponse(resp *http.Resp return result, nil } -// NewListByAutonomousDatabasePager - List AutonomousDatabaseBackup resources by AutonomousDatabase +// NewListByParentPager - List AutonomousDatabaseBackup resources by AutonomousDatabase // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. -// - options - AutonomousDatabaseBackupsClientListByAutonomousDatabaseOptions contains the optional parameters for the AutonomousDatabaseBackupsClient.NewListByAutonomousDatabasePager +// - options - AutonomousDatabaseBackupsClientListByParentOptions contains the optional parameters for the AutonomousDatabaseBackupsClient.NewListByParentPager // method. -func (client *AutonomousDatabaseBackupsClient) NewListByAutonomousDatabasePager(resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabaseBackupsClientListByAutonomousDatabaseOptions) *runtime.Pager[AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse] { - return runtime.NewPager(runtime.PagingHandler[AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse]{ - More: func(page AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse) bool { +func (client *AutonomousDatabaseBackupsClient) NewListByParentPager(resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabaseBackupsClientListByParentOptions) *runtime.Pager[AutonomousDatabaseBackupsClientListByParentResponse] { + return runtime.NewPager(runtime.PagingHandler[AutonomousDatabaseBackupsClientListByParentResponse]{ + More: func(page AutonomousDatabaseBackupsClientListByParentResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse) (AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AutonomousDatabaseBackupsClient.NewListByAutonomousDatabasePager") + Fetcher: func(ctx context.Context, page *AutonomousDatabaseBackupsClientListByParentResponse) (AutonomousDatabaseBackupsClientListByParentResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AutonomousDatabaseBackupsClient.NewListByParentPager") nextLink := "" if page != nil { nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByAutonomousDatabaseCreateRequest(ctx, resourceGroupName, autonomousdatabasename, options) + return client.listByParentCreateRequest(ctx, resourceGroupName, autonomousdatabasename, options) }, nil) if err != nil { - return AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse{}, err + return AutonomousDatabaseBackupsClientListByParentResponse{}, err } - return client.listByAutonomousDatabaseHandleResponse(resp) + return client.listByParentHandleResponse(resp) }, Tracer: client.internal.Tracer(), }) } -// listByAutonomousDatabaseCreateRequest creates the ListByAutonomousDatabase request. -func (client *AutonomousDatabaseBackupsClient) listByAutonomousDatabaseCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabaseBackupsClientListByAutonomousDatabaseOptions) (*policy.Request, error) { +// listByParentCreateRequest creates the ListByParent request. +func (client *AutonomousDatabaseBackupsClient) listByParentCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, _ *AutonomousDatabaseBackupsClientListByParentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -331,17 +328,17 @@ func (client *AutonomousDatabaseBackupsClient) listByAutonomousDatabaseCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByAutonomousDatabaseHandleResponse handles the ListByAutonomousDatabase response. -func (client *AutonomousDatabaseBackupsClient) listByAutonomousDatabaseHandleResponse(resp *http.Response) (AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse, error) { - result := AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse{} +// listByParentHandleResponse handles the ListByParent response. +func (client *AutonomousDatabaseBackupsClient) listByParentHandleResponse(resp *http.Response) (AutonomousDatabaseBackupsClientListByParentResponse, error) { + result := AutonomousDatabaseBackupsClientListByParentResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AutonomousDatabaseBackupListResult); err != nil { - return AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse{}, err + return AutonomousDatabaseBackupsClientListByParentResponse{}, err } return result, nil } @@ -349,7 +346,7 @@ func (client *AutonomousDatabaseBackupsClient) listByAutonomousDatabaseHandleRes // BeginUpdate - Update a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - adbbackupid - AutonomousDatabaseBackup id @@ -377,7 +374,7 @@ func (client *AutonomousDatabaseBackupsClient) BeginUpdate(ctx context.Context, // Update - Update a AutonomousDatabaseBackup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabaseBackupsClient) update(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, properties AutonomousDatabaseBackupUpdate, options *AutonomousDatabaseBackupsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabaseBackupsClient.BeginUpdate" @@ -400,7 +397,7 @@ func (client *AutonomousDatabaseBackupsClient) update(ctx context.Context, resou } // updateCreateRequest creates the Update request. -func (client *AutonomousDatabaseBackupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, properties AutonomousDatabaseBackupUpdate, options *AutonomousDatabaseBackupsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseBackupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, properties AutonomousDatabaseBackupUpdate, _ *AutonomousDatabaseBackupsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -423,7 +420,7 @@ func (client *AutonomousDatabaseBackupsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client_example_test.go deleted file mode 100644 index 75398af87322..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasebackups_client_example_test.go +++ /dev/null @@ -1,226 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_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/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_listByParent.json -func ExampleAutonomousDatabaseBackupsClient_NewListByAutonomousDatabasePager_autonomousDatabaseBackupsListByAutonomousDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabaseBackupsClient().NewListByAutonomousDatabasePager("rg000", "databasedb1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseBackupListResult = armoracledatabase.AutonomousDatabaseBackupListResult{ - // Value: []*armoracledatabase.AutonomousDatabaseBackup{ - // { - // Type: to.Ptr("Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1/autonomousDatabaseBackups/1711644130"), - // Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - // AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - // BackupType: to.Ptr(armoracledatabase.AutonomousDatabaseBackupTypeFull), - // DatabaseSizeInTbs: to.Ptr[float64](2), - // DbVersion: to.Ptr("19.6.0.0"), - // DisplayName: to.Ptr("Nightly Backup"), - // IsAutomatic: to.Ptr(true), - // IsRestorable: to.Ptr(true), - // LifecycleDetails: to.Ptr("Backup completed successfully"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseBackupLifecycleStateActive), - // Ocid: to.Ptr("ocid1.autonomousdatabasebackup.oc1..aaaaaaaavwpj"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // RetentionPeriodInDays: to.Ptr[int32](365), - // SizeInTbs: to.Ptr[float64](2), - // TimeAvailableTil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T20:44:09.466Z"); return t}()), - // TimeEnded: to.Ptr("2024-01-09T20:44:09.466Z"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json -func ExampleAutonomousDatabaseBackupsClient_Get_autonomousDatabaseBackupsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabaseBackupsClient().Get(ctx, "rg000", "databasedb1", "1711644130", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseBackup = armoracledatabase.AutonomousDatabaseBackup{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1/autonomousDatabaseBackups/1711644130"), - // Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - // AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - // BackupType: to.Ptr(armoracledatabase.AutonomousDatabaseBackupTypeFull), - // DatabaseSizeInTbs: to.Ptr[float64](2), - // DbVersion: to.Ptr("19.6.0.0"), - // DisplayName: to.Ptr("Nightly Backup"), - // IsAutomatic: to.Ptr(true), - // IsRestorable: to.Ptr(true), - // LifecycleDetails: to.Ptr("Backup completed successfully"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseBackupLifecycleStateActive), - // Ocid: to.Ptr("ocid1.autonomousdatabasebackup.oc1..aaaaaaaavwpj"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // RetentionPeriodInDays: to.Ptr[int32](365), - // SizeInTbs: to.Ptr[float64](2), - // TimeAvailableTil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T20:44:09.466Z"); return t}()), - // TimeEnded: to.Ptr("2024-01-09T20:44:09.466Z"), - // TimeStarted: to.Ptr("2024-01-09T19:44:09.466Z"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_create.json -func ExampleAutonomousDatabaseBackupsClient_BeginCreateOrUpdate_autonomousDatabaseBackupsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabaseBackupsClient().BeginCreateOrUpdate(ctx, "rg000", "databasedb1", "1711644130", armoracledatabase.AutonomousDatabaseBackup{ - Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - DisplayName: to.Ptr("Nightly Backup"), - RetentionPeriodInDays: to.Ptr[int32](365), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseBackup = armoracledatabase.AutonomousDatabaseBackup{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1/autonomousDatabaseBackups/1711644130"), - // Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - // AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - // BackupType: to.Ptr(armoracledatabase.AutonomousDatabaseBackupTypeFull), - // DatabaseSizeInTbs: to.Ptr[float64](2), - // DbVersion: to.Ptr("19.6.0.0"), - // DisplayName: to.Ptr("Nightly Backup"), - // IsAutomatic: to.Ptr(true), - // IsRestorable: to.Ptr(true), - // LifecycleDetails: to.Ptr("Backup completed successfully"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseBackupLifecycleStateActive), - // Ocid: to.Ptr("ocid1.autonomousdatabasebackup.oc1..aaaaaaaavwpj"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // RetentionPeriodInDays: to.Ptr[int32](365), - // SizeInTbs: to.Ptr[float64](2), - // TimeAvailableTil: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-01-09T20:44:09.466Z"); return t}()), - // TimeEnded: to.Ptr("2024-01-09T20:44:09.466Z"), - // TimeStarted: to.Ptr("2024-01-09T19:44:09.466Z"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_patch.json -func ExampleAutonomousDatabaseBackupsClient_BeginUpdate_autonomousDatabaseBackupsUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabaseBackupsClient().BeginUpdate(ctx, "rg000", "databasedb1", "1711644130", armoracledatabase.AutonomousDatabaseBackupUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseBackup = armoracledatabase.AutonomousDatabaseBackup{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1/autonomousDatabaseBackups/1711644130"), - // Properties: &armoracledatabase.AutonomousDatabaseBackupProperties{ - // AutonomousDatabaseOcid: to.Ptr("ocid1.autonomousdatabase.oc1..aaaaa3klq"), - // BackupType: to.Ptr(armoracledatabase.AutonomousDatabaseBackupTypeFull), - // DatabaseSizeInTbs: to.Ptr[float64](2), - // DbVersion: to.Ptr("19.6.0.0"), - // DisplayName: to.Ptr("Nightly Backup"), - // IsAutomatic: to.Ptr(true), - // IsRestorable: to.Ptr(true), - // LifecycleDetails: to.Ptr("Backup updated successfully"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseBackupLifecycleStateActive), - // Ocid: to.Ptr("ocid1.autonomousdatabasebackup.oc1..aaaaaaaavwpj"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // RetentionPeriodInDays: to.Ptr[int32](400), - // SizeInTbs: to.Ptr[float64](2), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_delete.json -func ExampleAutonomousDatabaseBackupsClient_BeginDelete_autonomousDatabaseBackupsDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabaseBackupsClient().BeginDelete(ctx, "rg000", "databasedb1", "1711644130", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client.go index 702e11648ed2..b07c50e6443b 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAutonomousDatabaseCharacterSetsClient(subscriptionID string, credential // Get - Get a AutonomousDatabaseCharacterSet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - adbscharsetname - AutonomousDatabaseCharacterSet name // - options - AutonomousDatabaseCharacterSetsClientGetOptions contains the optional parameters for the AutonomousDatabaseCharacterSetsClient.Get @@ -74,7 +71,7 @@ func (client *AutonomousDatabaseCharacterSetsClient) Get(ctx context.Context, lo } // getCreateRequest creates the Get request. -func (client *AutonomousDatabaseCharacterSetsClient) getCreateRequest(ctx context.Context, location string, adbscharsetname string, options *AutonomousDatabaseCharacterSetsClientGetOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseCharacterSetsClient) getCreateRequest(ctx context.Context, location string, adbscharsetname string, _ *AutonomousDatabaseCharacterSetsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,7 +90,7 @@ func (client *AutonomousDatabaseCharacterSetsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,9 +105,9 @@ func (client *AutonomousDatabaseCharacterSetsClient) getHandleResponse(resp *htt return result, nil } -// NewListByLocationPager - List AutonomousDatabaseCharacterSet resources by Location +// NewListByLocationPager - List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - options - AutonomousDatabaseCharacterSetsClientListByLocationOptions contains the optional parameters for the AutonomousDatabaseCharacterSetsClient.NewListByLocationPager // method. @@ -138,7 +135,7 @@ func (client *AutonomousDatabaseCharacterSetsClient) NewListByLocationPager(loca } // listByLocationCreateRequest creates the ListByLocation request. -func (client *AutonomousDatabaseCharacterSetsClient) listByLocationCreateRequest(ctx context.Context, location string, options *AutonomousDatabaseCharacterSetsClientListByLocationOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseCharacterSetsClient) listByLocationCreateRequest(ctx context.Context, location string, _ *AutonomousDatabaseCharacterSetsClientListByLocationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -153,7 +150,7 @@ func (client *AutonomousDatabaseCharacterSetsClient) listByLocationCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client_example_test.go deleted file mode 100644 index 585ac7c2378b..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasecharactersets_client_example_test.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_listByLocation.json -func ExampleAutonomousDatabaseCharacterSetsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabaseCharacterSetsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseCharacterSetListResult = armoracledatabase.AutonomousDatabaseCharacterSetListResult{ - // Value: []*armoracledatabase.AutonomousDatabaseCharacterSet{ - // { - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseCharacterSets/DATABASE"), - // Properties: &armoracledatabase.AutonomousDatabaseCharacterSetProperties{ - // CharacterSet: to.Ptr("AL32UTF8"), - // }, - // }, - // { - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseCharacterSets/DATABASE"), - // Properties: &armoracledatabase.AutonomousDatabaseCharacterSetProperties{ - // CharacterSet: to.Ptr("UTF8"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_get.json -func ExampleAutonomousDatabaseCharacterSetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabaseCharacterSetsClient().Get(ctx, "eastus", "DATABASE", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseCharacterSet = armoracledatabase.AutonomousDatabaseCharacterSet{ - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseCharacterSets/DATABASE"), - // Properties: &armoracledatabase.AutonomousDatabaseCharacterSetProperties{ - // CharacterSet: to.Ptr("AL32UTF8"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client.go index 9b5a8455510d..d0b27f70f5eb 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAutonomousDatabaseNationalCharacterSetsClient(subscriptionID string, cre // Get - Get a AutonomousDatabaseNationalCharacterSet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - adbsncharsetname - AutonomousDatabaseNationalCharacterSets name // - options - AutonomousDatabaseNationalCharacterSetsClientGetOptions contains the optional parameters for the AutonomousDatabaseNationalCharacterSetsClient.Get @@ -74,7 +71,7 @@ func (client *AutonomousDatabaseNationalCharacterSetsClient) Get(ctx context.Con } // getCreateRequest creates the Get request. -func (client *AutonomousDatabaseNationalCharacterSetsClient) getCreateRequest(ctx context.Context, location string, adbsncharsetname string, options *AutonomousDatabaseNationalCharacterSetsClientGetOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseNationalCharacterSetsClient) getCreateRequest(ctx context.Context, location string, adbsncharsetname string, _ *AutonomousDatabaseNationalCharacterSetsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,7 +90,7 @@ func (client *AutonomousDatabaseNationalCharacterSetsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,9 +105,9 @@ func (client *AutonomousDatabaseNationalCharacterSetsClient) getHandleResponse(r return result, nil } -// NewListByLocationPager - List AutonomousDatabaseNationalCharacterSet resources by Location +// NewListByLocationPager - List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - options - AutonomousDatabaseNationalCharacterSetsClientListByLocationOptions contains the optional parameters for the AutonomousDatabaseNationalCharacterSetsClient.NewListByLocationPager // method. @@ -138,7 +135,7 @@ func (client *AutonomousDatabaseNationalCharacterSetsClient) NewListByLocationPa } // listByLocationCreateRequest creates the ListByLocation request. -func (client *AutonomousDatabaseNationalCharacterSetsClient) listByLocationCreateRequest(ctx context.Context, location string, options *AutonomousDatabaseNationalCharacterSetsClientListByLocationOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseNationalCharacterSetsClient) listByLocationCreateRequest(ctx context.Context, location string, _ *AutonomousDatabaseNationalCharacterSetsClientListByLocationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -153,7 +150,7 @@ func (client *AutonomousDatabaseNationalCharacterSetsClient) listByLocationCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client_example_test.go deleted file mode 100644 index 19a978249b59..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabasenationalcharactersets_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_listByLocation.json -func ExampleAutonomousDatabaseNationalCharacterSetsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabaseNationalCharacterSetsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseNationalCharacterSetListResult = armoracledatabase.AutonomousDatabaseNationalCharacterSetListResult{ - // Value: []*armoracledatabase.AutonomousDatabaseNationalCharacterSet{ - // { - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseNationalCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseNationalCharacterSets/NATIONAL"), - // Properties: &armoracledatabase.AutonomousDatabaseNationalCharacterSetProperties{ - // CharacterSet: to.Ptr("AL16UTF16"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_get.json -func ExampleAutonomousDatabaseNationalCharacterSetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabaseNationalCharacterSetsClient().Get(ctx, "eastus", "NATIONAL", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseNationalCharacterSet = armoracledatabase.AutonomousDatabaseNationalCharacterSet{ - // Type: to.Ptr("Oracle.Database/locations/autonomousDatabaseNationalCharacterSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDatabaseNationalCharacterSets/NATIONAL"), - // Properties: &armoracledatabase.AutonomousDatabaseNationalCharacterSetProperties{ - // CharacterSet: to.Ptr("AL16UTF16"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client.go index 63903cb2797c..3ca51b2ea4b9 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -43,10 +40,91 @@ func NewAutonomousDatabasesClient(subscriptionID string, credential azcore.Token return client, nil } +// BeginChangeDisasterRecoveryConfiguration - Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - autonomousdatabasename - The database name. +// - body - The content of the action request +// - options - AutonomousDatabasesClientBeginChangeDisasterRecoveryConfigurationOptions contains the optional parameters for +// the AutonomousDatabasesClient.BeginChangeDisasterRecoveryConfiguration method. +func (client *AutonomousDatabasesClient) BeginChangeDisasterRecoveryConfiguration(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body DisasterRecoveryConfigurationDetails, options *AutonomousDatabasesClientBeginChangeDisasterRecoveryConfigurationOptions) (*runtime.Poller[AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.changeDisasterRecoveryConfiguration(ctx, resourceGroupName, autonomousdatabasename, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// ChangeDisasterRecoveryConfiguration - Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *AutonomousDatabasesClient) changeDisasterRecoveryConfiguration(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body DisasterRecoveryConfigurationDetails, options *AutonomousDatabasesClientBeginChangeDisasterRecoveryConfigurationOptions) (*http.Response, error) { + var err error + const operationName = "AutonomousDatabasesClient.BeginChangeDisasterRecoveryConfiguration" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.changeDisasterRecoveryConfigurationCreateRequest(ctx, resourceGroupName, autonomousdatabasename, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// changeDisasterRecoveryConfigurationCreateRequest creates the ChangeDisasterRecoveryConfiguration request. +func (client *AutonomousDatabasesClient) changeDisasterRecoveryConfigurationCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body DisasterRecoveryConfigurationDetails, _ *AutonomousDatabasesClientBeginChangeDisasterRecoveryConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/changeDisasterRecoveryConfiguration" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if autonomousdatabasename == "" { + return nil, errors.New("parameter autonomousdatabasename cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{autonomousdatabasename}", url.PathEscape(autonomousdatabasename)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + // BeginCreateOrUpdate - Create a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - resource - Resource create parameters. @@ -73,7 +151,7 @@ func (client *AutonomousDatabasesClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, autonomousdatabasename string, resource AutonomousDatabase, options *AutonomousDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginCreateOrUpdate" @@ -96,7 +174,7 @@ func (client *AutonomousDatabasesClient) createOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AutonomousDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, resource AutonomousDatabase, options *AutonomousDatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, resource AutonomousDatabase, _ *AutonomousDatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +193,7 @@ func (client *AutonomousDatabasesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +205,7 @@ func (client *AutonomousDatabasesClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - options - AutonomousDatabasesClientBeginDeleteOptions contains the optional parameters for the AutonomousDatabasesClient.BeginDelete @@ -153,7 +231,7 @@ func (client *AutonomousDatabasesClient) BeginDelete(ctx context.Context, resour // Delete - Delete a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabasesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginDelete" @@ -176,7 +254,7 @@ func (client *AutonomousDatabasesClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *AutonomousDatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabasesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, _ *AutonomousDatabasesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -195,7 +273,7 @@ func (client *AutonomousDatabasesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +282,7 @@ func (client *AutonomousDatabasesClient) deleteCreateRequest(ctx context.Context // BeginFailover - Perform failover action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - body - The content of the action request @@ -231,7 +309,7 @@ func (client *AutonomousDatabasesClient) BeginFailover(ctx context.Context, reso // Failover - Perform failover action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabasesClient) failover(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body PeerDbDetails, options *AutonomousDatabasesClientBeginFailoverOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginFailover" @@ -254,7 +332,7 @@ func (client *AutonomousDatabasesClient) failover(ctx context.Context, resourceG } // failoverCreateRequest creates the Failover request. -func (client *AutonomousDatabasesClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body PeerDbDetails, options *AutonomousDatabasesClientBeginFailoverOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body PeerDbDetails, _ *AutonomousDatabasesClientBeginFailoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/failover" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -273,7 +351,7 @@ func (client *AutonomousDatabasesClient) failoverCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -285,7 +363,7 @@ func (client *AutonomousDatabasesClient) failoverCreateRequest(ctx context.Conte // GenerateWallet - Generate wallet action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - body - The content of the action request @@ -314,7 +392,7 @@ func (client *AutonomousDatabasesClient) GenerateWallet(ctx context.Context, res } // generateWalletCreateRequest creates the GenerateWallet request. -func (client *AutonomousDatabasesClient) generateWalletCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body GenerateAutonomousDatabaseWalletDetails, options *AutonomousDatabasesClientGenerateWalletOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) generateWalletCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body GenerateAutonomousDatabaseWalletDetails, _ *AutonomousDatabasesClientGenerateWalletOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/generateWallet" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -333,7 +411,7 @@ func (client *AutonomousDatabasesClient) generateWalletCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -354,7 +432,7 @@ func (client *AutonomousDatabasesClient) generateWalletHandleResponse(resp *http // Get - Get a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - options - AutonomousDatabasesClientGetOptions contains the optional parameters for the AutonomousDatabasesClient.Get method. @@ -381,7 +459,7 @@ func (client *AutonomousDatabasesClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *AutonomousDatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabasesClientGetOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, _ *AutonomousDatabasesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -400,7 +478,7 @@ func (client *AutonomousDatabasesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -417,7 +495,7 @@ func (client *AutonomousDatabasesClient) getHandleResponse(resp *http.Response) // NewListByResourceGroupPager - List AutonomousDatabase resources by resource group // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AutonomousDatabasesClientListByResourceGroupOptions contains the optional parameters for the AutonomousDatabasesClient.NewListByResourceGroupPager // method. @@ -445,7 +523,7 @@ func (client *AutonomousDatabasesClient) NewListByResourceGroupPager(resourceGro } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AutonomousDatabasesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AutonomousDatabasesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *AutonomousDatabasesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -460,7 +538,7 @@ func (client *AutonomousDatabasesClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -477,7 +555,7 @@ func (client *AutonomousDatabasesClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionPager - List AutonomousDatabase resources by subscription ID // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - AutonomousDatabasesClientListBySubscriptionOptions contains the optional parameters for the AutonomousDatabasesClient.NewListBySubscriptionPager // method. func (client *AutonomousDatabasesClient) NewListBySubscriptionPager(options *AutonomousDatabasesClientListBySubscriptionOptions) *runtime.Pager[AutonomousDatabasesClientListBySubscriptionResponse] { @@ -504,7 +582,7 @@ func (client *AutonomousDatabasesClient) NewListBySubscriptionPager(options *Aut } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *AutonomousDatabasesClient) listBySubscriptionCreateRequest(ctx context.Context, options *AutonomousDatabasesClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) listBySubscriptionCreateRequest(ctx context.Context, _ *AutonomousDatabasesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/autonomousDatabases" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -515,7 +593,7 @@ func (client *AutonomousDatabasesClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -533,7 +611,7 @@ func (client *AutonomousDatabasesClient) listBySubscriptionHandleResponse(resp * // BeginRestore - Restores an Autonomous Database based on the provided request parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - body - The content of the action request @@ -560,7 +638,7 @@ func (client *AutonomousDatabasesClient) BeginRestore(ctx context.Context, resou // Restore - Restores an Autonomous Database based on the provided request parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabasesClient) restore(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body RestoreAutonomousDatabaseDetails, options *AutonomousDatabasesClientBeginRestoreOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginRestore" @@ -583,7 +661,7 @@ func (client *AutonomousDatabasesClient) restore(ctx context.Context, resourceGr } // restoreCreateRequest creates the Restore request. -func (client *AutonomousDatabasesClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body RestoreAutonomousDatabaseDetails, options *AutonomousDatabasesClientBeginRestoreOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body RestoreAutonomousDatabaseDetails, _ *AutonomousDatabasesClientBeginRestoreOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/restore" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -602,7 +680,7 @@ func (client *AutonomousDatabasesClient) restoreCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -614,7 +692,7 @@ func (client *AutonomousDatabasesClient) restoreCreateRequest(ctx context.Contex // BeginShrink - This operation shrinks the current allocated storage down to the current actual used data storage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - options - AutonomousDatabasesClientBeginShrinkOptions contains the optional parameters for the AutonomousDatabasesClient.BeginShrink @@ -640,7 +718,7 @@ func (client *AutonomousDatabasesClient) BeginShrink(ctx context.Context, resour // Shrink - This operation shrinks the current allocated storage down to the current actual used data storage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabasesClient) shrink(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabasesClientBeginShrinkOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginShrink" @@ -663,7 +741,7 @@ func (client *AutonomousDatabasesClient) shrink(ctx context.Context, resourceGro } // shrinkCreateRequest creates the Shrink request. -func (client *AutonomousDatabasesClient) shrinkCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *AutonomousDatabasesClientBeginShrinkOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) shrinkCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, _ *AutonomousDatabasesClientBeginShrinkOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/shrink" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -682,7 +760,7 @@ func (client *AutonomousDatabasesClient) shrinkCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -691,7 +769,7 @@ func (client *AutonomousDatabasesClient) shrinkCreateRequest(ctx context.Context // BeginSwitchover - Perform switchover action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - body - The content of the action request @@ -718,7 +796,7 @@ func (client *AutonomousDatabasesClient) BeginSwitchover(ctx context.Context, re // Switchover - Perform switchover action on Autonomous Database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabasesClient) switchover(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body PeerDbDetails, options *AutonomousDatabasesClientBeginSwitchoverOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginSwitchover" @@ -741,7 +819,7 @@ func (client *AutonomousDatabasesClient) switchover(ctx context.Context, resourc } // switchoverCreateRequest creates the Switchover request. -func (client *AutonomousDatabasesClient) switchoverCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body PeerDbDetails, options *AutonomousDatabasesClientBeginSwitchoverOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) switchoverCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body PeerDbDetails, _ *AutonomousDatabasesClientBeginSwitchoverOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/switchover" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -760,7 +838,7 @@ func (client *AutonomousDatabasesClient) switchoverCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -772,7 +850,7 @@ func (client *AutonomousDatabasesClient) switchoverCreateRequest(ctx context.Con // BeginUpdate - Update a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - autonomousdatabasename - The database name. // - properties - The resource properties to be updated. @@ -799,7 +877,7 @@ func (client *AutonomousDatabasesClient) BeginUpdate(ctx context.Context, resour // Update - Update a AutonomousDatabase // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *AutonomousDatabasesClient) update(ctx context.Context, resourceGroupName string, autonomousdatabasename string, properties AutonomousDatabaseUpdate, options *AutonomousDatabasesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AutonomousDatabasesClient.BeginUpdate" @@ -822,7 +900,7 @@ func (client *AutonomousDatabasesClient) update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *AutonomousDatabasesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, properties AutonomousDatabaseUpdate, options *AutonomousDatabasesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AutonomousDatabasesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, autonomousdatabasename string, properties AutonomousDatabaseUpdate, _ *AutonomousDatabasesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -841,7 +919,7 @@ func (client *AutonomousDatabasesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client_example_test.go deleted file mode 100644 index 46bb0e233563..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabases_client_example_test.go +++ /dev/null @@ -1,783 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listBySubscription.json -func ExampleAutonomousDatabasesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabasesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseListResult = armoracledatabase.AutonomousDatabaseListResult{ - // Value: []*armoracledatabase.AutonomousDatabase{ - // { - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listByResourceGroup.json -func ExampleAutonomousDatabasesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabasesClient().NewListByResourceGroupPager("rg000", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDatabaseListResult = armoracledatabase.AutonomousDatabaseListResult{ - // Value: []*armoracledatabase.AutonomousDatabase{ - // { - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json -func ExampleAutonomousDatabasesClient_Get_autonomousDatabasesGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabasesClient().Get(ctx, "rg000", "databasedb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_create.json -func ExampleAutonomousDatabasesClient_BeginCreateOrUpdate_autonomousDatabasesCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginCreateOrUpdate(ctx, "rg000", "databasedb1", armoracledatabase.AutonomousDatabase{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagK1": to.Ptr("tagV1"), - }, - Properties: &armoracledatabase.AutonomousDatabaseProperties{ - AdminPassword: to.Ptr("********"), - CharacterSet: to.Ptr("AL32UTF8"), - ComputeCount: to.Ptr[float32](2), - ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - DataStorageSizeInTbs: to.Ptr[int32](1), - DbVersion: to.Ptr("18.4.0.0"), - DisplayName: to.Ptr("example_autonomous_databasedb1"), - NcharacterSet: to.Ptr("AL16UTF16"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseClone_create.json -func ExampleAutonomousDatabasesClient_BeginCreateOrUpdate_autonomousDatabasesCreateOrUpdateClone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginCreateOrUpdate(ctx, "rg000", "databasedb1", armoracledatabase.AutonomousDatabase{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagK1": to.Ptr("tagV1"), - }, - Properties: &armoracledatabase.AutonomousDatabaseCloneProperties{ - AdminPassword: to.Ptr("********"), - CharacterSet: to.Ptr("AL32UTF8"), - ComputeCount: to.Ptr[float32](2), - ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeClone), - DataStorageSizeInTbs: to.Ptr[int32](1), - DisplayName: to.Ptr("example_autonomous_databasedb1_clone"), - NcharacterSet: to.Ptr("AL16UTF16"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - CloneType: to.Ptr(armoracledatabase.CloneTypeFull), - SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseCloneProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1Clone"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeClone), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // CloneType: to.Ptr(armoracledatabase.CloneTypeFull), - // SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_patch.json -func ExampleAutonomousDatabasesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginUpdate(ctx, "rg000", "databasedb1", armoracledatabase.AutonomousDatabaseUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleState("Succeeded")), - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_delete.json -func ExampleAutonomousDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginDelete(ctx, "rg000", "databasedb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_failover.json -func ExampleAutonomousDatabasesClient_BeginFailover_autonomousDatabasesFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginFailover(ctx, "rg000", "databasedb1", armoracledatabase.PeerDbDetails{ - PeerDbID: to.Ptr("peerDbId"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(true), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateUpdating), - // LocalAdgAutoFailoverMaxDataLossLimit: to.Ptr[int32](300), - // LocalDisasterRecoveryType: to.Ptr(armoracledatabase.DisasterRecoveryTypeAdg), - // LocalStandbyDb: &armoracledatabase.AutonomousDatabaseStandbySummary{ - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateRoleChangeInProgress), - // }, - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Role: to.Ptr(armoracledatabase.RoleTypePrimary), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // TimeLocalDataGuardEnabled: to.Ptr("2024-02-28T19:03:43.714Z"), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_generateWallet.json -func ExampleAutonomousDatabasesClient_GenerateWallet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabasesClient().GenerateWallet(ctx, "rg000", "databasedb1", armoracledatabase.GenerateAutonomousDatabaseWalletDetails{ - GenerateType: to.Ptr(armoracledatabase.GenerateTypeSingle), - IsRegional: to.Ptr(false), - Password: to.Ptr("********"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabaseWalletFile = armoracledatabase.AutonomousDatabaseWalletFile{ - // WalletFiles: to.Ptr("testEncodedFiles"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_restore.json -func ExampleAutonomousDatabasesClient_BeginRestore_autonomousDatabasesRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginRestore(ctx, "rg000", "databasedb1", armoracledatabase.RestoreAutonomousDatabaseDetails{ - Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-23T00:00:00.000Z"); return t }()), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // BackupRetentionPeriodInDays: to.Ptr[int32](60), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr(""), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateRestoreInProgress), - // LongTermBackupSchedule: &armoracledatabase.LongTermBackUpScheduleDetails{ - // RepeatCadence: to.Ptr(armoracledatabase.RepeatCadenceTypeWeekly), - // RetentionPeriodInDays: to.Ptr[int32](365), - // TimeOfBackup: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-21T21:03:41.309Z"); return t}()), - // }, - // NcharacterSet: to.Ptr("AL16UTF16"), - // NextLongTermBackupTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-24T21:03:41.000Z"); return t}()), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_shrink.json -func ExampleAutonomousDatabasesClient_BeginShrink() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginShrink(ctx, "rg000", "databasedb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // BackupRetentionPeriodInDays: to.Ptr[int32](90), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleDetails: to.Ptr(""), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateScaleInProgress), - // LongTermBackupSchedule: &armoracledatabase.LongTermBackUpScheduleDetails{ - // RepeatCadence: to.Ptr(armoracledatabase.RepeatCadenceTypeWeekly), - // RetentionPeriodInDays: to.Ptr[int32](365), - // TimeOfBackup: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-21T21:03:41.309Z"); return t}()), - // }, - // NcharacterSet: to.Ptr("AL16UTF16"), - // NextLongTermBackupTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-24T21:03:41.000Z"); return t}()), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_switchover.json -func ExampleAutonomousDatabasesClient_BeginSwitchover_autonomousDatabasesSwitchover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAutonomousDatabasesClient().BeginSwitchover(ctx, "rg000", "databasedb1", armoracledatabase.PeerDbDetails{ - PeerDbID: to.Ptr("peerDbId"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDatabase = armoracledatabase.AutonomousDatabase{ - // Type: to.Ptr("Oracle.Database/autonomousDatabases"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.AutonomousDatabaseProperties{ - // AutonomousDatabaseID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), - // AutonomousMaintenanceScheduleType: to.Ptr(armoracledatabase.AutonomousMaintenanceScheduleTypeRegular), - // CharacterSet: to.Ptr("AL32UTF8"), - // ComputeCount: to.Ptr[float32](2), - // ComputeModel: to.Ptr(armoracledatabase.ComputeModelECPU), - // CPUCoreCount: to.Ptr[int32](1), - // DataBaseType: to.Ptr(armoracledatabase.DataBaseTypeRegular), - // DataStorageSizeInGbs: to.Ptr[int32](1024), - // DataStorageSizeInTbs: to.Ptr[int32](1), - // DatabaseEdition: to.Ptr(armoracledatabase.DatabaseEditionTypeEnterpriseEdition), - // DbVersion: to.Ptr("18.4.0.0"), - // DisplayName: to.Ptr("example_autonomous_databasedb1"), - // IsAutoScalingEnabled: to.Ptr(false), - // IsAutoScalingForStorageEnabled: to.Ptr(false), - // IsLocalDataGuardEnabled: to.Ptr(false), - // IsMtlsConnectionRequired: to.Ptr(true), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelBringYourOwnLicense), - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateUpdating), - // LocalDisasterRecoveryType: to.Ptr(armoracledatabase.DisasterRecoveryTypeBackupBased), - // LocalStandbyDb: &armoracledatabase.AutonomousDatabaseStandbySummary{ - // LifecycleState: to.Ptr(armoracledatabase.AutonomousDatabaseLifecycleStateRoleChangeInProgress), - // }, - // NcharacterSet: to.Ptr("AL16UTF16"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Role: to.Ptr(armoracledatabase.RoleTypePrimary), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-09T20:44:09.466Z"); return t}()), - // TimeOfLastSwitchover: to.Ptr("2024-02-27T18:37:08.069Z"), - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // WhitelistedIPs: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.0/24"), - // to.Ptr("1.1.2.25")}, - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client.go index f0a5ec4d4ac7..6074e67bbf02 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAutonomousDatabaseVersionsClient(subscriptionID string, credential azcor // Get - Get a AutonomousDbVersion // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - autonomousdbversionsname - AutonomousDbVersion name // - options - AutonomousDatabaseVersionsClientGetOptions contains the optional parameters for the AutonomousDatabaseVersionsClient.Get @@ -74,7 +71,7 @@ func (client *AutonomousDatabaseVersionsClient) Get(ctx context.Context, locatio } // getCreateRequest creates the Get request. -func (client *AutonomousDatabaseVersionsClient) getCreateRequest(ctx context.Context, location string, autonomousdbversionsname string, options *AutonomousDatabaseVersionsClientGetOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseVersionsClient) getCreateRequest(ctx context.Context, location string, autonomousdbversionsname string, _ *AutonomousDatabaseVersionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,7 +90,7 @@ func (client *AutonomousDatabaseVersionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,9 +105,9 @@ func (client *AutonomousDatabaseVersionsClient) getHandleResponse(resp *http.Res return result, nil } -// NewListByLocationPager - List AutonomousDbVersion resources by Location +// NewListByLocationPager - List AutonomousDbVersion resources by SubscriptionLocationResource // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - options - AutonomousDatabaseVersionsClientListByLocationOptions contains the optional parameters for the AutonomousDatabaseVersionsClient.NewListByLocationPager // method. @@ -138,7 +135,7 @@ func (client *AutonomousDatabaseVersionsClient) NewListByLocationPager(location } // listByLocationCreateRequest creates the ListByLocation request. -func (client *AutonomousDatabaseVersionsClient) listByLocationCreateRequest(ctx context.Context, location string, options *AutonomousDatabaseVersionsClientListByLocationOptions) (*policy.Request, error) { +func (client *AutonomousDatabaseVersionsClient) listByLocationCreateRequest(ctx context.Context, location string, _ *AutonomousDatabaseVersionsClientListByLocationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -153,7 +150,7 @@ func (client *AutonomousDatabaseVersionsClient) listByLocationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client_example_test.go deleted file mode 100644 index b1fecf02bc8f..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autonomousdatabaseversions_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_listByLocation.json -func ExampleAutonomousDatabaseVersionsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutonomousDatabaseVersionsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutonomousDbVersionListResult = armoracledatabase.AutonomousDbVersionListResult{ - // Value: []*armoracledatabase.AutonomousDbVersion{ - // { - // Type: to.Ptr("Oracle.Database/locations/autonomousDbVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDbVersions/18.4.0.0"), - // Properties: &armoracledatabase.AutonomousDbVersionProperties{ - // Version: to.Ptr("18.4.0.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_get.json -func ExampleAutonomousDatabaseVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutonomousDatabaseVersionsClient().Get(ctx, "eastus", "18.4.0.0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutonomousDbVersion = armoracledatabase.AutonomousDbVersion{ - // Type: to.Ptr("Oracle.Database/locations/autonomousDbVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/locations/eastus/autonomousDbVersions/18.4.0.0"), - // Properties: &armoracledatabase.AutonomousDbVersionProperties{ - // Version: to.Ptr("18.4.0.0"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/autorest.md b/sdk/resourcemanager/oracledatabase/armoracledatabase/autorest.md index ed61e73ab132..13cc70929b67 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/autorest.md +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/oracle/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/oracle/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-09-01 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/client_factory.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/client_factory.go index 30688bbe83a5..db5fe5b8f4d4 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/client_factory.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/client_factory.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -132,6 +129,46 @@ func (c *ClientFactory) NewDbSystemShapesClient() *DbSystemShapesClient { } } +// NewExadbVMClustersClient creates a new instance of ExadbVMClustersClient. +func (c *ClientFactory) NewExadbVMClustersClient() *ExadbVMClustersClient { + return &ExadbVMClustersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewExascaleDbNodesClient creates a new instance of ExascaleDbNodesClient. +func (c *ClientFactory) NewExascaleDbNodesClient() *ExascaleDbNodesClient { + return &ExascaleDbNodesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewExascaleDbStorageVaultsClient creates a new instance of ExascaleDbStorageVaultsClient. +func (c *ClientFactory) NewExascaleDbStorageVaultsClient() *ExascaleDbStorageVaultsClient { + return &ExascaleDbStorageVaultsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewFlexComponentsClient creates a new instance of FlexComponentsClient. +func (c *ClientFactory) NewFlexComponentsClient() *FlexComponentsClient { + return &FlexComponentsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewGiMinorVersionsClient creates a new instance of GiMinorVersionsClient. +func (c *ClientFactory) NewGiMinorVersionsClient() *GiMinorVersionsClient { + return &GiMinorVersionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewGiVersionsClient creates a new instance of GiVersionsClient. func (c *ClientFactory) NewGiVersionsClient() *GiVersionsClient { return &GiVersionsClient{ diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client.go index 0360d1e588a8..216d21d9dfc0 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewCloudExadataInfrastructuresClient(subscriptionID string, credential azco // BeginAddStorageCapacity - Perform add storage capacity on exadata infra // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - options - CloudExadataInfrastructuresClientBeginAddStorageCapacityOptions contains the optional parameters for the CloudExadataInfrastructuresClient.BeginAddStorageCapacity @@ -72,7 +69,7 @@ func (client *CloudExadataInfrastructuresClient) BeginAddStorageCapacity(ctx con // AddStorageCapacity - Perform add storage capacity on exadata infra // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudExadataInfrastructuresClient) addStorageCapacity(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *CloudExadataInfrastructuresClientBeginAddStorageCapacityOptions) (*http.Response, error) { var err error const operationName = "CloudExadataInfrastructuresClient.BeginAddStorageCapacity" @@ -95,7 +92,7 @@ func (client *CloudExadataInfrastructuresClient) addStorageCapacity(ctx context. } // addStorageCapacityCreateRequest creates the AddStorageCapacity request. -func (client *CloudExadataInfrastructuresClient) addStorageCapacityCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *CloudExadataInfrastructuresClientBeginAddStorageCapacityOptions) (*policy.Request, error) { +func (client *CloudExadataInfrastructuresClient) addStorageCapacityCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, _ *CloudExadataInfrastructuresClientBeginAddStorageCapacityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/addStorageCapacity" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -114,7 +111,7 @@ func (client *CloudExadataInfrastructuresClient) addStorageCapacityCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +120,7 @@ func (client *CloudExadataInfrastructuresClient) addStorageCapacityCreateRequest // BeginCreateOrUpdate - Create a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - resource - Resource create parameters. @@ -150,7 +147,7 @@ func (client *CloudExadataInfrastructuresClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Create a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudExadataInfrastructuresClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, resource CloudExadataInfrastructure, options *CloudExadataInfrastructuresClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudExadataInfrastructuresClient.BeginCreateOrUpdate" @@ -173,7 +170,7 @@ func (client *CloudExadataInfrastructuresClient) createOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CloudExadataInfrastructuresClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, resource CloudExadataInfrastructure, options *CloudExadataInfrastructuresClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *CloudExadataInfrastructuresClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, resource CloudExadataInfrastructure, _ *CloudExadataInfrastructuresClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -192,7 +189,7 @@ func (client *CloudExadataInfrastructuresClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -204,7 +201,7 @@ func (client *CloudExadataInfrastructuresClient) createOrUpdateCreateRequest(ctx // BeginDelete - Delete a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - options - CloudExadataInfrastructuresClientBeginDeleteOptions contains the optional parameters for the CloudExadataInfrastructuresClient.BeginDelete @@ -230,7 +227,7 @@ func (client *CloudExadataInfrastructuresClient) BeginDelete(ctx context.Context // Delete - Delete a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudExadataInfrastructuresClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *CloudExadataInfrastructuresClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudExadataInfrastructuresClient.BeginDelete" @@ -253,7 +250,7 @@ func (client *CloudExadataInfrastructuresClient) deleteOperation(ctx context.Con } // deleteCreateRequest creates the Delete request. -func (client *CloudExadataInfrastructuresClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *CloudExadataInfrastructuresClientBeginDeleteOptions) (*policy.Request, error) { +func (client *CloudExadataInfrastructuresClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, _ *CloudExadataInfrastructuresClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -272,7 +269,7 @@ func (client *CloudExadataInfrastructuresClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +278,7 @@ func (client *CloudExadataInfrastructuresClient) deleteCreateRequest(ctx context // Get - Get a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - options - CloudExadataInfrastructuresClientGetOptions contains the optional parameters for the CloudExadataInfrastructuresClient.Get @@ -309,7 +306,7 @@ func (client *CloudExadataInfrastructuresClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *CloudExadataInfrastructuresClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *CloudExadataInfrastructuresClientGetOptions) (*policy.Request, error) { +func (client *CloudExadataInfrastructuresClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, _ *CloudExadataInfrastructuresClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -328,7 +325,7 @@ func (client *CloudExadataInfrastructuresClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +342,7 @@ func (client *CloudExadataInfrastructuresClient) getHandleResponse(resp *http.Re // NewListByResourceGroupPager - List CloudExadataInfrastructure resources by resource group // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CloudExadataInfrastructuresClientListByResourceGroupOptions contains the optional parameters for the CloudExadataInfrastructuresClient.NewListByResourceGroupPager // method. @@ -373,7 +370,7 @@ func (client *CloudExadataInfrastructuresClient) NewListByResourceGroupPager(res } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *CloudExadataInfrastructuresClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CloudExadataInfrastructuresClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *CloudExadataInfrastructuresClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *CloudExadataInfrastructuresClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -388,7 +385,7 @@ func (client *CloudExadataInfrastructuresClient) listByResourceGroupCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -405,7 +402,7 @@ func (client *CloudExadataInfrastructuresClient) listByResourceGroupHandleRespon // NewListBySubscriptionPager - List CloudExadataInfrastructure resources by subscription ID // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - CloudExadataInfrastructuresClientListBySubscriptionOptions contains the optional parameters for the CloudExadataInfrastructuresClient.NewListBySubscriptionPager // method. func (client *CloudExadataInfrastructuresClient) NewListBySubscriptionPager(options *CloudExadataInfrastructuresClientListBySubscriptionOptions) *runtime.Pager[CloudExadataInfrastructuresClientListBySubscriptionResponse] { @@ -432,7 +429,7 @@ func (client *CloudExadataInfrastructuresClient) NewListBySubscriptionPager(opti } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *CloudExadataInfrastructuresClient) listBySubscriptionCreateRequest(ctx context.Context, options *CloudExadataInfrastructuresClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *CloudExadataInfrastructuresClient) listBySubscriptionCreateRequest(ctx context.Context, _ *CloudExadataInfrastructuresClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -443,7 +440,7 @@ func (client *CloudExadataInfrastructuresClient) listBySubscriptionCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -461,7 +458,7 @@ func (client *CloudExadataInfrastructuresClient) listBySubscriptionHandleRespons // BeginUpdate - Update a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - properties - The resource properties to be updated. @@ -488,7 +485,7 @@ func (client *CloudExadataInfrastructuresClient) BeginUpdate(ctx context.Context // Update - Update a CloudExadataInfrastructure // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudExadataInfrastructuresClient) update(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, properties CloudExadataInfrastructureUpdate, options *CloudExadataInfrastructuresClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudExadataInfrastructuresClient.BeginUpdate" @@ -511,7 +508,7 @@ func (client *CloudExadataInfrastructuresClient) update(ctx context.Context, res } // updateCreateRequest creates the Update request. -func (client *CloudExadataInfrastructuresClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, properties CloudExadataInfrastructureUpdate, options *CloudExadataInfrastructuresClientBeginUpdateOptions) (*policy.Request, error) { +func (client *CloudExadataInfrastructuresClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, properties CloudExadataInfrastructureUpdate, _ *CloudExadataInfrastructuresClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -530,7 +527,7 @@ func (client *CloudExadataInfrastructuresClient) updateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client_example_test.go deleted file mode 100644 index 1e2370003e56..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudexadatainfrastructures_client_example_test.go +++ /dev/null @@ -1,615 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_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/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listBySubscription.json -func ExampleCloudExadataInfrastructuresClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudExadataInfrastructuresClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudExadataInfrastructureListResult = armoracledatabase.CloudExadataInfrastructureListResult{ - // Value: []*armoracledatabase.CloudExadataInfrastructure{ - // { - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listByResourceGroup.json -func ExampleCloudExadataInfrastructuresClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudExadataInfrastructuresClient().NewListByResourceGroupPager("rg000", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudExadataInfrastructureListResult = armoracledatabase.CloudExadataInfrastructureListResult{ - // Value: []*armoracledatabase.CloudExadataInfrastructure{ - // { - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_get.json -func ExampleCloudExadataInfrastructuresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudExadataInfrastructuresClient().Get(ctx, "rg000", "infra1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudExadataInfrastructure = armoracledatabase.CloudExadataInfrastructure{ - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_create.json -func ExampleCloudExadataInfrastructuresClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudExadataInfrastructuresClient().BeginCreateOrUpdate(ctx, "rg000", "infra1", armoracledatabase.CloudExadataInfrastructure{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagK1": to.Ptr("tagV1"), - }, - Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - ComputeCount: to.Ptr[int32](100), - DisplayName: to.Ptr("infra 1"), - Shape: to.Ptr("EXADATA.X9M"), - StorageCount: to.Ptr[int32](10), - }, - Zones: []*string{ - to.Ptr("1")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudExadataInfrastructure = armoracledatabase.CloudExadataInfrastructure{ - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_patch.json -func ExampleCloudExadataInfrastructuresClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudExadataInfrastructuresClient().BeginUpdate(ctx, "rg000", "infra1", armoracledatabase.CloudExadataInfrastructureUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudExadataInfrastructure = armoracledatabase.CloudExadataInfrastructure{ - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_delete.json -func ExampleCloudExadataInfrastructuresClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudExadataInfrastructuresClient().BeginDelete(ctx, "rg000", "infra1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_addStorageCapacity.json -func ExampleCloudExadataInfrastructuresClient_BeginAddStorageCapacity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudExadataInfrastructuresClient().BeginAddStorageCapacity(ctx, "rg000", "infra1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudExadataInfrastructure = armoracledatabase.CloudExadataInfrastructure{ - // Type: to.Ptr("Oracle.Database/cloudExadataInfrastructures"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudExadataInfrastructureProperties{ - // ActivatedStorageCount: to.Ptr[int32](1), - // AdditionalStorageCount: to.Ptr[int32](1), - // AvailableStorageSizeInGbs: to.Ptr[int32](1000), - // ComputeCount: to.Ptr[int32](100), - // CPUCount: to.Ptr[int32](10), - // CustomerContacts: []*armoracledatabase.CustomerContact{ - // { - // Email: to.Ptr("noreply@oracle.com"), - // }}, - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](10), - // DbServerVersion: to.Ptr("19.0.0.0"), - // DisplayName: to.Ptr("infra 1"), - // EstimatedPatchingTime: &armoracledatabase.EstimatedPatchingTime{ - // EstimatedDbServerPatchingTime: to.Ptr[int32](3000), - // EstimatedNetworkSwitchesPatchingTime: to.Ptr[int32](3000), - // EstimatedStorageServerPatchingTime: to.Ptr[int32](3000), - // TotalEstimatedPatchingTime: to.Ptr[int32](3000), - // }, - // LastMaintenanceRunID: to.Ptr("ocid1..aaaaa"), - // LifecycleDetails: to.Ptr("none"), - // MaintenanceWindow: &armoracledatabase.MaintenanceWindow{ - // CustomActionTimeoutInMins: to.Ptr[int32](120), - // DaysOfWeek: []*armoracledatabase.DayOfWeek{ - // { - // Name: to.Ptr(armoracledatabase.DayOfWeekNameMonday), - // }}, - // HoursOfDay: []*int32{ - // to.Ptr[int32](0)}, - // IsCustomActionTimeoutEnabled: to.Ptr(true), - // IsMonthlyPatchingEnabled: to.Ptr(true), - // LeadTimeInWeeks: to.Ptr[int32](0), - // Months: []*armoracledatabase.Month{ - // { - // Name: to.Ptr(armoracledatabase.MonthNameJanuary), - // }}, - // PatchingMode: to.Ptr(armoracledatabase.PatchingModeRolling), - // Preference: to.Ptr(armoracledatabase.PreferenceNoPreference), - // WeeksOfMonth: []*int32{ - // to.Ptr[int32](0)}, - // }, - // MaxCPUCount: to.Ptr[int32](100), - // MaxDataStorageInTbs: to.Ptr[float64](1000), - // MaxDbNodeStorageSizeInGbs: to.Ptr[int32](10), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // MemorySizeInGbs: to.Ptr[int32](100), - // MonthlyDbServerVersion: to.Ptr("aaaa"), - // MonthlyStorageServerVersion: to.Ptr("aaaa"), - // NextMaintenanceRunID: to.Ptr("ocid1..aaaaaa"), - // OciURL: to.Ptr("https://url"), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // Shape: to.Ptr("EXADATA.X9M"), - // StorageCount: to.Ptr[int32](10), - // StorageServerVersion: to.Ptr("0.0"), - // TimeCreated: to.Ptr("2023-02-01T01:01:00"), - // TotalStorageSizeInGbs: to.Ptr[int32](1000), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client.go index cfa066618eca..f2b631b710d9 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewCloudVMClustersClient(subscriptionID string, credential azcore.TokenCred // BeginAddVMs - Add VMs to the VM Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - body - The content of the action request @@ -73,7 +70,7 @@ func (client *CloudVMClustersClient) BeginAddVMs(ctx context.Context, resourceGr // AddVMs - Add VMs to the VM Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudVMClustersClient) addVMs(ctx context.Context, resourceGroupName string, cloudvmclustername string, body AddRemoveDbNode, options *CloudVMClustersClientBeginAddVMsOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginAddVMs" @@ -96,7 +93,7 @@ func (client *CloudVMClustersClient) addVMs(ctx context.Context, resourceGroupNa } // addVMsCreateRequest creates the AddVMs request. -func (client *CloudVMClustersClient) addVMsCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, body AddRemoveDbNode, options *CloudVMClustersClientBeginAddVMsOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) addVMsCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, body AddRemoveDbNode, _ *CloudVMClustersClientBeginAddVMsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/addVms" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *CloudVMClustersClient) addVMsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -127,7 +124,7 @@ func (client *CloudVMClustersClient) addVMsCreateRequest(ctx context.Context, re // BeginCreateOrUpdate - Create a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - resource - Resource create parameters. @@ -154,7 +151,7 @@ func (client *CloudVMClustersClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudVMClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudvmclustername string, resource CloudVMCluster, options *CloudVMClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginCreateOrUpdate" @@ -177,7 +174,7 @@ func (client *CloudVMClustersClient) createOrUpdate(ctx context.Context, resourc } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CloudVMClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, resource CloudVMCluster, options *CloudVMClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, resource CloudVMCluster, _ *CloudVMClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -196,7 +193,7 @@ func (client *CloudVMClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -208,7 +205,7 @@ func (client *CloudVMClustersClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - options - CloudVMClustersClientBeginDeleteOptions contains the optional parameters for the CloudVMClustersClient.BeginDelete @@ -234,7 +231,7 @@ func (client *CloudVMClustersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudVMClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudvmclustername string, options *CloudVMClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginDelete" @@ -257,7 +254,7 @@ func (client *CloudVMClustersClient) deleteOperation(ctx context.Context, resour } // deleteCreateRequest creates the Delete request. -func (client *CloudVMClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, options *CloudVMClustersClientBeginDeleteOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, _ *CloudVMClustersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -276,7 +273,7 @@ func (client *CloudVMClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +282,7 @@ func (client *CloudVMClustersClient) deleteCreateRequest(ctx context.Context, re // Get - Get a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - options - CloudVMClustersClientGetOptions contains the optional parameters for the CloudVMClustersClient.Get method. @@ -312,7 +309,7 @@ func (client *CloudVMClustersClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *CloudVMClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, options *CloudVMClustersClientGetOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, _ *CloudVMClustersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -331,7 +328,7 @@ func (client *CloudVMClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +345,7 @@ func (client *CloudVMClustersClient) getHandleResponse(resp *http.Response) (Clo // NewListByResourceGroupPager - List CloudVmCluster resources by resource group // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CloudVMClustersClientListByResourceGroupOptions contains the optional parameters for the CloudVMClustersClient.NewListByResourceGroupPager // method. @@ -376,7 +373,7 @@ func (client *CloudVMClustersClient) NewListByResourceGroupPager(resourceGroupNa } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *CloudVMClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CloudVMClustersClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *CloudVMClustersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -391,7 +388,7 @@ func (client *CloudVMClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -408,7 +405,7 @@ func (client *CloudVMClustersClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - List CloudVmCluster resources by subscription ID // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - CloudVMClustersClientListBySubscriptionOptions contains the optional parameters for the CloudVMClustersClient.NewListBySubscriptionPager // method. func (client *CloudVMClustersClient) NewListBySubscriptionPager(options *CloudVMClustersClientListBySubscriptionOptions) *runtime.Pager[CloudVMClustersClientListBySubscriptionResponse] { @@ -435,7 +432,7 @@ func (client *CloudVMClustersClient) NewListBySubscriptionPager(options *CloudVM } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *CloudVMClustersClient) listBySubscriptionCreateRequest(ctx context.Context, options *CloudVMClustersClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) listBySubscriptionCreateRequest(ctx context.Context, _ *CloudVMClustersClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/cloudVmClusters" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -446,7 +443,7 @@ func (client *CloudVMClustersClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,7 +461,7 @@ func (client *CloudVMClustersClient) listBySubscriptionHandleResponse(resp *http // ListPrivateIPAddresses - List Private IP Addresses by the provided filter // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - body - The content of the action request @@ -493,7 +490,7 @@ func (client *CloudVMClustersClient) ListPrivateIPAddresses(ctx context.Context, } // listPrivateIPAddressesCreateRequest creates the ListPrivateIPAddresses request. -func (client *CloudVMClustersClient) listPrivateIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, body PrivateIPAddressesFilter, options *CloudVMClustersClientListPrivateIPAddressesOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) listPrivateIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, body PrivateIPAddressesFilter, _ *CloudVMClustersClientListPrivateIPAddressesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/listPrivateIpAddresses" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -512,7 +509,7 @@ func (client *CloudVMClustersClient) listPrivateIPAddressesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -533,7 +530,7 @@ func (client *CloudVMClustersClient) listPrivateIPAddressesHandleResponse(resp * // BeginRemoveVMs - Remove VMs from the VM Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - body - The content of the action request @@ -560,7 +557,7 @@ func (client *CloudVMClustersClient) BeginRemoveVMs(ctx context.Context, resourc // RemoveVMs - Remove VMs from the VM Cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudVMClustersClient) removeVMs(ctx context.Context, resourceGroupName string, cloudvmclustername string, body AddRemoveDbNode, options *CloudVMClustersClientBeginRemoveVMsOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginRemoveVMs" @@ -583,7 +580,7 @@ func (client *CloudVMClustersClient) removeVMs(ctx context.Context, resourceGrou } // removeVMsCreateRequest creates the RemoveVMs request. -func (client *CloudVMClustersClient) removeVMsCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, body AddRemoveDbNode, options *CloudVMClustersClientBeginRemoveVMsOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) removeVMsCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, body AddRemoveDbNode, _ *CloudVMClustersClientBeginRemoveVMsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/removeVms" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -602,7 +599,7 @@ func (client *CloudVMClustersClient) removeVMsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -614,7 +611,7 @@ func (client *CloudVMClustersClient) removeVMsCreateRequest(ctx context.Context, // BeginUpdate - Update a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - properties - The resource properties to be updated. @@ -641,7 +638,7 @@ func (client *CloudVMClustersClient) BeginUpdate(ctx context.Context, resourceGr // Update - Update a CloudVmCluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *CloudVMClustersClient) update(ctx context.Context, resourceGroupName string, cloudvmclustername string, properties CloudVMClusterUpdate, options *CloudVMClustersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudVMClustersClient.BeginUpdate" @@ -664,7 +661,7 @@ func (client *CloudVMClustersClient) update(ctx context.Context, resourceGroupNa } // updateCreateRequest creates the Update request. -func (client *CloudVMClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, properties CloudVMClusterUpdate, options *CloudVMClustersClientBeginUpdateOptions) (*policy.Request, error) { +func (client *CloudVMClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, properties CloudVMClusterUpdate, _ *CloudVMClustersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -683,7 +680,7 @@ func (client *CloudVMClustersClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client_example_test.go deleted file mode 100644 index 14feee604fc9..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/cloudvmclusters_client_example_test.go +++ /dev/null @@ -1,813 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_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/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listBySubscription.json -func ExampleCloudVMClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudVMClustersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudVMClusterListResult = armoracledatabase.CloudVMClusterListResult{ - // Value: []*armoracledatabase.CloudVMCluster{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listByResourceGroup.json -func ExampleCloudVMClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudVMClustersClient().NewListByResourceGroupPager("rg000", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudVMClusterListResult = armoracledatabase.CloudVMClusterListResult{ - // Value: []*armoracledatabase.CloudVMCluster{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_get.json -func ExampleCloudVMClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudVMClustersClient().Get(ctx, "rg000", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // NsgCidrs: []*armoracledatabase.NsgCidr{ - // { - // DestinationPortRange: &armoracledatabase.PortRange{ - // Max: to.Ptr[int32](1522), - // Min: to.Ptr[int32](1520), - // }, - // Source: to.Ptr("10.0.0.0/16"), - // }, - // { - // Source: to.Ptr("10.10.0.0/24"), - // }}, - // NsgURL: to.Ptr("https://fake"), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_create.json -func ExampleCloudVMClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginCreateOrUpdate(ctx, "rg000", "cluster1", armoracledatabase.CloudVMCluster{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "tagK1": to.Ptr("tagV1"), - }, - Properties: &armoracledatabase.CloudVMClusterProperties{ - BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - ClusterName: to.Ptr("cluster1"), - CPUCoreCount: to.Ptr[int32](2), - DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - IsDiagnosticsEventsEnabled: to.Ptr(false), - IsHealthMonitoringEnabled: to.Ptr(false), - IsIncidentLogsEnabled: to.Ptr(false), - }, - DataStoragePercentage: to.Ptr[int32](100), - DataStorageSizeInTbs: to.Ptr[float64](1000), - DbNodeStorageSizeInGbs: to.Ptr[int32](1000), - DbServers: []*string{ - to.Ptr("ocid1..aaaa")}, - DisplayName: to.Ptr("cluster 1"), - Domain: to.Ptr("domain1"), - GiVersion: to.Ptr("19.0.0.0"), - Hostname: to.Ptr("hostname1"), - IsLocalBackupEnabled: to.Ptr(false), - IsSparseDiskgroupEnabled: to.Ptr(false), - LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - MemorySizeInGbs: to.Ptr[int32](1000), - NsgCidrs: []*armoracledatabase.NsgCidr{ - { - DestinationPortRange: &armoracledatabase.PortRange{ - Max: to.Ptr[int32](1522), - Min: to.Ptr[int32](1520), - }, - Source: to.Ptr("10.0.0.0/16"), - }, - { - Source: to.Ptr("10.10.0.0/24"), - }}, - OcpuCount: to.Ptr[float32](3), - ScanListenerPortTCP: to.Ptr[int32](1050), - ScanListenerPortTCPSSL: to.Ptr[int32](1025), - SSHPublicKeys: []*string{ - to.Ptr("ssh-key 1")}, - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - TimeZone: to.Ptr("UTC"), - VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_patch.json -func ExampleCloudVMClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginUpdate(ctx, "rg000", "cluster1", armoracledatabase.CloudVMClusterUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_delete.json -func ExampleCloudVMClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginDelete(ctx, "rg000", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_addVms.json -func ExampleCloudVMClustersClient_BeginAddVMs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginAddVMs(ctx, "rg000", "cluster1", armoracledatabase.AddRemoveDbNode{ - DbServers: []*string{ - to.Ptr("ocid1..aaaa"), - to.Ptr("ocid1..aaaaaa")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listPrivateIpAddresses.json -func ExampleCloudVMClustersClient_ListPrivateIPAddresses() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudVMClustersClient().ListPrivateIPAddresses(ctx, "rg000", "cluster1", armoracledatabase.PrivateIPAddressesFilter{ - SubnetID: to.Ptr("ocid1..aaaaaa"), - VnicID: to.Ptr("ocid1..aaaaa"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateIPAddressPropertiesArray = []*armoracledatabase.PrivateIPAddressProperties{ - // { - // DisplayName: to.Ptr("ip1"), - // HostnameLabel: to.Ptr("hostname1"), - // IPAddress: to.Ptr("192.168.0.1"), - // Ocid: to.Ptr("ocid1..aaaa"), - // SubnetID: to.Ptr("ocid1..aaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_removeVms.json -func ExampleCloudVMClustersClient_BeginRemoveVMs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudVMClustersClient().BeginRemoveVMs(ctx, "rg000", "cluster1", armoracledatabase.AddRemoveDbNode{ - DbServers: []*string{ - to.Ptr("ocid1..aaaa")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudVMCluster = armoracledatabase.CloudVMCluster{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "tagK1": to.Ptr("tagV1"), - // }, - // Properties: &armoracledatabase.CloudVMClusterProperties{ - // BackupSubnetCidr: to.Ptr("172.17.5.0/24"), - // CloudExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // ClusterName: to.Ptr("cluster1"), - // CompartmentID: to.Ptr("ocid1..aaaaaa"), - // CPUCoreCount: to.Ptr[int32](10), - // DataCollectionOptions: &armoracledatabase.DataCollectionOptions{ - // IsDiagnosticsEventsEnabled: to.Ptr(false), - // IsHealthMonitoringEnabled: to.Ptr(false), - // IsIncidentLogsEnabled: to.Ptr(false), - // }, - // DataStoragePercentage: to.Ptr[int32](80), - // DataStorageSizeInTbs: to.Ptr[float64](10), - // DbNodeStorageSizeInGbs: to.Ptr[int32](100), - // DbServers: []*string{ - // to.Ptr("ocid1..aaaa")}, - // DiskRedundancy: to.Ptr(armoracledatabase.DiskRedundancyHigh), - // DisplayName: to.Ptr("cluster 1"), - // Domain: to.Ptr("domain1"), - // GiVersion: to.Ptr("19.0.0.0"), - // Hostname: to.Ptr("hostname1"), - // IormConfigCache: &armoracledatabase.ExadataIormConfig{ - // DbPlans: []*armoracledatabase.DbIormConfig{ - // { - // DbName: to.Ptr("db1"), - // FlashCacheLimit: to.Ptr("none"), - // Share: to.Ptr[int32](32), - // }}, - // LifecycleDetails: to.Ptr("Disabled"), - // LifecycleState: to.Ptr(armoracledatabase.IormLifecycleStateDisabled), - // Objective: to.Ptr(armoracledatabase.ObjectiveLowLatency), - // }, - // IsLocalBackupEnabled: to.Ptr(false), - // IsSparseDiskgroupEnabled: to.Ptr(false), - // LastUpdateHistoryEntryID: to.Ptr("none"), - // LicenseModel: to.Ptr(armoracledatabase.LicenseModelLicenseIncluded), - // LifecycleDetails: to.Ptr("success"), - // ListenerPort: to.Ptr[int64](1050), - // MemorySizeInGbs: to.Ptr[int32](1000), - // NodeCount: to.Ptr[int32](100), - // OciURL: to.Ptr("https://fake"), - // Ocid: to.Ptr("ocid1..aaaa"), - // OcpuCount: to.Ptr[float32](100), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // ScanDNSName: to.Ptr("dbdns1"), - // ScanDNSRecordID: to.Ptr("scandns1"), - // ScanIPIDs: []*string{ - // to.Ptr("10.0.0.1")}, - // ScanListenerPortTCP: to.Ptr[int32](1050), - // ScanListenerPortTCPSSL: to.Ptr[int32](1025), - // Shape: to.Ptr("EXADATA.X9M"), - // SSHPublicKeys: []*string{ - // to.Ptr("ssh-key 1")}, - // StorageSizeInGbs: to.Ptr[int32](1000), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // SubnetOcid: to.Ptr("ocid1..aaaaaa"), - // SystemVersion: to.Ptr("v1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T02:18:35.683Z"); return t}()), - // TimeZone: to.Ptr("UTC"), - // VipIDs: []*string{ - // to.Ptr("10.0.1.3")}, - // VnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), - // ZoneID: to.Ptr("ocid1..aaaa"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/constants.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/constants.go index 8e9e5855b1b4..b3340563ff8f 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/constants.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/constants.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -10,7 +7,7 @@ package armoracledatabase const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -27,6 +24,27 @@ func PossibleActionTypeValues() []ActionType { } } +// AddSubscriptionOperationState - Add Subscription Operation state enum +type AddSubscriptionOperationState string + +const ( + // AddSubscriptionOperationStateFailed - Failed - State when Add Subscription operation failed + AddSubscriptionOperationStateFailed AddSubscriptionOperationState = "Failed" + // AddSubscriptionOperationStateSucceeded - Succeeded - State when Add Subscription operation succeeded + AddSubscriptionOperationStateSucceeded AddSubscriptionOperationState = "Succeeded" + // AddSubscriptionOperationStateUpdating - Updating - State when Add Subscription operation is being Updated + AddSubscriptionOperationStateUpdating AddSubscriptionOperationState = "Updating" +) + +// PossibleAddSubscriptionOperationStateValues returns the possible values for the AddSubscriptionOperationState const type. +func PossibleAddSubscriptionOperationStateValues() []AddSubscriptionOperationState { + return []AddSubscriptionOperationState{ + AddSubscriptionOperationStateFailed, + AddSubscriptionOperationStateSucceeded, + AddSubscriptionOperationStateUpdating, + } +} + // AutonomousDatabaseBackupLifecycleState - Autonomous database backup lifecycle state enum type AutonomousDatabaseBackupLifecycleState string @@ -420,6 +438,10 @@ type DataBaseType string const ( // DataBaseTypeClone - Clone DB DataBaseTypeClone DataBaseType = "Clone" + // DataBaseTypeCloneFromBackupTimestamp - Clone DB from backup timestamp + DataBaseTypeCloneFromBackupTimestamp DataBaseType = "CloneFromBackupTimestamp" + // DataBaseTypeCrossRegionDisasterRecovery - Cross Region Disaster Recovery + DataBaseTypeCrossRegionDisasterRecovery DataBaseType = "CrossRegionDisasterRecovery" // DataBaseTypeRegular - Regular DB DataBaseTypeRegular DataBaseType = "Regular" ) @@ -428,6 +450,8 @@ const ( func PossibleDataBaseTypeValues() []DataBaseType { return []DataBaseType{ DataBaseTypeClone, + DataBaseTypeCloneFromBackupTimestamp, + DataBaseTypeCrossRegionDisasterRecovery, DataBaseTypeRegular, } } @@ -678,6 +702,69 @@ func PossibleDiskRedundancyValues() []DiskRedundancy { } } +// ExadbVMClusterLifecycleState - Exadata VM cluster on Exascale Infrastructure lifecycle state enum +type ExadbVMClusterLifecycleState string + +const ( + // ExadbVMClusterLifecycleStateAvailable - Indicates that resource in Available state + ExadbVMClusterLifecycleStateAvailable ExadbVMClusterLifecycleState = "Available" + // ExadbVMClusterLifecycleStateFailed - Indicates that resource in Failed state + ExadbVMClusterLifecycleStateFailed ExadbVMClusterLifecycleState = "Failed" + // ExadbVMClusterLifecycleStateMaintenanceInProgress - Indicates that resource Maintenance in progress state + ExadbVMClusterLifecycleStateMaintenanceInProgress ExadbVMClusterLifecycleState = "MaintenanceInProgress" + // ExadbVMClusterLifecycleStateProvisioning - Indicates that resource in Provisioning state + ExadbVMClusterLifecycleStateProvisioning ExadbVMClusterLifecycleState = "Provisioning" + // ExadbVMClusterLifecycleStateTerminated - Indicates that resource in Terminated state + ExadbVMClusterLifecycleStateTerminated ExadbVMClusterLifecycleState = "Terminated" + // ExadbVMClusterLifecycleStateTerminating - Indicates that resource in Terminating state + ExadbVMClusterLifecycleStateTerminating ExadbVMClusterLifecycleState = "Terminating" + // ExadbVMClusterLifecycleStateUpdating - Indicates that resource in Updating state + ExadbVMClusterLifecycleStateUpdating ExadbVMClusterLifecycleState = "Updating" +) + +// PossibleExadbVMClusterLifecycleStateValues returns the possible values for the ExadbVMClusterLifecycleState const type. +func PossibleExadbVMClusterLifecycleStateValues() []ExadbVMClusterLifecycleState { + return []ExadbVMClusterLifecycleState{ + ExadbVMClusterLifecycleStateAvailable, + ExadbVMClusterLifecycleStateFailed, + ExadbVMClusterLifecycleStateMaintenanceInProgress, + ExadbVMClusterLifecycleStateProvisioning, + ExadbVMClusterLifecycleStateTerminated, + ExadbVMClusterLifecycleStateTerminating, + ExadbVMClusterLifecycleStateUpdating, + } +} + +// ExascaleDbStorageVaultLifecycleState - Exadata Database Storage Vault lifecycle state enum +type ExascaleDbStorageVaultLifecycleState string + +const ( + // ExascaleDbStorageVaultLifecycleStateAvailable - Indicates that resource in Available state + ExascaleDbStorageVaultLifecycleStateAvailable ExascaleDbStorageVaultLifecycleState = "Available" + // ExascaleDbStorageVaultLifecycleStateFailed - Indicates that resource in Failed state + ExascaleDbStorageVaultLifecycleStateFailed ExascaleDbStorageVaultLifecycleState = "Failed" + // ExascaleDbStorageVaultLifecycleStateProvisioning - Indicates that resource in Provisioning state + ExascaleDbStorageVaultLifecycleStateProvisioning ExascaleDbStorageVaultLifecycleState = "Provisioning" + // ExascaleDbStorageVaultLifecycleStateTerminated - Indicates that resource in Terminated state + ExascaleDbStorageVaultLifecycleStateTerminated ExascaleDbStorageVaultLifecycleState = "Terminated" + // ExascaleDbStorageVaultLifecycleStateTerminating - Indicates that resource in Terminating state + ExascaleDbStorageVaultLifecycleStateTerminating ExascaleDbStorageVaultLifecycleState = "Terminating" + // ExascaleDbStorageVaultLifecycleStateUpdating - Indicates that resource in Updating state + ExascaleDbStorageVaultLifecycleStateUpdating ExascaleDbStorageVaultLifecycleState = "Updating" +) + +// PossibleExascaleDbStorageVaultLifecycleStateValues returns the possible values for the ExascaleDbStorageVaultLifecycleState const type. +func PossibleExascaleDbStorageVaultLifecycleStateValues() []ExascaleDbStorageVaultLifecycleState { + return []ExascaleDbStorageVaultLifecycleState{ + ExascaleDbStorageVaultLifecycleStateAvailable, + ExascaleDbStorageVaultLifecycleStateFailed, + ExascaleDbStorageVaultLifecycleStateProvisioning, + ExascaleDbStorageVaultLifecycleStateTerminated, + ExascaleDbStorageVaultLifecycleStateTerminating, + ExascaleDbStorageVaultLifecycleStateUpdating, + } +} + // GenerateType - Generate type enum type GenerateType string @@ -696,6 +783,42 @@ func PossibleGenerateTypeValues() []GenerateType { } } +// GridImageType - GridImageType enum +type GridImageType string + +const ( + // GridImageTypeCustomImage - Custom image + GridImageTypeCustomImage GridImageType = "CustomImage" + // GridImageTypeReleaseUpdate - Release update + GridImageTypeReleaseUpdate GridImageType = "ReleaseUpdate" +) + +// PossibleGridImageTypeValues returns the possible values for the GridImageType const type. +func PossibleGridImageTypeValues() []GridImageType { + return []GridImageType{ + GridImageTypeCustomImage, + GridImageTypeReleaseUpdate, + } +} + +// HardwareType - Hardware Type enum +type HardwareType string + +const ( + // HardwareTypeCELL - Hardware type is Storage Server + HardwareTypeCELL HardwareType = "CELL" + // HardwareTypeCOMPUTE - Hardware type is Database Server + HardwareTypeCOMPUTE HardwareType = "COMPUTE" +) + +// PossibleHardwareTypeValues returns the possible values for the HardwareType const type. +func PossibleHardwareTypeValues() []HardwareType { + return []HardwareType{ + HardwareTypeCELL, + HardwareTypeCOMPUTE, + } +} + // HostFormatType - Host format type enum. type HostFormatType string @@ -1138,6 +1261,24 @@ func PossibleSessionModeTypeValues() []SessionModeType { } } +// ShapeFamily - Allowed values for GI Minor Versions shapeFamily filter +type ShapeFamily string + +const ( + // ShapeFamilyExadata - Family value for Exadata Shape + ShapeFamilyExadata ShapeFamily = "EXADATA" + // ShapeFamilyExadbXs - Family value for Exadb XS Shape + ShapeFamilyExadbXs ShapeFamily = "EXADB_XS" +) + +// PossibleShapeFamilyValues returns the possible values for the ShapeFamily const type. +func PossibleShapeFamilyValues() []ShapeFamily { + return []ShapeFamily{ + ShapeFamilyExadata, + ShapeFamilyExadbXs, + } +} + // SourceType - Source type enum. type SourceType string @@ -1192,6 +1333,27 @@ func PossibleSyntaxFormatTypeValues() []SyntaxFormatType { } } +// SystemShapes - Allowed values for System Shapes +type SystemShapes string + +const ( + // SystemShapesExaDbXs - Exadata DB on Exascale Infrastructure shape + SystemShapesExaDbXs SystemShapes = "ExaDbXS" + // SystemShapesExadataX11M - Exadata X11M shape + SystemShapesExadataX11M SystemShapes = "Exadata.X11M" + // SystemShapesExadataX9M - Exadata X9M shape + SystemShapesExadataX9M SystemShapes = "Exadata.X9M" +) + +// PossibleSystemShapesValues returns the possible values for the SystemShapes const type. +func PossibleSystemShapesValues() []SystemShapes { + return []SystemShapes{ + SystemShapesExaDbXs, + SystemShapesExadataX11M, + SystemShapesExadataX9M, + } +} + // TLSAuthenticationType - TLS authentication type enum. type TLSAuthenticationType string diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client.go index 02bca6f50b8b..2c5819969e0b 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDbNodesClient(subscriptionID string, credential azcore.TokenCredential, // BeginAction - VM actions on DbNode of VM Cluster by the provided filter // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - dbnodeocid - DbNode OCID. @@ -73,7 +70,7 @@ func (client *DbNodesClient) BeginAction(ctx context.Context, resourceGroupName // Action - VM actions on DbNode of VM Cluster by the provided filter // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *DbNodesClient) action(ctx context.Context, resourceGroupName string, cloudvmclustername string, dbnodeocid string, body DbNodeAction, options *DbNodesClientBeginActionOptions) (*http.Response, error) { var err error const operationName = "DbNodesClient.BeginAction" @@ -96,7 +93,7 @@ func (client *DbNodesClient) action(ctx context.Context, resourceGroupName strin } // actionCreateRequest creates the Action request. -func (client *DbNodesClient) actionCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, dbnodeocid string, body DbNodeAction, options *DbNodesClientBeginActionOptions) (*policy.Request, error) { +func (client *DbNodesClient) actionCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, dbnodeocid string, body DbNodeAction, _ *DbNodesClientBeginActionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}/action" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -119,7 +116,7 @@ func (client *DbNodesClient) actionCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -131,7 +128,7 @@ func (client *DbNodesClient) actionCreateRequest(ctx context.Context, resourceGr // Get - Get a DbNode // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - dbnodeocid - DbNode OCID. @@ -159,7 +156,7 @@ func (client *DbNodesClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *DbNodesClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, dbnodeocid string, options *DbNodesClientGetOptions) (*policy.Request, error) { +func (client *DbNodesClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, dbnodeocid string, _ *DbNodesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -182,7 +179,7 @@ func (client *DbNodesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,38 +194,38 @@ func (client *DbNodesClient) getHandleResponse(resp *http.Response) (DbNodesClie return result, nil } -// NewListByCloudVMClusterPager - List DbNode resources by CloudVmCluster +// NewListByParentPager - List DbNode resources by CloudVmCluster // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name -// - options - DbNodesClientListByCloudVMClusterOptions contains the optional parameters for the DbNodesClient.NewListByCloudVMClusterPager +// - options - DbNodesClientListByParentOptions contains the optional parameters for the DbNodesClient.NewListByParentPager // method. -func (client *DbNodesClient) NewListByCloudVMClusterPager(resourceGroupName string, cloudvmclustername string, options *DbNodesClientListByCloudVMClusterOptions) *runtime.Pager[DbNodesClientListByCloudVMClusterResponse] { - return runtime.NewPager(runtime.PagingHandler[DbNodesClientListByCloudVMClusterResponse]{ - More: func(page DbNodesClientListByCloudVMClusterResponse) bool { +func (client *DbNodesClient) NewListByParentPager(resourceGroupName string, cloudvmclustername string, options *DbNodesClientListByParentOptions) *runtime.Pager[DbNodesClientListByParentResponse] { + return runtime.NewPager(runtime.PagingHandler[DbNodesClientListByParentResponse]{ + More: func(page DbNodesClientListByParentResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *DbNodesClientListByCloudVMClusterResponse) (DbNodesClientListByCloudVMClusterResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DbNodesClient.NewListByCloudVMClusterPager") + Fetcher: func(ctx context.Context, page *DbNodesClientListByParentResponse) (DbNodesClientListByParentResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DbNodesClient.NewListByParentPager") nextLink := "" if page != nil { nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByCloudVMClusterCreateRequest(ctx, resourceGroupName, cloudvmclustername, options) + return client.listByParentCreateRequest(ctx, resourceGroupName, cloudvmclustername, options) }, nil) if err != nil { - return DbNodesClientListByCloudVMClusterResponse{}, err + return DbNodesClientListByParentResponse{}, err } - return client.listByCloudVMClusterHandleResponse(resp) + return client.listByParentHandleResponse(resp) }, Tracer: client.internal.Tracer(), }) } -// listByCloudVMClusterCreateRequest creates the ListByCloudVMCluster request. -func (client *DbNodesClient) listByCloudVMClusterCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, options *DbNodesClientListByCloudVMClusterOptions) (*policy.Request, error) { +// listByParentCreateRequest creates the ListByParent request. +func (client *DbNodesClient) listByParentCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, _ *DbNodesClientListByParentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -247,17 +244,17 @@ func (client *DbNodesClient) listByCloudVMClusterCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByCloudVMClusterHandleResponse handles the ListByCloudVMCluster response. -func (client *DbNodesClient) listByCloudVMClusterHandleResponse(resp *http.Response) (DbNodesClientListByCloudVMClusterResponse, error) { - result := DbNodesClientListByCloudVMClusterResponse{} +// listByParentHandleResponse handles the ListByParent response. +func (client *DbNodesClient) listByParentHandleResponse(resp *http.Response) (DbNodesClientListByParentResponse, error) { + result := DbNodesClientListByParentResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DbNodeListResult); err != nil { - return DbNodesClientListByCloudVMClusterResponse{}, err + return DbNodesClientListByParentResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client_example_test.go deleted file mode 100644 index 13651e994932..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbnodes_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_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/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_listByParent.json -func ExampleDbNodesClient_NewListByCloudVMClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDbNodesClient().NewListByCloudVMClusterPager("rg000", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DbNodeListResult = armoracledatabase.DbNodeListResult{ - // Value: []*armoracledatabase.DbNode{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbNodes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/dbNodes/ocid1"), - // Properties: &armoracledatabase.DbNodeProperties{ - // BackupIPID: to.Ptr("id1"), - // BackupVnic2ID: to.Ptr("id1"), - // BackupVnicID: to.Ptr("id1"), - // CPUCoreCount: to.Ptr[int32](1000), - // DbNodeStorageSizeInGbs: to.Ptr[int32](500), - // DbServerID: to.Ptr("dbserver1"), - // DbSystemID: to.Ptr("db1"), - // FaultDomain: to.Ptr("domain1"), - // HostIPID: to.Ptr("10.0.0.0"), - // Hostname: to.Ptr("host1"), - // LifecycleState: to.Ptr(armoracledatabase.DbNodeProvisioningStateAvailable), - // MaintenanceType: to.Ptr(armoracledatabase.DbNodeMaintenanceTypeVmdbRebootMigration), - // MemorySizeInGbs: to.Ptr[int32](100), - // Ocid: to.Ptr("ocid.dbNodes.1"), - // SoftwareStorageSizeInGb: to.Ptr[int32](1000), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // Vnic2ID: to.Ptr("ocid.vnic.id2"), - // VnicID: to.Ptr("ocid.vnic.id1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_get.json -func ExampleDbNodesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDbNodesClient().Get(ctx, "rg000", "cluster1", "ocid1....aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DbNode = armoracledatabase.DbNode{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbNodes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/dbNodes/ocid1"), - // Properties: &armoracledatabase.DbNodeProperties{ - // BackupIPID: to.Ptr("id1"), - // BackupVnic2ID: to.Ptr("id1"), - // BackupVnicID: to.Ptr("id1"), - // CPUCoreCount: to.Ptr[int32](1000), - // DbNodeStorageSizeInGbs: to.Ptr[int32](500), - // DbServerID: to.Ptr("dbserver1"), - // DbSystemID: to.Ptr("db1"), - // FaultDomain: to.Ptr("domain1"), - // HostIPID: to.Ptr("10.0.0.0"), - // Hostname: to.Ptr("host1"), - // LifecycleState: to.Ptr(armoracledatabase.DbNodeProvisioningStateAvailable), - // MaintenanceType: to.Ptr(armoracledatabase.DbNodeMaintenanceTypeVmdbRebootMigration), - // MemorySizeInGbs: to.Ptr[int32](100), - // Ocid: to.Ptr("ocid.dbNodes.1"), - // SoftwareStorageSizeInGb: to.Ptr[int32](1000), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // Vnic2ID: to.Ptr("ocid.vnic.id2"), - // VnicID: to.Ptr("ocid.vnic.id1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_action.json -func ExampleDbNodesClient_BeginAction_dbNodesAction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDbNodesClient().BeginAction(ctx, "rg000", "cluster1", "ocid1....aaaaaa", armoracledatabase.DbNodeAction{ - Action: to.Ptr(armoracledatabase.DbNodeActionEnumStart), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DbNode = armoracledatabase.DbNode{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbNodes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/dbNodes/ocid1"), - // Properties: &armoracledatabase.DbNodeProperties{ - // BackupIPID: to.Ptr("id1"), - // BackupVnic2ID: to.Ptr("id1"), - // BackupVnicID: to.Ptr("id1"), - // CPUCoreCount: to.Ptr[int32](1000), - // DbNodeStorageSizeInGbs: to.Ptr[int32](500), - // DbServerID: to.Ptr("dbserver1"), - // DbSystemID: to.Ptr("db1"), - // FaultDomain: to.Ptr("domain1"), - // HostIPID: to.Ptr("10.0.0.0"), - // Hostname: to.Ptr("host1"), - // MaintenanceType: to.Ptr(armoracledatabase.DbNodeMaintenanceTypeVmdbRebootMigration), - // MemorySizeInGbs: to.Ptr[int32](100), - // Ocid: to.Ptr("ocid.dbNodes.1"), - // ProvisioningState: to.Ptr(armoracledatabase.ResourceProvisioningStateSucceeded), - // SoftwareStorageSizeInGb: to.Ptr[int32](1000), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // TimeMaintenanceWindowStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-21T13:44:04.924Z"); return t}()), - // Vnic2ID: to.Ptr("ocid.vnic.id2"), - // VnicID: to.Ptr("ocid.vnic.id1"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client.go index 34bc828e0228..310803d5b4eb 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDbServersClient(subscriptionID string, credential azcore.TokenCredential // Get - Get a DbServer // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name // - dbserverocid - DbServer OCID. @@ -74,7 +71,7 @@ func (client *DbServersClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *DbServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, dbserverocid string, options *DbServersClientGetOptions) (*policy.Request, error) { +func (client *DbServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, dbserverocid string, _ *DbServersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -97,7 +94,7 @@ func (client *DbServersClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,38 +109,38 @@ func (client *DbServersClient) getHandleResponse(resp *http.Response) (DbServers return result, nil } -// NewListByCloudExadataInfrastructurePager - List DbServer resources by CloudExadataInfrastructure +// NewListByParentPager - List DbServer resources by CloudExadataInfrastructure // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudexadatainfrastructurename - CloudExadataInfrastructure name -// - options - DbServersClientListByCloudExadataInfrastructureOptions contains the optional parameters for the DbServersClient.NewListByCloudExadataInfrastructurePager +// - options - DbServersClientListByParentOptions contains the optional parameters for the DbServersClient.NewListByParentPager // method. -func (client *DbServersClient) NewListByCloudExadataInfrastructurePager(resourceGroupName string, cloudexadatainfrastructurename string, options *DbServersClientListByCloudExadataInfrastructureOptions) *runtime.Pager[DbServersClientListByCloudExadataInfrastructureResponse] { - return runtime.NewPager(runtime.PagingHandler[DbServersClientListByCloudExadataInfrastructureResponse]{ - More: func(page DbServersClientListByCloudExadataInfrastructureResponse) bool { +func (client *DbServersClient) NewListByParentPager(resourceGroupName string, cloudexadatainfrastructurename string, options *DbServersClientListByParentOptions) *runtime.Pager[DbServersClientListByParentResponse] { + return runtime.NewPager(runtime.PagingHandler[DbServersClientListByParentResponse]{ + More: func(page DbServersClientListByParentResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *DbServersClientListByCloudExadataInfrastructureResponse) (DbServersClientListByCloudExadataInfrastructureResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DbServersClient.NewListByCloudExadataInfrastructurePager") + Fetcher: func(ctx context.Context, page *DbServersClientListByParentResponse) (DbServersClientListByParentResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DbServersClient.NewListByParentPager") nextLink := "" if page != nil { nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByCloudExadataInfrastructureCreateRequest(ctx, resourceGroupName, cloudexadatainfrastructurename, options) + return client.listByParentCreateRequest(ctx, resourceGroupName, cloudexadatainfrastructurename, options) }, nil) if err != nil { - return DbServersClientListByCloudExadataInfrastructureResponse{}, err + return DbServersClientListByParentResponse{}, err } - return client.listByCloudExadataInfrastructureHandleResponse(resp) + return client.listByParentHandleResponse(resp) }, Tracer: client.internal.Tracer(), }) } -// listByCloudExadataInfrastructureCreateRequest creates the ListByCloudExadataInfrastructure request. -func (client *DbServersClient) listByCloudExadataInfrastructureCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *DbServersClientListByCloudExadataInfrastructureOptions) (*policy.Request, error) { +// listByParentCreateRequest creates the ListByParent request. +func (client *DbServersClient) listByParentCreateRequest(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, _ *DbServersClientListByParentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -162,17 +159,17 @@ func (client *DbServersClient) listByCloudExadataInfrastructureCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByCloudExadataInfrastructureHandleResponse handles the ListByCloudExadataInfrastructure response. -func (client *DbServersClient) listByCloudExadataInfrastructureHandleResponse(resp *http.Response) (DbServersClientListByCloudExadataInfrastructureResponse, error) { - result := DbServersClientListByCloudExadataInfrastructureResponse{} +// listByParentHandleResponse handles the ListByParent response. +func (client *DbServersClient) listByParentHandleResponse(resp *http.Response) (DbServersClientListByParentResponse, error) { + result := DbServersClientListByParentResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DbServerListResult); err != nil { - return DbServersClientListByCloudExadataInfrastructureResponse{}, err + return DbServersClientListByParentResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client_example_test.go deleted file mode 100644 index 12f1139bea15..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbservers_client_example_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_listByParent.json -func ExampleDbServersClient_NewListByCloudExadataInfrastructurePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDbServersClient().NewListByCloudExadataInfrastructurePager("rg000", "infra1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DbServerListResult = armoracledatabase.DbServerListResult{ - // Value: []*armoracledatabase.DbServer{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbServers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1/dbServers/ocid1"), - // Properties: &armoracledatabase.DbServerProperties{ - // AutonomousVirtualMachineIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // AutonomousVMClusterIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // CompartmentID: to.Ptr("ocid1....aaaa"), - // CPUCoreCount: to.Ptr[int32](100), - // DbNodeIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // DbNodeStorageSizeInGbs: to.Ptr[int32](150), - // DisplayName: to.Ptr("dbserver1"), - // ExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // LifecycleState: to.Ptr(armoracledatabase.DbServerProvisioningStateAvailable), - // MaxCPUCount: to.Ptr[int32](1000), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // Ocid: to.Ptr("ocid1"), - // VMClusterIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_get.json -func ExampleDbServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDbServersClient().Get(ctx, "rg000", "infra1", "ocid1....aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DbServer = armoracledatabase.DbServer{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/dbServers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1/dbServers/ocid1"), - // Properties: &armoracledatabase.DbServerProperties{ - // AutonomousVirtualMachineIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // AutonomousVMClusterIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // CompartmentID: to.Ptr("ocid1....aaaa"), - // CPUCoreCount: to.Ptr[int32](100), - // DbNodeIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // DbNodeStorageSizeInGbs: to.Ptr[int32](150), - // DisplayName: to.Ptr("dbserver1"), - // ExadataInfrastructureID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1"), - // LifecycleState: to.Ptr(armoracledatabase.DbServerProvisioningStateAvailable), - // MaxCPUCount: to.Ptr[int32](1000), - // MaxMemoryInGbs: to.Ptr[int32](1000), - // Ocid: to.Ptr("ocid1"), - // VMClusterIDs: []*string{ - // to.Ptr("ocid1..aaaaa")}, - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client.go index 64a1709916e8..b5cb10a5ed47 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDbSystemShapesClient(subscriptionID string, credential azcore.TokenCrede // Get - Get a DbSystemShape // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - dbsystemshapename - DbSystemShape name // - options - DbSystemShapesClientGetOptions contains the optional parameters for the DbSystemShapesClient.Get method. @@ -73,7 +70,7 @@ func (client *DbSystemShapesClient) Get(ctx context.Context, location string, db } // getCreateRequest creates the Get request. -func (client *DbSystemShapesClient) getCreateRequest(ctx context.Context, location string, dbsystemshapename string, options *DbSystemShapesClientGetOptions) (*policy.Request, error) { +func (client *DbSystemShapesClient) getCreateRequest(ctx context.Context, location string, dbsystemshapename string, _ *DbSystemShapesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +89,7 @@ func (client *DbSystemShapesClient) getCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,9 +104,9 @@ func (client *DbSystemShapesClient) getHandleResponse(resp *http.Response) (DbSy return result, nil } -// NewListByLocationPager - List DbSystemShape resources by Location +// NewListByLocationPager - List DbSystemShape resources by SubscriptionLocationResource // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - options - DbSystemShapesClientListByLocationOptions contains the optional parameters for the DbSystemShapesClient.NewListByLocationPager // method. @@ -152,7 +149,10 @@ func (client *DbSystemShapesClient) listByLocationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") + if options != nil && options.Zone != nil { + reqQP.Set("zone", *options.Zone) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client_example_test.go deleted file mode 100644 index 63e720f7e41f..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dbsystemshapes_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_listByLocation.json -func ExampleDbSystemShapesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDbSystemShapesClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DbSystemShapeListResult = armoracledatabase.DbSystemShapeListResult{ - // Value: []*armoracledatabase.DbSystemShape{ - // { - // Type: to.Ptr("Oracle.Database/locations/dbSystemShapes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dbSystemShapes/EXADATA.X9M"), - // Properties: &armoracledatabase.DbSystemShapeProperties{ - // AvailableCoreCount: to.Ptr[int32](100), - // AvailableCoreCountPerNode: to.Ptr[int32](1000), - // AvailableDataStorageInTbs: to.Ptr[int32](10), - // AvailableDataStoragePerServerInTbs: to.Ptr[float64](100), - // AvailableDbNodePerNodeInGbs: to.Ptr[int32](10), - // AvailableDbNodeStorageInGbs: to.Ptr[int32](10), - // AvailableMemoryInGbs: to.Ptr[int32](10), - // AvailableMemoryPerNodeInGbs: to.Ptr[int32](10), - // CoreCountIncrement: to.Ptr[int32](1), - // MaxStorageCount: to.Ptr[int32](100), - // MaximumNodeCount: to.Ptr[int32](1000), - // MinCoreCountPerNode: to.Ptr[int32](0), - // MinDataStorageInTbs: to.Ptr[int32](0), - // MinDbNodeStoragePerNodeInGbs: to.Ptr[int32](0), - // MinMemoryPerNodeInGbs: to.Ptr[int32](0), - // MinStorageCount: to.Ptr[int32](0), - // MinimumCoreCount: to.Ptr[int32](1), - // MinimumNodeCount: to.Ptr[int32](0), - // RuntimeMinimumCoreCount: to.Ptr[int32](1), - // ShapeFamily: to.Ptr("EXADATA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_get.json -func ExampleDbSystemShapesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDbSystemShapesClient().Get(ctx, "eastus", "EXADATA.X9M", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DbSystemShape = armoracledatabase.DbSystemShape{ - // Type: to.Ptr("Oracle.Database/locations/dbSystemShapes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dbSystemShapes/EXADATA.X9M"), - // Properties: &armoracledatabase.DbSystemShapeProperties{ - // AvailableCoreCount: to.Ptr[int32](100), - // AvailableCoreCountPerNode: to.Ptr[int32](1000), - // AvailableDataStorageInTbs: to.Ptr[int32](10), - // AvailableDataStoragePerServerInTbs: to.Ptr[float64](100), - // AvailableDbNodePerNodeInGbs: to.Ptr[int32](10), - // AvailableDbNodeStorageInGbs: to.Ptr[int32](10), - // AvailableMemoryInGbs: to.Ptr[int32](10), - // AvailableMemoryPerNodeInGbs: to.Ptr[int32](10), - // CoreCountIncrement: to.Ptr[int32](1), - // MaxStorageCount: to.Ptr[int32](100), - // MaximumNodeCount: to.Ptr[int32](1000), - // MinCoreCountPerNode: to.Ptr[int32](0), - // MinDataStorageInTbs: to.Ptr[int32](0), - // MinDbNodeStoragePerNodeInGbs: to.Ptr[int32](0), - // MinMemoryPerNodeInGbs: to.Ptr[int32](0), - // MinStorageCount: to.Ptr[int32](0), - // MinimumCoreCount: to.Ptr[int32](1), - // MinimumNodeCount: to.Ptr[int32](0), - // RuntimeMinimumCoreCount: to.Ptr[int32](1), - // ShapeFamily: to.Ptr("EXADATA"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client.go index 0a36f1bbd684..91ff775aec37 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDNSPrivateViewsClient(subscriptionID string, credential azcore.TokenCred // Get - Get a DnsPrivateView // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - dnsprivateviewocid - DnsPrivateView OCID // - options - DNSPrivateViewsClientGetOptions contains the optional parameters for the DNSPrivateViewsClient.Get method. @@ -73,7 +70,7 @@ func (client *DNSPrivateViewsClient) Get(ctx context.Context, location string, d } // getCreateRequest creates the Get request. -func (client *DNSPrivateViewsClient) getCreateRequest(ctx context.Context, location string, dnsprivateviewocid string, options *DNSPrivateViewsClientGetOptions) (*policy.Request, error) { +func (client *DNSPrivateViewsClient) getCreateRequest(ctx context.Context, location string, dnsprivateviewocid string, _ *DNSPrivateViewsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +89,7 @@ func (client *DNSPrivateViewsClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,9 +104,9 @@ func (client *DNSPrivateViewsClient) getHandleResponse(resp *http.Response) (DNS return result, nil } -// NewListByLocationPager - List DnsPrivateView resources by Location +// NewListByLocationPager - List DnsPrivateView resources by SubscriptionLocationResource // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - options - DNSPrivateViewsClientListByLocationOptions contains the optional parameters for the DNSPrivateViewsClient.NewListByLocationPager // method. @@ -137,7 +134,7 @@ func (client *DNSPrivateViewsClient) NewListByLocationPager(location string, opt } // listByLocationCreateRequest creates the ListByLocation request. -func (client *DNSPrivateViewsClient) listByLocationCreateRequest(ctx context.Context, location string, options *DNSPrivateViewsClientListByLocationOptions) (*policy.Request, error) { +func (client *DNSPrivateViewsClient) listByLocationCreateRequest(ctx context.Context, location string, _ *DNSPrivateViewsClientListByLocationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -152,7 +149,7 @@ func (client *DNSPrivateViewsClient) listByLocationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client_example_test.go deleted file mode 100644 index 4987b77cd99c..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivateviews_client_example_test.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_listByLocation.json -func ExampleDNSPrivateViewsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDNSPrivateViewsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DNSPrivateViewListResult = armoracledatabase.DNSPrivateViewListResult{ - // Value: []*armoracledatabase.DNSPrivateView{ - // { - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateViews/ocid1....aaaaaa"), - // Properties: &armoracledatabase.DNSPrivateViewProperties{ - // DisplayName: to.Ptr("example-dns-private-view1"), - // IsProtected: to.Ptr(false), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateViewsLifecycleStateActive), - // Ocid: to.Ptr("ocid1....aaaaaa"), - // Self: to.Ptr("https://api.example.com/view1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T12:34:56.000Z"); return t}()), - // TimeUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T14:00:00.000Z"); return t}()), - // }, - // }, - // { - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateViews/ocid1....aaaaab"), - // Properties: &armoracledatabase.DNSPrivateViewProperties{ - // DisplayName: to.Ptr("example-dns-private-view2"), - // IsProtected: to.Ptr(true), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateViewsLifecycleState("Creating")), - // Ocid: to.Ptr("ocid1....aaaaab"), - // Self: to.Ptr("https://api.example.com/view2"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-27T09:45:00.000Z"); return t}()), - // TimeUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-27T10:30:00.000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_get.json -func ExampleDNSPrivateViewsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDNSPrivateViewsClient().Get(ctx, "eastus", "ocid1....aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DNSPrivateView = armoracledatabase.DNSPrivateView{ - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateViews/ocid1....aaaaaa"), - // Properties: &armoracledatabase.DNSPrivateViewProperties{ - // DisplayName: to.Ptr("example-dns-private-view"), - // IsProtected: to.Ptr(false), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateViewsLifecycleStateActive), - // Ocid: to.Ptr("ocid1....aaaaaa"), - // Self: to.Ptr("https://api.example.com/your-dns-private-view"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T12:34:56.000Z"); return t}()), - // TimeUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T14:00:00.000Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client.go index 15733949a0c4..e988d29303a4 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDNSPrivateZonesClient(subscriptionID string, credential azcore.TokenCred // Get - Get a DnsPrivateZone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - dnsprivatezonename - DnsPrivateZone name // - options - DNSPrivateZonesClientGetOptions contains the optional parameters for the DNSPrivateZonesClient.Get method. @@ -73,7 +70,7 @@ func (client *DNSPrivateZonesClient) Get(ctx context.Context, location string, d } // getCreateRequest creates the Get request. -func (client *DNSPrivateZonesClient) getCreateRequest(ctx context.Context, location string, dnsprivatezonename string, options *DNSPrivateZonesClientGetOptions) (*policy.Request, error) { +func (client *DNSPrivateZonesClient) getCreateRequest(ctx context.Context, location string, dnsprivatezonename string, _ *DNSPrivateZonesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +89,7 @@ func (client *DNSPrivateZonesClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,9 +104,9 @@ func (client *DNSPrivateZonesClient) getHandleResponse(resp *http.Response) (DNS return result, nil } -// NewListByLocationPager - List DnsPrivateZone resources by Location +// NewListByLocationPager - List DnsPrivateZone resources by SubscriptionLocationResource // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - options - DNSPrivateZonesClientListByLocationOptions contains the optional parameters for the DNSPrivateZonesClient.NewListByLocationPager // method. @@ -137,7 +134,7 @@ func (client *DNSPrivateZonesClient) NewListByLocationPager(location string, opt } // listByLocationCreateRequest creates the ListByLocation request. -func (client *DNSPrivateZonesClient) listByLocationCreateRequest(ctx context.Context, location string, options *DNSPrivateZonesClientListByLocationOptions) (*policy.Request, error) { +func (client *DNSPrivateZonesClient) listByLocationCreateRequest(ctx context.Context, location string, _ *DNSPrivateZonesClientListByLocationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -152,7 +149,7 @@ func (client *DNSPrivateZonesClient) listByLocationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client_example_test.go deleted file mode 100644 index b15f526f959e..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/dnsprivatezones_client_example_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_listByLocation.json -func ExampleDNSPrivateZonesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDNSPrivateZonesClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DNSPrivateZoneListResult = armoracledatabase.DNSPrivateZoneListResult{ - // Value: []*armoracledatabase.DNSPrivateZone{ - // { - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateZones/zone1"), - // Properties: &armoracledatabase.DNSPrivateZoneProperties{ - // IsProtected: to.Ptr(false), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateZonesLifecycleStateActive), - // Ocid: to.Ptr("zone-id-1"), - // Self: to.Ptr("https://api.example.com/zone1"), - // Serial: to.Ptr[int32](12345), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T12:34:56.000Z"); return t}()), - // Version: to.Ptr("1.0.0.0"), - // ViewID: to.Ptr("view-id-1"), - // ZoneType: to.Ptr(armoracledatabase.ZoneTypePrimary), - // }, - // }, - // { - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateZones/zone2"), - // Properties: &armoracledatabase.DNSPrivateZoneProperties{ - // IsProtected: to.Ptr(true), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateZonesLifecycleStateCreating), - // Ocid: to.Ptr("zone-id-2"), - // Self: to.Ptr("https://api.example.com/zone2"), - // Serial: to.Ptr[int32](54321), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-27T09:45:00.000Z"); return t}()), - // Version: to.Ptr("2.0.0.0"), - // ViewID: to.Ptr("view-id-2"), - // ZoneType: to.Ptr(armoracledatabase.ZoneTypeSecondary), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_get.json -func ExampleDNSPrivateZonesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDNSPrivateZonesClient().Get(ctx, "eastus", "example-dns-private-zone", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DNSPrivateZone = armoracledatabase.DNSPrivateZone{ - // Type: to.Ptr("Oracle.Database/locations/dnsPrivateZones"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/dnsPrivateZones/example-dns-private-zone"), - // Properties: &armoracledatabase.DNSPrivateZoneProperties{ - // IsProtected: to.Ptr(false), - // LifecycleState: to.Ptr(armoracledatabase.DNSPrivateZonesLifecycleStateActive), - // Ocid: to.Ptr("your-zone-id"), - // Self: to.Ptr("https://api.example.com/your-dns-private-zone"), - // Serial: to.Ptr[int32](12345), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-26T12:34:56.000Z"); return t}()), - // Version: to.Ptr("1.0.0.0"), - // ViewID: to.Ptr("your-view-id"), - // ZoneType: to.Ptr(armoracledatabase.ZoneTypePrimary), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/exadbvmclusters_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/exadbvmclusters_client.go new file mode 100644 index 000000000000..b2bc146f0c8d --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/exadbvmclusters_client.go @@ -0,0 +1,540 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armoracledatabase + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ExadbVMClustersClient contains the methods for the ExadbVMClusters group. +// Don't use this type directly, use NewExadbVMClustersClient() instead. +type ExadbVMClustersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExadbVMClustersClient creates a new instance of ExadbVMClustersClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExadbVMClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExadbVMClustersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExadbVMClustersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a ExadbVmCluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exadbVMClusterName - The name of the ExadbVmCluster +// - resource - Resource create parameters. +// - options - ExadbVMClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ExadbVMClustersClient.BeginCreateOrUpdate +// method. +func (client *ExadbVMClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, exadbVMClusterName string, resource ExadbVMCluster, options *ExadbVMClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExadbVMClustersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, exadbVMClusterName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExadbVMClustersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExadbVMClustersClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create a ExadbVmCluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *ExadbVMClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, exadbVMClusterName string, resource ExadbVMCluster, options *ExadbVMClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ExadbVMClustersClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, exadbVMClusterName, resource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ExadbVMClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, exadbVMClusterName string, resource ExadbVMCluster, _ *ExadbVMClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exadbVMClusterName == "" { + return nil, errors.New("parameter exadbVMClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exadbVmClusterName}", url.PathEscape(exadbVMClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete a ExadbVmCluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exadbVMClusterName - The name of the ExadbVmCluster +// - options - ExadbVMClustersClientBeginDeleteOptions contains the optional parameters for the ExadbVMClustersClient.BeginDelete +// method. +func (client *ExadbVMClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, exadbVMClusterName string, options *ExadbVMClustersClientBeginDeleteOptions) (*runtime.Poller[ExadbVMClustersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, exadbVMClusterName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExadbVMClustersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExadbVMClustersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete a ExadbVmCluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *ExadbVMClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, exadbVMClusterName string, options *ExadbVMClustersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ExadbVMClustersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, exadbVMClusterName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExadbVMClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, exadbVMClusterName string, _ *ExadbVMClustersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exadbVMClusterName == "" { + return nil, errors.New("parameter exadbVMClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exadbVmClusterName}", url.PathEscape(exadbVMClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a ExadbVmCluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exadbVMClusterName - The name of the ExadbVmCluster +// - options - ExadbVMClustersClientGetOptions contains the optional parameters for the ExadbVMClustersClient.Get method. +func (client *ExadbVMClustersClient) Get(ctx context.Context, resourceGroupName string, exadbVMClusterName string, options *ExadbVMClustersClientGetOptions) (ExadbVMClustersClientGetResponse, error) { + var err error + const operationName = "ExadbVMClustersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, exadbVMClusterName, options) + if err != nil { + return ExadbVMClustersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExadbVMClustersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExadbVMClustersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ExadbVMClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, exadbVMClusterName string, _ *ExadbVMClustersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exadbVMClusterName == "" { + return nil, errors.New("parameter exadbVMClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exadbVmClusterName}", url.PathEscape(exadbVMClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExadbVMClustersClient) getHandleResponse(resp *http.Response) (ExadbVMClustersClientGetResponse, error) { + result := ExadbVMClustersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExadbVMCluster); err != nil { + return ExadbVMClustersClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List ExadbVmCluster resources by resource group +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ExadbVMClustersClientListByResourceGroupOptions contains the optional parameters for the ExadbVMClustersClient.NewListByResourceGroupPager +// method. +func (client *ExadbVMClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ExadbVMClustersClientListByResourceGroupOptions) *runtime.Pager[ExadbVMClustersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ExadbVMClustersClientListByResourceGroupResponse]{ + More: func(page ExadbVMClustersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExadbVMClustersClientListByResourceGroupResponse) (ExadbVMClustersClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ExadbVMClustersClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return ExadbVMClustersClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ExadbVMClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ExadbVMClustersClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ExadbVMClustersClient) listByResourceGroupHandleResponse(resp *http.Response) (ExadbVMClustersClientListByResourceGroupResponse, error) { + result := ExadbVMClustersClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExadbVMClusterListResult); err != nil { + return ExadbVMClustersClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List ExadbVmCluster resources by subscription ID +// +// Generated from API version 2025-03-01 +// - options - ExadbVMClustersClientListBySubscriptionOptions contains the optional parameters for the ExadbVMClustersClient.NewListBySubscriptionPager +// method. +func (client *ExadbVMClustersClient) NewListBySubscriptionPager(options *ExadbVMClustersClientListBySubscriptionOptions) *runtime.Pager[ExadbVMClustersClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[ExadbVMClustersClientListBySubscriptionResponse]{ + More: func(page ExadbVMClustersClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExadbVMClustersClientListBySubscriptionResponse) (ExadbVMClustersClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ExadbVMClustersClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return ExadbVMClustersClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *ExadbVMClustersClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ExadbVMClustersClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *ExadbVMClustersClient) listBySubscriptionHandleResponse(resp *http.Response) (ExadbVMClustersClientListBySubscriptionResponse, error) { + result := ExadbVMClustersClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExadbVMClusterListResult); err != nil { + return ExadbVMClustersClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginRemoveVMs - Remove VMs from the VM Cluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exadbVMClusterName - The name of the ExadbVmCluster +// - body - The content of the action request +// - options - ExadbVMClustersClientBeginRemoveVMsOptions contains the optional parameters for the ExadbVMClustersClient.BeginRemoveVMs +// method. +func (client *ExadbVMClustersClient) BeginRemoveVMs(ctx context.Context, resourceGroupName string, exadbVMClusterName string, body RemoveVirtualMachineFromExadbVMClusterDetails, options *ExadbVMClustersClientBeginRemoveVMsOptions) (*runtime.Poller[ExadbVMClustersClientRemoveVMsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.removeVMs(ctx, resourceGroupName, exadbVMClusterName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExadbVMClustersClientRemoveVMsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExadbVMClustersClientRemoveVMsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// RemoveVMs - Remove VMs from the VM Cluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *ExadbVMClustersClient) removeVMs(ctx context.Context, resourceGroupName string, exadbVMClusterName string, body RemoveVirtualMachineFromExadbVMClusterDetails, options *ExadbVMClustersClientBeginRemoveVMsOptions) (*http.Response, error) { + var err error + const operationName = "ExadbVMClustersClient.BeginRemoveVMs" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.removeVMsCreateRequest(ctx, resourceGroupName, exadbVMClusterName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// removeVMsCreateRequest creates the RemoveVMs request. +func (client *ExadbVMClustersClient) removeVMsCreateRequest(ctx context.Context, resourceGroupName string, exadbVMClusterName string, body RemoveVirtualMachineFromExadbVMClusterDetails, _ *ExadbVMClustersClientBeginRemoveVMsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/removeVms" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exadbVMClusterName == "" { + return nil, errors.New("parameter exadbVMClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exadbVmClusterName}", url.PathEscape(exadbVMClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// BeginUpdate - Update a ExadbVmCluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exadbVMClusterName - The name of the ExadbVmCluster +// - properties - The resource properties to be updated. +// - options - ExadbVMClustersClientBeginUpdateOptions contains the optional parameters for the ExadbVMClustersClient.BeginUpdate +// method. +func (client *ExadbVMClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, exadbVMClusterName string, properties ExadbVMClusterUpdate, options *ExadbVMClustersClientBeginUpdateOptions) (*runtime.Poller[ExadbVMClustersClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, exadbVMClusterName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExadbVMClustersClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExadbVMClustersClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update a ExadbVmCluster +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *ExadbVMClustersClient) update(ctx context.Context, resourceGroupName string, exadbVMClusterName string, properties ExadbVMClusterUpdate, options *ExadbVMClustersClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ExadbVMClustersClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, exadbVMClusterName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *ExadbVMClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, exadbVMClusterName string, properties ExadbVMClusterUpdate, _ *ExadbVMClustersClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exadbVMClusterName == "" { + return nil, errors.New("parameter exadbVMClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exadbVmClusterName}", url.PathEscape(exadbVMClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/exascaledbnodes_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/exascaledbnodes_client.go new file mode 100644 index 000000000000..507f9bca9c17 --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/exascaledbnodes_client.go @@ -0,0 +1,261 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armoracledatabase + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ExascaleDbNodesClient contains the methods for the ExascaleDbNodes group. +// Don't use this type directly, use NewExascaleDbNodesClient() instead. +type ExascaleDbNodesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExascaleDbNodesClient creates a new instance of ExascaleDbNodesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExascaleDbNodesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExascaleDbNodesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExascaleDbNodesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginAction - VM actions on DbNode of ExadbVmCluster by the provided filter +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exadbVMClusterName - The name of the ExadbVmCluster +// - exascaleDbNodeName - The name of the ExascaleDbNode +// - body - The content of the action request +// - options - ExascaleDbNodesClientBeginActionOptions contains the optional parameters for the ExascaleDbNodesClient.BeginAction +// method. +func (client *ExascaleDbNodesClient) BeginAction(ctx context.Context, resourceGroupName string, exadbVMClusterName string, exascaleDbNodeName string, body DbNodeAction, options *ExascaleDbNodesClientBeginActionOptions) (*runtime.Poller[ExascaleDbNodesClientActionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.action(ctx, resourceGroupName, exadbVMClusterName, exascaleDbNodeName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExascaleDbNodesClientActionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExascaleDbNodesClientActionResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Action - VM actions on DbNode of ExadbVmCluster by the provided filter +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *ExascaleDbNodesClient) action(ctx context.Context, resourceGroupName string, exadbVMClusterName string, exascaleDbNodeName string, body DbNodeAction, options *ExascaleDbNodesClientBeginActionOptions) (*http.Response, error) { + var err error + const operationName = "ExascaleDbNodesClient.BeginAction" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.actionCreateRequest(ctx, resourceGroupName, exadbVMClusterName, exascaleDbNodeName, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// actionCreateRequest creates the Action request. +func (client *ExascaleDbNodesClient) actionCreateRequest(ctx context.Context, resourceGroupName string, exadbVMClusterName string, exascaleDbNodeName string, body DbNodeAction, _ *ExascaleDbNodesClientBeginActionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}/action" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exadbVMClusterName == "" { + return nil, errors.New("parameter exadbVMClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exadbVmClusterName}", url.PathEscape(exadbVMClusterName)) + if exascaleDbNodeName == "" { + return nil, errors.New("parameter exascaleDbNodeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exascaleDbNodeName}", url.PathEscape(exascaleDbNodeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// Get - Get a ExascaleDbNode +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exadbVMClusterName - The name of the ExadbVmCluster +// - exascaleDbNodeName - The name of the ExascaleDbNode +// - options - ExascaleDbNodesClientGetOptions contains the optional parameters for the ExascaleDbNodesClient.Get method. +func (client *ExascaleDbNodesClient) Get(ctx context.Context, resourceGroupName string, exadbVMClusterName string, exascaleDbNodeName string, options *ExascaleDbNodesClientGetOptions) (ExascaleDbNodesClientGetResponse, error) { + var err error + const operationName = "ExascaleDbNodesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, exadbVMClusterName, exascaleDbNodeName, options) + if err != nil { + return ExascaleDbNodesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExascaleDbNodesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExascaleDbNodesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ExascaleDbNodesClient) getCreateRequest(ctx context.Context, resourceGroupName string, exadbVMClusterName string, exascaleDbNodeName string, _ *ExascaleDbNodesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exadbVMClusterName == "" { + return nil, errors.New("parameter exadbVMClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exadbVmClusterName}", url.PathEscape(exadbVMClusterName)) + if exascaleDbNodeName == "" { + return nil, errors.New("parameter exascaleDbNodeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exascaleDbNodeName}", url.PathEscape(exascaleDbNodeName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExascaleDbNodesClient) getHandleResponse(resp *http.Response) (ExascaleDbNodesClientGetResponse, error) { + result := ExascaleDbNodesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExascaleDbNode); err != nil { + return ExascaleDbNodesClientGetResponse{}, err + } + return result, nil +} + +// NewListByParentPager - List ExascaleDbNode resources by ExadbVmCluster +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exadbVMClusterName - The name of the ExadbVmCluster +// - options - ExascaleDbNodesClientListByParentOptions contains the optional parameters for the ExascaleDbNodesClient.NewListByParentPager +// method. +func (client *ExascaleDbNodesClient) NewListByParentPager(resourceGroupName string, exadbVMClusterName string, options *ExascaleDbNodesClientListByParentOptions) *runtime.Pager[ExascaleDbNodesClientListByParentResponse] { + return runtime.NewPager(runtime.PagingHandler[ExascaleDbNodesClientListByParentResponse]{ + More: func(page ExascaleDbNodesClientListByParentResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExascaleDbNodesClientListByParentResponse) (ExascaleDbNodesClientListByParentResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ExascaleDbNodesClient.NewListByParentPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByParentCreateRequest(ctx, resourceGroupName, exadbVMClusterName, options) + }, nil) + if err != nil { + return ExascaleDbNodesClientListByParentResponse{}, err + } + return client.listByParentHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByParentCreateRequest creates the ListByParent request. +func (client *ExascaleDbNodesClient) listByParentCreateRequest(ctx context.Context, resourceGroupName string, exadbVMClusterName string, _ *ExascaleDbNodesClientListByParentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exadbVMClusterName == "" { + return nil, errors.New("parameter exadbVMClusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exadbVmClusterName}", url.PathEscape(exadbVMClusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByParentHandleResponse handles the ListByParent response. +func (client *ExascaleDbNodesClient) listByParentHandleResponse(resp *http.Response) (ExascaleDbNodesClientListByParentResponse, error) { + result := ExascaleDbNodesClientListByParentResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExascaleDbNodeListResult); err != nil { + return ExascaleDbNodesClientListByParentResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/exascaledbstoragevaults_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/exascaledbstoragevaults_client.go new file mode 100644 index 000000000000..e8e3b391505a --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/exascaledbstoragevaults_client.go @@ -0,0 +1,460 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armoracledatabase + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ExascaleDbStorageVaultsClient contains the methods for the ExascaleDbStorageVaults group. +// Don't use this type directly, use NewExascaleDbStorageVaultsClient() instead. +type ExascaleDbStorageVaultsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExascaleDbStorageVaultsClient creates a new instance of ExascaleDbStorageVaultsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewExascaleDbStorageVaultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExascaleDbStorageVaultsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExascaleDbStorageVaultsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Create a ExascaleDbStorageVault +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exascaleDbStorageVaultName - The name of the ExascaleDbStorageVault +// - resource - Resource create parameters. +// - options - ExascaleDbStorageVaultsClientBeginCreateOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.BeginCreate +// method. +func (client *ExascaleDbStorageVaultsClient) BeginCreate(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, resource ExascaleDbStorageVault, options *ExascaleDbStorageVaultsClientBeginCreateOptions) (*runtime.Poller[ExascaleDbStorageVaultsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, exascaleDbStorageVaultName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExascaleDbStorageVaultsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExascaleDbStorageVaultsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Create a ExascaleDbStorageVault +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *ExascaleDbStorageVaultsClient) create(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, resource ExascaleDbStorageVault, options *ExascaleDbStorageVaultsClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "ExascaleDbStorageVaultsClient.BeginCreate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceGroupName, exascaleDbStorageVaultName, resource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createCreateRequest creates the Create request. +func (client *ExascaleDbStorageVaultsClient) createCreateRequest(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, resource ExascaleDbStorageVault, _ *ExascaleDbStorageVaultsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exascaleDbStorageVaultName == "" { + return nil, errors.New("parameter exascaleDbStorageVaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exascaleDbStorageVaultName}", url.PathEscape(exascaleDbStorageVaultName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete a ExascaleDbStorageVault +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exascaleDbStorageVaultName - The name of the ExascaleDbStorageVault +// - options - ExascaleDbStorageVaultsClientBeginDeleteOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.BeginDelete +// method. +func (client *ExascaleDbStorageVaultsClient) BeginDelete(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, options *ExascaleDbStorageVaultsClientBeginDeleteOptions) (*runtime.Poller[ExascaleDbStorageVaultsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, exascaleDbStorageVaultName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExascaleDbStorageVaultsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExascaleDbStorageVaultsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete a ExascaleDbStorageVault +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *ExascaleDbStorageVaultsClient) deleteOperation(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, options *ExascaleDbStorageVaultsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ExascaleDbStorageVaultsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, exascaleDbStorageVaultName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExascaleDbStorageVaultsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, _ *ExascaleDbStorageVaultsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exascaleDbStorageVaultName == "" { + return nil, errors.New("parameter exascaleDbStorageVaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exascaleDbStorageVaultName}", url.PathEscape(exascaleDbStorageVaultName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a ExascaleDbStorageVault +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exascaleDbStorageVaultName - The name of the ExascaleDbStorageVault +// - options - ExascaleDbStorageVaultsClientGetOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.Get +// method. +func (client *ExascaleDbStorageVaultsClient) Get(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, options *ExascaleDbStorageVaultsClientGetOptions) (ExascaleDbStorageVaultsClientGetResponse, error) { + var err error + const operationName = "ExascaleDbStorageVaultsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, exascaleDbStorageVaultName, options) + if err != nil { + return ExascaleDbStorageVaultsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExascaleDbStorageVaultsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExascaleDbStorageVaultsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ExascaleDbStorageVaultsClient) getCreateRequest(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, _ *ExascaleDbStorageVaultsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exascaleDbStorageVaultName == "" { + return nil, errors.New("parameter exascaleDbStorageVaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exascaleDbStorageVaultName}", url.PathEscape(exascaleDbStorageVaultName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ExascaleDbStorageVaultsClient) getHandleResponse(resp *http.Response) (ExascaleDbStorageVaultsClientGetResponse, error) { + result := ExascaleDbStorageVaultsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExascaleDbStorageVault); err != nil { + return ExascaleDbStorageVaultsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List ExascaleDbStorageVault resources by resource group +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ExascaleDbStorageVaultsClientListByResourceGroupOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.NewListByResourceGroupPager +// method. +func (client *ExascaleDbStorageVaultsClient) NewListByResourceGroupPager(resourceGroupName string, options *ExascaleDbStorageVaultsClientListByResourceGroupOptions) *runtime.Pager[ExascaleDbStorageVaultsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ExascaleDbStorageVaultsClientListByResourceGroupResponse]{ + More: func(page ExascaleDbStorageVaultsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExascaleDbStorageVaultsClientListByResourceGroupResponse) (ExascaleDbStorageVaultsClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ExascaleDbStorageVaultsClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return ExascaleDbStorageVaultsClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ExascaleDbStorageVaultsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ExascaleDbStorageVaultsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ExascaleDbStorageVaultsClient) listByResourceGroupHandleResponse(resp *http.Response) (ExascaleDbStorageVaultsClientListByResourceGroupResponse, error) { + result := ExascaleDbStorageVaultsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExascaleDbStorageVaultListResult); err != nil { + return ExascaleDbStorageVaultsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List ExascaleDbStorageVault resources by subscription ID +// +// Generated from API version 2025-03-01 +// - options - ExascaleDbStorageVaultsClientListBySubscriptionOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.NewListBySubscriptionPager +// method. +func (client *ExascaleDbStorageVaultsClient) NewListBySubscriptionPager(options *ExascaleDbStorageVaultsClientListBySubscriptionOptions) *runtime.Pager[ExascaleDbStorageVaultsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[ExascaleDbStorageVaultsClientListBySubscriptionResponse]{ + More: func(page ExascaleDbStorageVaultsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExascaleDbStorageVaultsClientListBySubscriptionResponse) (ExascaleDbStorageVaultsClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ExascaleDbStorageVaultsClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return ExascaleDbStorageVaultsClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *ExascaleDbStorageVaultsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ExascaleDbStorageVaultsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *ExascaleDbStorageVaultsClient) listBySubscriptionHandleResponse(resp *http.Response) (ExascaleDbStorageVaultsClientListBySubscriptionResponse, error) { + result := ExascaleDbStorageVaultsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExascaleDbStorageVaultListResult); err != nil { + return ExascaleDbStorageVaultsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update a ExascaleDbStorageVault +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - exascaleDbStorageVaultName - The name of the ExascaleDbStorageVault +// - properties - The resource properties to be updated. +// - options - ExascaleDbStorageVaultsClientBeginUpdateOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.BeginUpdate +// method. +func (client *ExascaleDbStorageVaultsClient) BeginUpdate(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, properties ExascaleDbStorageVaultTagsUpdate, options *ExascaleDbStorageVaultsClientBeginUpdateOptions) (*runtime.Poller[ExascaleDbStorageVaultsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, exascaleDbStorageVaultName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExascaleDbStorageVaultsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExascaleDbStorageVaultsClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Update a ExascaleDbStorageVault +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *ExascaleDbStorageVaultsClient) update(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, properties ExascaleDbStorageVaultTagsUpdate, options *ExascaleDbStorageVaultsClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ExascaleDbStorageVaultsClient.BeginUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, exascaleDbStorageVaultName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *ExascaleDbStorageVaultsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, properties ExascaleDbStorageVaultTagsUpdate, _ *ExascaleDbStorageVaultsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if exascaleDbStorageVaultName == "" { + return nil, errors.New("parameter exascaleDbStorageVaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exascaleDbStorageVaultName}", url.PathEscape(exascaleDbStorageVaultName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasebackups_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasebackups_server.go index 5e0bd6cdfd6b..300d65d8f12f 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasebackups_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasebackups_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -29,16 +26,16 @@ type AutonomousDatabaseBackupsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, resource armoracledatabase.AutonomousDatabaseBackup, options *armoracledatabase.AutonomousDatabaseBackupsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method AutonomousDatabaseBackupsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, options *armoracledatabase.AutonomousDatabaseBackupsClientBeginDeleteOptions) (resp azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method AutonomousDatabaseBackupsClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, autonomousdatabasename string, adbbackupid string, options *armoracledatabase.AutonomousDatabaseBackupsClientGetOptions) (resp azfake.Responder[armoracledatabase.AutonomousDatabaseBackupsClientGetResponse], errResp azfake.ErrorResponder) - // NewListByAutonomousDatabasePager is the fake for method AutonomousDatabaseBackupsClient.NewListByAutonomousDatabasePager + // NewListByParentPager is the fake for method AutonomousDatabaseBackupsClient.NewListByParentPager // HTTP status codes to indicate success: http.StatusOK - NewListByAutonomousDatabasePager func(resourceGroupName string, autonomousdatabasename string, options *armoracledatabase.AutonomousDatabaseBackupsClientListByAutonomousDatabaseOptions) (resp azfake.PagerResponder[armoracledatabase.AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse]) + NewListByParentPager func(resourceGroupName string, autonomousdatabasename string, options *armoracledatabase.AutonomousDatabaseBackupsClientListByParentOptions) (resp azfake.PagerResponder[armoracledatabase.AutonomousDatabaseBackupsClientListByParentResponse]) // BeginUpdate is the fake for method AutonomousDatabaseBackupsClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted @@ -50,22 +47,22 @@ type AutonomousDatabaseBackupsServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewAutonomousDatabaseBackupsServerTransport(srv *AutonomousDatabaseBackupsServer) *AutonomousDatabaseBackupsServerTransport { return &AutonomousDatabaseBackupsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientDeleteResponse]](), - newListByAutonomousDatabasePager: newTracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientUpdateResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientDeleteResponse]](), + newListByParentPager: newTracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabaseBackupsClientListByParentResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientUpdateResponse]](), } } // AutonomousDatabaseBackupsServerTransport connects instances of armoracledatabase.AutonomousDatabaseBackupsClient to instances of AutonomousDatabaseBackupsServer. // Don't use this type directly, use NewAutonomousDatabaseBackupsServerTransport instead. type AutonomousDatabaseBackupsServerTransport struct { - srv *AutonomousDatabaseBackupsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientDeleteResponse]] - newListByAutonomousDatabasePager *tracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse]] - beginUpdate *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientUpdateResponse]] + srv *AutonomousDatabaseBackupsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientDeleteResponse]] + newListByParentPager *tracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabaseBackupsClientListByParentResponse]] + beginUpdate *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabaseBackupsClientUpdateResponse]] } // Do implements the policy.Transporter interface for AutonomousDatabaseBackupsServerTransport. @@ -76,29 +73,48 @@ func (a *AutonomousDatabaseBackupsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AutonomousDatabaseBackupsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "AutonomousDatabaseBackupsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AutonomousDatabaseBackupsClient.Get": - resp, err = a.dispatchGet(req) - case "AutonomousDatabaseBackupsClient.NewListByAutonomousDatabasePager": - resp, err = a.dispatchNewListByAutonomousDatabasePager(req) - case "AutonomousDatabaseBackupsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AutonomousDatabaseBackupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if autonomousDatabaseBackupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = autonomousDatabaseBackupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AutonomousDatabaseBackupsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AutonomousDatabaseBackupsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AutonomousDatabaseBackupsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AutonomousDatabaseBackupsClient.NewListByParentPager": + res.resp, res.err = a.dispatchNewListByParentPager(req) + case "AutonomousDatabaseBackupsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AutonomousDatabaseBackupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -190,9 +206,9 @@ func (a *AutonomousDatabaseBackupsServerTransport) dispatchBeginDelete(req *http return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { a.beginDelete.remove(req) @@ -238,12 +254,12 @@ func (a *AutonomousDatabaseBackupsServerTransport) dispatchGet(req *http.Request return resp, nil } -func (a *AutonomousDatabaseBackupsServerTransport) dispatchNewListByAutonomousDatabasePager(req *http.Request) (*http.Response, error) { - if a.srv.NewListByAutonomousDatabasePager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByAutonomousDatabasePager not implemented")} +func (a *AutonomousDatabaseBackupsServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListByParentPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")} } - newListByAutonomousDatabasePager := a.newListByAutonomousDatabasePager.get(req) - if newListByAutonomousDatabasePager == nil { + newListByParentPager := a.newListByParentPager.get(req) + if newListByParentPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/autonomousDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/autonomousDatabaseBackups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -258,23 +274,23 @@ func (a *AutonomousDatabaseBackupsServerTransport) dispatchNewListByAutonomousDa if err != nil { return nil, err } - resp := a.srv.NewListByAutonomousDatabasePager(resourceGroupNameParam, autonomousdatabasenameParam, nil) - newListByAutonomousDatabasePager = &resp - a.newListByAutonomousDatabasePager.add(req, newListByAutonomousDatabasePager) - server.PagerResponderInjectNextLinks(newListByAutonomousDatabasePager, req, func(page *armoracledatabase.AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse, createLink func() string) { + resp := a.srv.NewListByParentPager(resourceGroupNameParam, autonomousdatabasenameParam, nil) + newListByParentPager = &resp + a.newListByParentPager.add(req, newListByParentPager) + server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armoracledatabase.AutonomousDatabaseBackupsClientListByParentResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(newListByAutonomousDatabasePager, req) + resp, err := server.PagerResponderNext(newListByParentPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { - a.newListByAutonomousDatabasePager.remove(req) + a.newListByParentPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(newListByAutonomousDatabasePager) { - a.newListByAutonomousDatabasePager.remove(req) + if !server.PagerResponderMore(newListByParentPager) { + a.newListByParentPager.remove(req) } return resp, nil } @@ -330,3 +346,9 @@ func (a *AutonomousDatabaseBackupsServerTransport) dispatchBeginUpdate(req *http return resp, nil } + +// set this to conditionally intercept incoming requests to AutonomousDatabaseBackupsServerTransport +var autonomousDatabaseBackupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasecharactersets_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasecharactersets_server.go index 9d1bd70f9046..873f8dfb278d 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasecharactersets_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasecharactersets_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (a *AutonomousDatabaseCharacterSetsServerTransport) Do(req *http.Request) ( return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AutonomousDatabaseCharacterSetsClient.Get": - resp, err = a.dispatchGet(req) - case "AutonomousDatabaseCharacterSetsClient.NewListByLocationPager": - resp, err = a.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AutonomousDatabaseCharacterSetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if autonomousDatabaseCharacterSetsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = autonomousDatabaseCharacterSetsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AutonomousDatabaseCharacterSetsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AutonomousDatabaseCharacterSetsClient.NewListByLocationPager": + res.resp, res.err = a.dispatchNewListByLocationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AutonomousDatabaseCharacterSetsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (a *AutonomousDatabaseCharacterSetsServerTransport) dispatchNewListByLocati } return resp, nil } + +// set this to conditionally intercept incoming requests to AutonomousDatabaseCharacterSetsServerTransport +var autonomousDatabaseCharacterSetsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasenationalcharactersets_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasenationalcharactersets_server.go index dafabee3cd7d..7df38f98742b 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasenationalcharactersets_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabasenationalcharactersets_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (a *AutonomousDatabaseNationalCharacterSetsServerTransport) Do(req *http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AutonomousDatabaseNationalCharacterSetsClient.Get": - resp, err = a.dispatchGet(req) - case "AutonomousDatabaseNationalCharacterSetsClient.NewListByLocationPager": - resp, err = a.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AutonomousDatabaseNationalCharacterSetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if autonomousDatabaseNationalCharacterSetsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = autonomousDatabaseNationalCharacterSetsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AutonomousDatabaseNationalCharacterSetsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AutonomousDatabaseNationalCharacterSetsClient.NewListByLocationPager": + res.resp, res.err = a.dispatchNewListByLocationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AutonomousDatabaseNationalCharacterSetsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (a *AutonomousDatabaseNationalCharacterSetsServerTransport) dispatchNewList } return resp, nil } + +// set this to conditionally intercept incoming requests to AutonomousDatabaseNationalCharacterSetsServerTransport +var autonomousDatabaseNationalCharacterSetsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabases_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabases_server.go index ef146360cfaa..ba93aa384fa5 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabases_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabases_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -24,12 +21,16 @@ import ( // AutonomousDatabasesServer is a fake server for instances of the armoracledatabase.AutonomousDatabasesClient type. type AutonomousDatabasesServer struct { + // BeginChangeDisasterRecoveryConfiguration is the fake for method AutonomousDatabasesClient.BeginChangeDisasterRecoveryConfiguration + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginChangeDisasterRecoveryConfiguration func(ctx context.Context, resourceGroupName string, autonomousdatabasename string, body armoracledatabase.DisasterRecoveryConfigurationDetails, options *armoracledatabase.AutonomousDatabasesClientBeginChangeDisasterRecoveryConfigurationOptions) (resp azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method AutonomousDatabasesClient.BeginCreateOrUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, autonomousdatabasename string, resource armoracledatabase.AutonomousDatabase, options *armoracledatabase.AutonomousDatabasesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method AutonomousDatabasesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, autonomousdatabasename string, options *armoracledatabase.AutonomousDatabasesClientBeginDeleteOptions) (resp azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientDeleteResponse], errResp azfake.ErrorResponder) // BeginFailover is the fake for method AutonomousDatabasesClient.BeginFailover @@ -74,32 +75,34 @@ type AutonomousDatabasesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewAutonomousDatabasesServerTransport(srv *AutonomousDatabasesServer) *AutonomousDatabasesServerTransport { return &AutonomousDatabasesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientDeleteResponse]](), - beginFailover: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientFailoverResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabasesClientListByResourceGroupResponse]](), - newListBySubscriptionPager: newTracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabasesClientListBySubscriptionResponse]](), - beginRestore: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientRestoreResponse]](), - beginShrink: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientShrinkResponse]](), - beginSwitchover: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientSwitchoverResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientUpdateResponse]](), + srv: srv, + beginChangeDisasterRecoveryConfiguration: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientDeleteResponse]](), + beginFailover: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientFailoverResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabasesClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabasesClientListBySubscriptionResponse]](), + beginRestore: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientRestoreResponse]](), + beginShrink: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientShrinkResponse]](), + beginSwitchover: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientSwitchoverResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientUpdateResponse]](), } } // AutonomousDatabasesServerTransport connects instances of armoracledatabase.AutonomousDatabasesClient to instances of AutonomousDatabasesServer. // Don't use this type directly, use NewAutonomousDatabasesServerTransport instead. type AutonomousDatabasesServerTransport struct { - srv *AutonomousDatabasesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientDeleteResponse]] - beginFailover *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientFailoverResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabasesClientListByResourceGroupResponse]] - newListBySubscriptionPager *tracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabasesClientListBySubscriptionResponse]] - beginRestore *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientRestoreResponse]] - beginShrink *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientShrinkResponse]] - beginSwitchover *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientSwitchoverResponse]] - beginUpdate *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientUpdateResponse]] + srv *AutonomousDatabasesServer + beginChangeDisasterRecoveryConfiguration *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse]] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientDeleteResponse]] + beginFailover *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientFailoverResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabasesClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armoracledatabase.AutonomousDatabasesClientListBySubscriptionResponse]] + beginRestore *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientRestoreResponse]] + beginShrink *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientShrinkResponse]] + beginSwitchover *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientSwitchoverResponse]] + beginUpdate *tracker[azfake.PollerResponder[armoracledatabase.AutonomousDatabasesClientUpdateResponse]] } // Do implements the policy.Transporter interface for AutonomousDatabasesServerTransport. @@ -110,40 +113,109 @@ func (a *AutonomousDatabasesServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "AutonomousDatabasesClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "AutonomousDatabasesClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AutonomousDatabasesClient.BeginFailover": - resp, err = a.dispatchBeginFailover(req) - case "AutonomousDatabasesClient.GenerateWallet": - resp, err = a.dispatchGenerateWallet(req) - case "AutonomousDatabasesClient.Get": - resp, err = a.dispatchGet(req) - case "AutonomousDatabasesClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - case "AutonomousDatabasesClient.NewListBySubscriptionPager": - resp, err = a.dispatchNewListBySubscriptionPager(req) - case "AutonomousDatabasesClient.BeginRestore": - resp, err = a.dispatchBeginRestore(req) - case "AutonomousDatabasesClient.BeginShrink": - resp, err = a.dispatchBeginShrink(req) - case "AutonomousDatabasesClient.BeginSwitchover": - resp, err = a.dispatchBeginSwitchover(req) - case "AutonomousDatabasesClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) + return a.dispatchToMethodFake(req, method) +} + +func (a *AutonomousDatabasesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if autonomousDatabasesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = autonomousDatabasesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AutonomousDatabasesClient.BeginChangeDisasterRecoveryConfiguration": + res.resp, res.err = a.dispatchBeginChangeDisasterRecoveryConfiguration(req) + case "AutonomousDatabasesClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AutonomousDatabasesClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AutonomousDatabasesClient.BeginFailover": + res.resp, res.err = a.dispatchBeginFailover(req) + case "AutonomousDatabasesClient.GenerateWallet": + res.resp, res.err = a.dispatchGenerateWallet(req) + case "AutonomousDatabasesClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AutonomousDatabasesClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + case "AutonomousDatabasesClient.NewListBySubscriptionPager": + res.resp, res.err = a.dispatchNewListBySubscriptionPager(req) + case "AutonomousDatabasesClient.BeginRestore": + res.resp, res.err = a.dispatchBeginRestore(req) + case "AutonomousDatabasesClient.BeginShrink": + res.resp, res.err = a.dispatchBeginShrink(req) + case "AutonomousDatabasesClient.BeginSwitchover": + res.resp, res.err = a.dispatchBeginSwitchover(req) + case "AutonomousDatabasesClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } +} +func (a *AutonomousDatabasesServerTransport) dispatchBeginChangeDisasterRecoveryConfiguration(req *http.Request) (*http.Response, error) { + if a.srv.BeginChangeDisasterRecoveryConfiguration == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginChangeDisasterRecoveryConfiguration not implemented")} + } + beginChangeDisasterRecoveryConfiguration := a.beginChangeDisasterRecoveryConfiguration.get(req) + if beginChangeDisasterRecoveryConfiguration == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/autonomousDatabases/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/changeDisasterRecoveryConfiguration` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.DisasterRecoveryConfigurationDetails](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + autonomousdatabasenameParam, err := url.PathUnescape(matches[regex.SubexpIndex("autonomousdatabasename")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginChangeDisasterRecoveryConfiguration(req.Context(), resourceGroupNameParam, autonomousdatabasenameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginChangeDisasterRecoveryConfiguration = &respr + a.beginChangeDisasterRecoveryConfiguration.add(req, beginChangeDisasterRecoveryConfiguration) + } + + resp, err := server.PollerResponderNext(beginChangeDisasterRecoveryConfiguration, req) if err != nil { return nil, err } + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + a.beginChangeDisasterRecoveryConfiguration.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginChangeDisasterRecoveryConfiguration) { + a.beginChangeDisasterRecoveryConfiguration.remove(req) + } + return resp, nil } @@ -228,9 +300,9 @@ func (a *AutonomousDatabasesServerTransport) dispatchBeginDelete(req *http.Reque return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { a.beginDelete.remove(req) @@ -614,3 +686,9 @@ func (a *AutonomousDatabasesServerTransport) dispatchBeginUpdate(req *http.Reque return resp, nil } + +// set this to conditionally intercept incoming requests to AutonomousDatabasesServerTransport +var autonomousDatabasesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabaseversions_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabaseversions_server.go index de5dcb9d5459..849bd50421d4 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabaseversions_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/autonomousdatabaseversions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (a *AutonomousDatabaseVersionsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AutonomousDatabaseVersionsClient.Get": - resp, err = a.dispatchGet(req) - case "AutonomousDatabaseVersionsClient.NewListByLocationPager": - resp, err = a.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AutonomousDatabaseVersionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if autonomousDatabaseVersionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = autonomousDatabaseVersionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AutonomousDatabaseVersionsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AutonomousDatabaseVersionsClient.NewListByLocationPager": + res.resp, res.err = a.dispatchNewListByLocationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AutonomousDatabaseVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (a *AutonomousDatabaseVersionsServerTransport) dispatchNewListByLocationPag } return resp, nil } + +// set this to conditionally intercept incoming requests to AutonomousDatabaseVersionsServerTransport +var autonomousDatabaseVersionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/cloudexadatainfrastructures_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/cloudexadatainfrastructures_server.go index 851f6f489568..79c2a64b0ec2 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/cloudexadatainfrastructures_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/cloudexadatainfrastructures_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -33,7 +30,7 @@ type CloudExadataInfrastructuresServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, resource armoracledatabase.CloudExadataInfrastructure, options *armoracledatabase.CloudExadataInfrastructuresClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.CloudExadataInfrastructuresClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method CloudExadataInfrastructuresClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, options *armoracledatabase.CloudExadataInfrastructuresClientBeginDeleteOptions) (resp azfake.PollerResponder[armoracledatabase.CloudExadataInfrastructuresClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method CloudExadataInfrastructuresClient.Get @@ -88,33 +85,52 @@ func (c *CloudExadataInfrastructuresServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "CloudExadataInfrastructuresClient.BeginAddStorageCapacity": - resp, err = c.dispatchBeginAddStorageCapacity(req) - case "CloudExadataInfrastructuresClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "CloudExadataInfrastructuresClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "CloudExadataInfrastructuresClient.Get": - resp, err = c.dispatchGet(req) - case "CloudExadataInfrastructuresClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "CloudExadataInfrastructuresClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - case "CloudExadataInfrastructuresClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return c.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (c *CloudExadataInfrastructuresServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if cloudExadataInfrastructuresServerTransportInterceptor != nil { + res.resp, res.err, intercepted = cloudExadataInfrastructuresServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CloudExadataInfrastructuresClient.BeginAddStorageCapacity": + res.resp, res.err = c.dispatchBeginAddStorageCapacity(req) + case "CloudExadataInfrastructuresClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "CloudExadataInfrastructuresClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "CloudExadataInfrastructuresClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CloudExadataInfrastructuresClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "CloudExadataInfrastructuresClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + case "CloudExadataInfrastructuresClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CloudExadataInfrastructuresServerTransport) dispatchBeginAddStorageCapacity(req *http.Request) (*http.Response, error) { @@ -242,9 +258,9 @@ func (c *CloudExadataInfrastructuresServerTransport) dispatchBeginDelete(req *ht return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { c.beginDelete.remove(req) @@ -403,3 +419,9 @@ func (c *CloudExadataInfrastructuresServerTransport) dispatchBeginUpdate(req *ht return resp, nil } + +// set this to conditionally intercept incoming requests to CloudExadataInfrastructuresServerTransport +var cloudExadataInfrastructuresServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/cloudvmclusters_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/cloudvmclusters_server.go index 36881c8e6c04..39efa46102ff 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/cloudvmclusters_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/cloudvmclusters_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -33,7 +30,7 @@ type CloudVMClustersServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, cloudvmclustername string, resource armoracledatabase.CloudVMCluster, options *armoracledatabase.CloudVMClustersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.CloudVMClustersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method CloudVMClustersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, cloudvmclustername string, options *armoracledatabase.CloudVMClustersClientBeginDeleteOptions) (resp azfake.PollerResponder[armoracledatabase.CloudVMClustersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method CloudVMClustersClient.Get @@ -98,37 +95,56 @@ func (c *CloudVMClustersServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "CloudVMClustersClient.BeginAddVMs": - resp, err = c.dispatchBeginAddVMs(req) - case "CloudVMClustersClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "CloudVMClustersClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "CloudVMClustersClient.Get": - resp, err = c.dispatchGet(req) - case "CloudVMClustersClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "CloudVMClustersClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - case "CloudVMClustersClient.ListPrivateIPAddresses": - resp, err = c.dispatchListPrivateIPAddresses(req) - case "CloudVMClustersClient.BeginRemoveVMs": - resp, err = c.dispatchBeginRemoveVMs(req) - case "CloudVMClustersClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return c.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (c *CloudVMClustersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if cloudVMClustersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = cloudVMClustersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CloudVMClustersClient.BeginAddVMs": + res.resp, res.err = c.dispatchBeginAddVMs(req) + case "CloudVMClustersClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "CloudVMClustersClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "CloudVMClustersClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CloudVMClustersClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "CloudVMClustersClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + case "CloudVMClustersClient.ListPrivateIPAddresses": + res.resp, res.err = c.dispatchListPrivateIPAddresses(req) + case "CloudVMClustersClient.BeginRemoveVMs": + res.resp, res.err = c.dispatchBeginRemoveVMs(req) + case "CloudVMClustersClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CloudVMClustersServerTransport) dispatchBeginAddVMs(req *http.Request) (*http.Response, error) { @@ -260,9 +276,9 @@ func (c *CloudVMClustersServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { c.beginDelete.remove(req) @@ -506,3 +522,9 @@ func (c *CloudVMClustersServerTransport) dispatchBeginUpdate(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to CloudVMClustersServerTransport +var cloudVMClustersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbnodes_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbnodes_server.go index 592576157fa6..22c9209de20f 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbnodes_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbnodes_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -32,9 +29,9 @@ type DbNodesServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, cloudvmclustername string, dbnodeocid string, options *armoracledatabase.DbNodesClientGetOptions) (resp azfake.Responder[armoracledatabase.DbNodesClientGetResponse], errResp azfake.ErrorResponder) - // NewListByCloudVMClusterPager is the fake for method DbNodesClient.NewListByCloudVMClusterPager + // NewListByParentPager is the fake for method DbNodesClient.NewListByParentPager // HTTP status codes to indicate success: http.StatusOK - NewListByCloudVMClusterPager func(resourceGroupName string, cloudvmclustername string, options *armoracledatabase.DbNodesClientListByCloudVMClusterOptions) (resp azfake.PagerResponder[armoracledatabase.DbNodesClientListByCloudVMClusterResponse]) + NewListByParentPager func(resourceGroupName string, cloudvmclustername string, options *armoracledatabase.DbNodesClientListByParentOptions) (resp azfake.PagerResponder[armoracledatabase.DbNodesClientListByParentResponse]) } // NewDbNodesServerTransport creates a new instance of DbNodesServerTransport with the provided implementation. @@ -42,18 +39,18 @@ type DbNodesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDbNodesServerTransport(srv *DbNodesServer) *DbNodesServerTransport { return &DbNodesServerTransport{ - srv: srv, - beginAction: newTracker[azfake.PollerResponder[armoracledatabase.DbNodesClientActionResponse]](), - newListByCloudVMClusterPager: newTracker[azfake.PagerResponder[armoracledatabase.DbNodesClientListByCloudVMClusterResponse]](), + srv: srv, + beginAction: newTracker[azfake.PollerResponder[armoracledatabase.DbNodesClientActionResponse]](), + newListByParentPager: newTracker[azfake.PagerResponder[armoracledatabase.DbNodesClientListByParentResponse]](), } } // DbNodesServerTransport connects instances of armoracledatabase.DbNodesClient to instances of DbNodesServer. // Don't use this type directly, use NewDbNodesServerTransport instead. type DbNodesServerTransport struct { - srv *DbNodesServer - beginAction *tracker[azfake.PollerResponder[armoracledatabase.DbNodesClientActionResponse]] - newListByCloudVMClusterPager *tracker[azfake.PagerResponder[armoracledatabase.DbNodesClientListByCloudVMClusterResponse]] + srv *DbNodesServer + beginAction *tracker[azfake.PollerResponder[armoracledatabase.DbNodesClientActionResponse]] + newListByParentPager *tracker[azfake.PagerResponder[armoracledatabase.DbNodesClientListByParentResponse]] } // Do implements the policy.Transporter interface for DbNodesServerTransport. @@ -64,25 +61,44 @@ func (d *DbNodesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DbNodesClient.BeginAction": - resp, err = d.dispatchBeginAction(req) - case "DbNodesClient.Get": - resp, err = d.dispatchGet(req) - case "DbNodesClient.NewListByCloudVMClusterPager": - resp, err = d.dispatchNewListByCloudVMClusterPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DbNodesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if dbNodesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = dbNodesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DbNodesClient.BeginAction": + res.resp, res.err = d.dispatchBeginAction(req) + case "DbNodesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DbNodesClient.NewListByParentPager": + res.resp, res.err = d.dispatchNewListByParentPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DbNodesServerTransport) dispatchBeginAction(req *http.Request) (*http.Response, error) { @@ -174,12 +190,12 @@ func (d *DbNodesServerTransport) dispatchGet(req *http.Request) (*http.Response, return resp, nil } -func (d *DbNodesServerTransport) dispatchNewListByCloudVMClusterPager(req *http.Request) (*http.Response, error) { - if d.srv.NewListByCloudVMClusterPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByCloudVMClusterPager not implemented")} +func (d *DbNodesServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListByParentPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")} } - newListByCloudVMClusterPager := d.newListByCloudVMClusterPager.get(req) - if newListByCloudVMClusterPager == nil { + newListByParentPager := d.newListByParentPager.get(req) + if newListByParentPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/cloudVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dbNodes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -194,23 +210,29 @@ func (d *DbNodesServerTransport) dispatchNewListByCloudVMClusterPager(req *http. if err != nil { return nil, err } - resp := d.srv.NewListByCloudVMClusterPager(resourceGroupNameParam, cloudvmclusternameParam, nil) - newListByCloudVMClusterPager = &resp - d.newListByCloudVMClusterPager.add(req, newListByCloudVMClusterPager) - server.PagerResponderInjectNextLinks(newListByCloudVMClusterPager, req, func(page *armoracledatabase.DbNodesClientListByCloudVMClusterResponse, createLink func() string) { + resp := d.srv.NewListByParentPager(resourceGroupNameParam, cloudvmclusternameParam, nil) + newListByParentPager = &resp + d.newListByParentPager.add(req, newListByParentPager) + server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armoracledatabase.DbNodesClientListByParentResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(newListByCloudVMClusterPager, req) + resp, err := server.PagerResponderNext(newListByParentPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { - d.newListByCloudVMClusterPager.remove(req) + d.newListByParentPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(newListByCloudVMClusterPager) { - d.newListByCloudVMClusterPager.remove(req) + if !server.PagerResponderMore(newListByParentPager) { + d.newListByParentPager.remove(req) } return resp, nil } + +// set this to conditionally intercept incoming requests to DbNodesServerTransport +var dbNodesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbservers_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbservers_server.go index 1235b75c166e..6ff1eca96bf2 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbservers_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbservers_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -28,9 +25,9 @@ type DbServersServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, cloudexadatainfrastructurename string, dbserverocid string, options *armoracledatabase.DbServersClientGetOptions) (resp azfake.Responder[armoracledatabase.DbServersClientGetResponse], errResp azfake.ErrorResponder) - // NewListByCloudExadataInfrastructurePager is the fake for method DbServersClient.NewListByCloudExadataInfrastructurePager + // NewListByParentPager is the fake for method DbServersClient.NewListByParentPager // HTTP status codes to indicate success: http.StatusOK - NewListByCloudExadataInfrastructurePager func(resourceGroupName string, cloudexadatainfrastructurename string, options *armoracledatabase.DbServersClientListByCloudExadataInfrastructureOptions) (resp azfake.PagerResponder[armoracledatabase.DbServersClientListByCloudExadataInfrastructureResponse]) + NewListByParentPager func(resourceGroupName string, cloudexadatainfrastructurename string, options *armoracledatabase.DbServersClientListByParentOptions) (resp azfake.PagerResponder[armoracledatabase.DbServersClientListByParentResponse]) } // NewDbServersServerTransport creates a new instance of DbServersServerTransport with the provided implementation. @@ -38,16 +35,16 @@ type DbServersServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDbServersServerTransport(srv *DbServersServer) *DbServersServerTransport { return &DbServersServerTransport{ - srv: srv, - newListByCloudExadataInfrastructurePager: newTracker[azfake.PagerResponder[armoracledatabase.DbServersClientListByCloudExadataInfrastructureResponse]](), + srv: srv, + newListByParentPager: newTracker[azfake.PagerResponder[armoracledatabase.DbServersClientListByParentResponse]](), } } // DbServersServerTransport connects instances of armoracledatabase.DbServersClient to instances of DbServersServer. // Don't use this type directly, use NewDbServersServerTransport instead. type DbServersServerTransport struct { - srv *DbServersServer - newListByCloudExadataInfrastructurePager *tracker[azfake.PagerResponder[armoracledatabase.DbServersClientListByCloudExadataInfrastructureResponse]] + srv *DbServersServer + newListByParentPager *tracker[azfake.PagerResponder[armoracledatabase.DbServersClientListByParentResponse]] } // Do implements the policy.Transporter interface for DbServersServerTransport. @@ -58,23 +55,42 @@ func (d *DbServersServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DbServersClient.Get": - resp, err = d.dispatchGet(req) - case "DbServersClient.NewListByCloudExadataInfrastructurePager": - resp, err = d.dispatchNewListByCloudExadataInfrastructurePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DbServersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if dbServersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = dbServersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DbServersClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DbServersClient.NewListByParentPager": + res.resp, res.err = d.dispatchNewListByParentPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DbServersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -114,12 +130,12 @@ func (d *DbServersServerTransport) dispatchGet(req *http.Request) (*http.Respons return resp, nil } -func (d *DbServersServerTransport) dispatchNewListByCloudExadataInfrastructurePager(req *http.Request) (*http.Response, error) { - if d.srv.NewListByCloudExadataInfrastructurePager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByCloudExadataInfrastructurePager not implemented")} +func (d *DbServersServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListByParentPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")} } - newListByCloudExadataInfrastructurePager := d.newListByCloudExadataInfrastructurePager.get(req) - if newListByCloudExadataInfrastructurePager == nil { + newListByParentPager := d.newListByParentPager.get(req) + if newListByParentPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/cloudExadataInfrastructures/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dbServers` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -134,23 +150,29 @@ func (d *DbServersServerTransport) dispatchNewListByCloudExadataInfrastructurePa if err != nil { return nil, err } - resp := d.srv.NewListByCloudExadataInfrastructurePager(resourceGroupNameParam, cloudexadatainfrastructurenameParam, nil) - newListByCloudExadataInfrastructurePager = &resp - d.newListByCloudExadataInfrastructurePager.add(req, newListByCloudExadataInfrastructurePager) - server.PagerResponderInjectNextLinks(newListByCloudExadataInfrastructurePager, req, func(page *armoracledatabase.DbServersClientListByCloudExadataInfrastructureResponse, createLink func() string) { + resp := d.srv.NewListByParentPager(resourceGroupNameParam, cloudexadatainfrastructurenameParam, nil) + newListByParentPager = &resp + d.newListByParentPager.add(req, newListByParentPager) + server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armoracledatabase.DbServersClientListByParentResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(newListByCloudExadataInfrastructurePager, req) + resp, err := server.PagerResponderNext(newListByParentPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { - d.newListByCloudExadataInfrastructurePager.remove(req) + d.newListByParentPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(newListByCloudExadataInfrastructurePager) { - d.newListByCloudExadataInfrastructurePager.remove(req) + if !server.PagerResponderMore(newListByParentPager) { + d.newListByParentPager.remove(req) } return resp, nil } + +// set this to conditionally intercept incoming requests to DbServersServerTransport +var dbServersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbsystemshapes_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbsystemshapes_server.go index 3d93e8727067..bcb4b93c73b2 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbsystemshapes_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dbsystemshapes_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (d *DbSystemShapesServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DbSystemShapesClient.Get": - resp, err = d.dispatchGet(req) - case "DbSystemShapesClient.NewListByLocationPager": - resp, err = d.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DbSystemShapesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if dbSystemShapesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = dbSystemShapesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DbSystemShapesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DbSystemShapesClient.NewListByLocationPager": + res.resp, res.err = d.dispatchNewListByLocationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DbSystemShapesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -122,11 +138,23 @@ func (d *DbSystemShapesServerTransport) dispatchNewListByLocationPager(req *http if matches == nil || len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } + qp := req.URL.Query() locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) if err != nil { return nil, err } - resp := d.srv.NewListByLocationPager(locationParam, nil) + zoneUnescaped, err := url.QueryUnescape(qp.Get("zone")) + if err != nil { + return nil, err + } + zoneParam := getOptional(zoneUnescaped) + var options *armoracledatabase.DbSystemShapesClientListByLocationOptions + if zoneParam != nil { + options = &armoracledatabase.DbSystemShapesClientListByLocationOptions{ + Zone: zoneParam, + } + } + resp := d.srv.NewListByLocationPager(locationParam, options) newListByLocationPager = &resp d.newListByLocationPager.add(req, newListByLocationPager) server.PagerResponderInjectNextLinks(newListByLocationPager, req, func(page *armoracledatabase.DbSystemShapesClientListByLocationResponse, createLink func() string) { @@ -146,3 +174,9 @@ func (d *DbSystemShapesServerTransport) dispatchNewListByLocationPager(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to DbSystemShapesServerTransport +var dbSystemShapesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dnsprivateviews_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dnsprivateviews_server.go index 53257e7ca744..89a321bf4811 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dnsprivateviews_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dnsprivateviews_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (d *DNSPrivateViewsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DNSPrivateViewsClient.Get": - resp, err = d.dispatchGet(req) - case "DNSPrivateViewsClient.NewListByLocationPager": - resp, err = d.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DNSPrivateViewsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if dnsPrivateViewsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = dnsPrivateViewsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DNSPrivateViewsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DNSPrivateViewsClient.NewListByLocationPager": + res.resp, res.err = d.dispatchNewListByLocationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DNSPrivateViewsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (d *DNSPrivateViewsServerTransport) dispatchNewListByLocationPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to DNSPrivateViewsServerTransport +var dnsPrivateViewsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dnsprivatezones_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dnsprivatezones_server.go index 6c379ca9545d..3909bf33dddb 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dnsprivatezones_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/dnsprivatezones_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (d *DNSPrivateZonesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DNSPrivateZonesClient.Get": - resp, err = d.dispatchGet(req) - case "DNSPrivateZonesClient.NewListByLocationPager": - resp, err = d.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DNSPrivateZonesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if dnsPrivateZonesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = dnsPrivateZonesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DNSPrivateZonesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DNSPrivateZonesClient.NewListByLocationPager": + res.resp, res.err = d.dispatchNewListByLocationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DNSPrivateZonesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (d *DNSPrivateZonesServerTransport) dispatchNewListByLocationPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to DNSPrivateZonesServerTransport +var dnsPrivateZonesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exadbvmclusters_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exadbvmclusters_server.go new file mode 100644 index 000000000000..8804a2231ab0 --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exadbvmclusters_server.go @@ -0,0 +1,431 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" + "net/http" + "net/url" + "regexp" +) + +// ExadbVMClustersServer is a fake server for instances of the armoracledatabase.ExadbVMClustersClient type. +type ExadbVMClustersServer struct { + // BeginCreateOrUpdate is the fake for method ExadbVMClustersClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, exadbVMClusterName string, resource armoracledatabase.ExadbVMCluster, options *armoracledatabase.ExadbVMClustersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ExadbVMClustersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, exadbVMClusterName string, options *armoracledatabase.ExadbVMClustersClientBeginDeleteOptions) (resp azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ExadbVMClustersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, exadbVMClusterName string, options *armoracledatabase.ExadbVMClustersClientGetOptions) (resp azfake.Responder[armoracledatabase.ExadbVMClustersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method ExadbVMClustersClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armoracledatabase.ExadbVMClustersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armoracledatabase.ExadbVMClustersClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method ExadbVMClustersClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armoracledatabase.ExadbVMClustersClientListBySubscriptionOptions) (resp azfake.PagerResponder[armoracledatabase.ExadbVMClustersClientListBySubscriptionResponse]) + + // BeginRemoveVMs is the fake for method ExadbVMClustersClient.BeginRemoveVMs + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginRemoveVMs func(ctx context.Context, resourceGroupName string, exadbVMClusterName string, body armoracledatabase.RemoveVirtualMachineFromExadbVMClusterDetails, options *armoracledatabase.ExadbVMClustersClientBeginRemoveVMsOptions) (resp azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientRemoveVMsResponse], errResp azfake.ErrorResponder) + + // BeginUpdate is the fake for method ExadbVMClustersClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, exadbVMClusterName string, properties armoracledatabase.ExadbVMClusterUpdate, options *armoracledatabase.ExadbVMClustersClientBeginUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewExadbVMClustersServerTransport creates a new instance of ExadbVMClustersServerTransport with the provided implementation. +// The returned ExadbVMClustersServerTransport instance is connected to an instance of armoracledatabase.ExadbVMClustersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewExadbVMClustersServerTransport(srv *ExadbVMClustersServer) *ExadbVMClustersServerTransport { + return &ExadbVMClustersServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientDeleteResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armoracledatabase.ExadbVMClustersClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armoracledatabase.ExadbVMClustersClientListBySubscriptionResponse]](), + beginRemoveVMs: newTracker[azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientRemoveVMsResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientUpdateResponse]](), + } +} + +// ExadbVMClustersServerTransport connects instances of armoracledatabase.ExadbVMClustersClient to instances of ExadbVMClustersServer. +// Don't use this type directly, use NewExadbVMClustersServerTransport instead. +type ExadbVMClustersServerTransport struct { + srv *ExadbVMClustersServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientDeleteResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armoracledatabase.ExadbVMClustersClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armoracledatabase.ExadbVMClustersClientListBySubscriptionResponse]] + beginRemoveVMs *tracker[azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientRemoveVMsResponse]] + beginUpdate *tracker[azfake.PollerResponder[armoracledatabase.ExadbVMClustersClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for ExadbVMClustersServerTransport. +func (e *ExadbVMClustersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return e.dispatchToMethodFake(req, method) +} + +func (e *ExadbVMClustersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if exadbVMClustersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = exadbVMClustersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExadbVMClustersClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExadbVMClustersClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExadbVMClustersClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExadbVMClustersClient.NewListByResourceGroupPager": + res.resp, res.err = e.dispatchNewListByResourceGroupPager(req) + case "ExadbVMClustersClient.NewListBySubscriptionPager": + res.resp, res.err = e.dispatchNewListBySubscriptionPager(req) + case "ExadbVMClustersClient.BeginRemoveVMs": + res.resp, res.err = e.dispatchBeginRemoveVMs(req) + case "ExadbVMClustersClient.BeginUpdate": + res.resp, res.err = e.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (e *ExadbVMClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if e.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := e.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.ExadbVMCluster](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exadbVMClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exadbVmClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, exadbVMClusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + e.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + e.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + e.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (e *ExadbVMClustersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if e.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := e.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exadbVMClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exadbVmClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginDelete(req.Context(), resourceGroupNameParam, exadbVMClusterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + e.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + e.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + e.beginDelete.remove(req) + } + + return resp, nil +} + +func (e *ExadbVMClustersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if e.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exadbVMClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exadbVmClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Get(req.Context(), resourceGroupNameParam, exadbVMClusterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExadbVMCluster, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *ExadbVMClustersServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if e.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := e.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := e.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) + newListByResourceGroupPager = &resp + e.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armoracledatabase.ExadbVMClustersClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + e.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + e.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (e *ExadbVMClustersServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if e.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := e.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := e.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + e.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armoracledatabase.ExadbVMClustersClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + e.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + e.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (e *ExadbVMClustersServerTransport) dispatchBeginRemoveVMs(req *http.Request) (*http.Response, error) { + if e.srv.BeginRemoveVMs == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRemoveVMs not implemented")} + } + beginRemoveVMs := e.beginRemoveVMs.get(req) + if beginRemoveVMs == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/removeVms` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.RemoveVirtualMachineFromExadbVMClusterDetails](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exadbVMClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exadbVmClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginRemoveVMs(req.Context(), resourceGroupNameParam, exadbVMClusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRemoveVMs = &respr + e.beginRemoveVMs.add(req, beginRemoveVMs) + } + + resp, err := server.PollerResponderNext(beginRemoveVMs, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginRemoveVMs.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRemoveVMs) { + e.beginRemoveVMs.remove(req) + } + + return resp, nil +} + +func (e *ExadbVMClustersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if e.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := e.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.ExadbVMClusterUpdate](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exadbVMClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exadbVmClusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginUpdate(req.Context(), resourceGroupNameParam, exadbVMClusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + e.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + e.beginUpdate.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to ExadbVMClustersServerTransport +var exadbVMClustersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exascaledbnodes_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exascaledbnodes_server.go new file mode 100644 index 000000000000..1d9518072701 --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exascaledbnodes_server.go @@ -0,0 +1,238 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" + "net/http" + "net/url" + "regexp" +) + +// ExascaleDbNodesServer is a fake server for instances of the armoracledatabase.ExascaleDbNodesClient type. +type ExascaleDbNodesServer struct { + // BeginAction is the fake for method ExascaleDbNodesClient.BeginAction + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginAction func(ctx context.Context, resourceGroupName string, exadbVMClusterName string, exascaleDbNodeName string, body armoracledatabase.DbNodeAction, options *armoracledatabase.ExascaleDbNodesClientBeginActionOptions) (resp azfake.PollerResponder[armoracledatabase.ExascaleDbNodesClientActionResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ExascaleDbNodesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, exadbVMClusterName string, exascaleDbNodeName string, options *armoracledatabase.ExascaleDbNodesClientGetOptions) (resp azfake.Responder[armoracledatabase.ExascaleDbNodesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByParentPager is the fake for method ExascaleDbNodesClient.NewListByParentPager + // HTTP status codes to indicate success: http.StatusOK + NewListByParentPager func(resourceGroupName string, exadbVMClusterName string, options *armoracledatabase.ExascaleDbNodesClientListByParentOptions) (resp azfake.PagerResponder[armoracledatabase.ExascaleDbNodesClientListByParentResponse]) +} + +// NewExascaleDbNodesServerTransport creates a new instance of ExascaleDbNodesServerTransport with the provided implementation. +// The returned ExascaleDbNodesServerTransport instance is connected to an instance of armoracledatabase.ExascaleDbNodesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewExascaleDbNodesServerTransport(srv *ExascaleDbNodesServer) *ExascaleDbNodesServerTransport { + return &ExascaleDbNodesServerTransport{ + srv: srv, + beginAction: newTracker[azfake.PollerResponder[armoracledatabase.ExascaleDbNodesClientActionResponse]](), + newListByParentPager: newTracker[azfake.PagerResponder[armoracledatabase.ExascaleDbNodesClientListByParentResponse]](), + } +} + +// ExascaleDbNodesServerTransport connects instances of armoracledatabase.ExascaleDbNodesClient to instances of ExascaleDbNodesServer. +// Don't use this type directly, use NewExascaleDbNodesServerTransport instead. +type ExascaleDbNodesServerTransport struct { + srv *ExascaleDbNodesServer + beginAction *tracker[azfake.PollerResponder[armoracledatabase.ExascaleDbNodesClientActionResponse]] + newListByParentPager *tracker[azfake.PagerResponder[armoracledatabase.ExascaleDbNodesClientListByParentResponse]] +} + +// Do implements the policy.Transporter interface for ExascaleDbNodesServerTransport. +func (e *ExascaleDbNodesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return e.dispatchToMethodFake(req, method) +} + +func (e *ExascaleDbNodesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if exascaleDbNodesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = exascaleDbNodesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExascaleDbNodesClient.BeginAction": + res.resp, res.err = e.dispatchBeginAction(req) + case "ExascaleDbNodesClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExascaleDbNodesClient.NewListByParentPager": + res.resp, res.err = e.dispatchNewListByParentPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (e *ExascaleDbNodesServerTransport) dispatchBeginAction(req *http.Request) (*http.Response, error) { + if e.srv.BeginAction == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginAction not implemented")} + } + beginAction := e.beginAction.get(req) + if beginAction == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dbNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/action` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.DbNodeAction](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exadbVMClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exadbVmClusterName")]) + if err != nil { + return nil, err + } + exascaleDbNodeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exascaleDbNodeName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginAction(req.Context(), resourceGroupNameParam, exadbVMClusterNameParam, exascaleDbNodeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginAction = &respr + e.beginAction.add(req, beginAction) + } + + resp, err := server.PollerResponderNext(beginAction, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginAction.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginAction) { + e.beginAction.remove(req) + } + + return resp, nil +} + +func (e *ExascaleDbNodesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if e.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dbNodes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exadbVMClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exadbVmClusterName")]) + if err != nil { + return nil, err + } + exascaleDbNodeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exascaleDbNodeName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Get(req.Context(), resourceGroupNameParam, exadbVMClusterNameParam, exascaleDbNodeNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExascaleDbNode, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *ExascaleDbNodesServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) { + if e.srv.NewListByParentPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")} + } + newListByParentPager := e.newListByParentPager.get(req) + if newListByParentPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exadbVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dbNodes` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exadbVMClusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exadbVmClusterName")]) + if err != nil { + return nil, err + } + resp := e.srv.NewListByParentPager(resourceGroupNameParam, exadbVMClusterNameParam, nil) + newListByParentPager = &resp + e.newListByParentPager.add(req, newListByParentPager) + server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armoracledatabase.ExascaleDbNodesClientListByParentResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByParentPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + e.newListByParentPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByParentPager) { + e.newListByParentPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to ExascaleDbNodesServerTransport +var exascaleDbNodesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exascaledbstoragevaults_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exascaledbstoragevaults_server.go new file mode 100644 index 000000000000..d969637ff1b3 --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/exascaledbstoragevaults_server.go @@ -0,0 +1,375 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" + "net/http" + "net/url" + "regexp" +) + +// ExascaleDbStorageVaultsServer is a fake server for instances of the armoracledatabase.ExascaleDbStorageVaultsClient type. +type ExascaleDbStorageVaultsServer struct { + // BeginCreate is the fake for method ExascaleDbStorageVaultsClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, resource armoracledatabase.ExascaleDbStorageVault, options *armoracledatabase.ExascaleDbStorageVaultsClientBeginCreateOptions) (resp azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ExascaleDbStorageVaultsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, options *armoracledatabase.ExascaleDbStorageVaultsClientBeginDeleteOptions) (resp azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ExascaleDbStorageVaultsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, options *armoracledatabase.ExascaleDbStorageVaultsClientGetOptions) (resp azfake.Responder[armoracledatabase.ExascaleDbStorageVaultsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByResourceGroupPager is the fake for method ExascaleDbStorageVaultsClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armoracledatabase.ExascaleDbStorageVaultsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armoracledatabase.ExascaleDbStorageVaultsClientListByResourceGroupResponse]) + + // NewListBySubscriptionPager is the fake for method ExascaleDbStorageVaultsClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armoracledatabase.ExascaleDbStorageVaultsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armoracledatabase.ExascaleDbStorageVaultsClientListBySubscriptionResponse]) + + // BeginUpdate is the fake for method ExascaleDbStorageVaultsClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdate func(ctx context.Context, resourceGroupName string, exascaleDbStorageVaultName string, properties armoracledatabase.ExascaleDbStorageVaultTagsUpdate, options *armoracledatabase.ExascaleDbStorageVaultsClientBeginUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewExascaleDbStorageVaultsServerTransport creates a new instance of ExascaleDbStorageVaultsServerTransport with the provided implementation. +// The returned ExascaleDbStorageVaultsServerTransport instance is connected to an instance of armoracledatabase.ExascaleDbStorageVaultsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewExascaleDbStorageVaultsServerTransport(srv *ExascaleDbStorageVaultsServer) *ExascaleDbStorageVaultsServerTransport { + return &ExascaleDbStorageVaultsServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientDeleteResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armoracledatabase.ExascaleDbStorageVaultsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armoracledatabase.ExascaleDbStorageVaultsClientListBySubscriptionResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientUpdateResponse]](), + } +} + +// ExascaleDbStorageVaultsServerTransport connects instances of armoracledatabase.ExascaleDbStorageVaultsClient to instances of ExascaleDbStorageVaultsServer. +// Don't use this type directly, use NewExascaleDbStorageVaultsServerTransport instead. +type ExascaleDbStorageVaultsServerTransport struct { + srv *ExascaleDbStorageVaultsServer + beginCreate *tracker[azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientDeleteResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armoracledatabase.ExascaleDbStorageVaultsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armoracledatabase.ExascaleDbStorageVaultsClientListBySubscriptionResponse]] + beginUpdate *tracker[azfake.PollerResponder[armoracledatabase.ExascaleDbStorageVaultsClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for ExascaleDbStorageVaultsServerTransport. +func (e *ExascaleDbStorageVaultsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return e.dispatchToMethodFake(req, method) +} + +func (e *ExascaleDbStorageVaultsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if exascaleDbStorageVaultsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = exascaleDbStorageVaultsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExascaleDbStorageVaultsClient.BeginCreate": + res.resp, res.err = e.dispatchBeginCreate(req) + case "ExascaleDbStorageVaultsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExascaleDbStorageVaultsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExascaleDbStorageVaultsClient.NewListByResourceGroupPager": + res.resp, res.err = e.dispatchNewListByResourceGroupPager(req) + case "ExascaleDbStorageVaultsClient.NewListBySubscriptionPager": + res.resp, res.err = e.dispatchNewListBySubscriptionPager(req) + case "ExascaleDbStorageVaultsClient.BeginUpdate": + res.resp, res.err = e.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (e *ExascaleDbStorageVaultsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if e.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := e.beginCreate.get(req) + if beginCreate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exascaleDbStorageVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.ExascaleDbStorageVault](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exascaleDbStorageVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exascaleDbStorageVaultName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginCreate(req.Context(), resourceGroupNameParam, exascaleDbStorageVaultNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + e.beginCreate.add(req, beginCreate) + } + + resp, err := server.PollerResponderNext(beginCreate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + e.beginCreate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreate) { + e.beginCreate.remove(req) + } + + return resp, nil +} + +func (e *ExascaleDbStorageVaultsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if e.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := e.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exascaleDbStorageVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exascaleDbStorageVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exascaleDbStorageVaultName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginDelete(req.Context(), resourceGroupNameParam, exascaleDbStorageVaultNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + e.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + e.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + e.beginDelete.remove(req) + } + + return resp, nil +} + +func (e *ExascaleDbStorageVaultsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if e.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exascaleDbStorageVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exascaleDbStorageVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exascaleDbStorageVaultName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Get(req.Context(), resourceGroupNameParam, exascaleDbStorageVaultNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ExascaleDbStorageVault, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *ExascaleDbStorageVaultsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if e.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := e.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exascaleDbStorageVaults` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := e.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) + newListByResourceGroupPager = &resp + e.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armoracledatabase.ExascaleDbStorageVaultsClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + e.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + e.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (e *ExascaleDbStorageVaultsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if e.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := e.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exascaleDbStorageVaults` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := e.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + e.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armoracledatabase.ExascaleDbStorageVaultsClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + e.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + e.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (e *ExascaleDbStorageVaultsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if e.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := e.beginUpdate.get(req) + if beginUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/exascaleDbStorageVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.ExascaleDbStorageVaultTagsUpdate](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + exascaleDbStorageVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exascaleDbStorageVaultName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginUpdate(req.Context(), resourceGroupNameParam, exascaleDbStorageVaultNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + e.beginUpdate.add(req, beginUpdate) + } + + resp, err := server.PollerResponderNext(beginUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdate) { + e.beginUpdate.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to ExascaleDbStorageVaultsServerTransport +var exascaleDbStorageVaultsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/flexcomponents_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/flexcomponents_server.go new file mode 100644 index 000000000000..1b28d036dd5f --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/flexcomponents_server.go @@ -0,0 +1,182 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" + "net/http" + "net/url" + "regexp" +) + +// FlexComponentsServer is a fake server for instances of the armoracledatabase.FlexComponentsClient type. +type FlexComponentsServer struct { + // Get is the fake for method FlexComponentsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, location string, flexComponentName string, options *armoracledatabase.FlexComponentsClientGetOptions) (resp azfake.Responder[armoracledatabase.FlexComponentsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByParentPager is the fake for method FlexComponentsClient.NewListByParentPager + // HTTP status codes to indicate success: http.StatusOK + NewListByParentPager func(location string, options *armoracledatabase.FlexComponentsClientListByParentOptions) (resp azfake.PagerResponder[armoracledatabase.FlexComponentsClientListByParentResponse]) +} + +// NewFlexComponentsServerTransport creates a new instance of FlexComponentsServerTransport with the provided implementation. +// The returned FlexComponentsServerTransport instance is connected to an instance of armoracledatabase.FlexComponentsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFlexComponentsServerTransport(srv *FlexComponentsServer) *FlexComponentsServerTransport { + return &FlexComponentsServerTransport{ + srv: srv, + newListByParentPager: newTracker[azfake.PagerResponder[armoracledatabase.FlexComponentsClientListByParentResponse]](), + } +} + +// FlexComponentsServerTransport connects instances of armoracledatabase.FlexComponentsClient to instances of FlexComponentsServer. +// Don't use this type directly, use NewFlexComponentsServerTransport instead. +type FlexComponentsServerTransport struct { + srv *FlexComponentsServer + newListByParentPager *tracker[azfake.PagerResponder[armoracledatabase.FlexComponentsClientListByParentResponse]] +} + +// Do implements the policy.Transporter interface for FlexComponentsServerTransport. +func (f *FlexComponentsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return f.dispatchToMethodFake(req, method) +} + +func (f *FlexComponentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if flexComponentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = flexComponentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FlexComponentsClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FlexComponentsClient.NewListByParentPager": + res.resp, res.err = f.dispatchNewListByParentPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (f *FlexComponentsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if f.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/flexComponents/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + flexComponentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("flexComponentName")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.Get(req.Context(), locationParam, flexComponentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FlexComponent, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (f *FlexComponentsServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListByParentPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")} + } + newListByParentPager := f.newListByParentPager.get(req) + if newListByParentPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/flexComponents` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + shapeUnescaped, err := url.QueryUnescape(qp.Get("shape")) + if err != nil { + return nil, err + } + shapeParam := getOptional(armoracledatabase.SystemShapes(shapeUnescaped)) + var options *armoracledatabase.FlexComponentsClientListByParentOptions + if shapeParam != nil { + options = &armoracledatabase.FlexComponentsClientListByParentOptions{ + Shape: shapeParam, + } + } + resp := f.srv.NewListByParentPager(locationParam, options) + newListByParentPager = &resp + f.newListByParentPager.add(req, newListByParentPager) + server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armoracledatabase.FlexComponentsClientListByParentResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByParentPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListByParentPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByParentPager) { + f.newListByParentPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to FlexComponentsServerTransport +var flexComponentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/giminorversions_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/giminorversions_server.go new file mode 100644 index 000000000000..e6658e2c0e1b --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/giminorversions_server.go @@ -0,0 +1,196 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" + "net/http" + "net/url" + "regexp" +) + +// GiMinorVersionsServer is a fake server for instances of the armoracledatabase.GiMinorVersionsClient type. +type GiMinorVersionsServer struct { + // Get is the fake for method GiMinorVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, location string, giversionname string, giMinorVersionName string, options *armoracledatabase.GiMinorVersionsClientGetOptions) (resp azfake.Responder[armoracledatabase.GiMinorVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByParentPager is the fake for method GiMinorVersionsClient.NewListByParentPager + // HTTP status codes to indicate success: http.StatusOK + NewListByParentPager func(location string, giversionname string, options *armoracledatabase.GiMinorVersionsClientListByParentOptions) (resp azfake.PagerResponder[armoracledatabase.GiMinorVersionsClientListByParentResponse]) +} + +// NewGiMinorVersionsServerTransport creates a new instance of GiMinorVersionsServerTransport with the provided implementation. +// The returned GiMinorVersionsServerTransport instance is connected to an instance of armoracledatabase.GiMinorVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewGiMinorVersionsServerTransport(srv *GiMinorVersionsServer) *GiMinorVersionsServerTransport { + return &GiMinorVersionsServerTransport{ + srv: srv, + newListByParentPager: newTracker[azfake.PagerResponder[armoracledatabase.GiMinorVersionsClientListByParentResponse]](), + } +} + +// GiMinorVersionsServerTransport connects instances of armoracledatabase.GiMinorVersionsClient to instances of GiMinorVersionsServer. +// Don't use this type directly, use NewGiMinorVersionsServerTransport instead. +type GiMinorVersionsServerTransport struct { + srv *GiMinorVersionsServer + newListByParentPager *tracker[azfake.PagerResponder[armoracledatabase.GiMinorVersionsClientListByParentResponse]] +} + +// Do implements the policy.Transporter interface for GiMinorVersionsServerTransport. +func (g *GiMinorVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return g.dispatchToMethodFake(req, method) +} + +func (g *GiMinorVersionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if giMinorVersionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = giMinorVersionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GiMinorVersionsClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GiMinorVersionsClient.NewListByParentPager": + res.resp, res.err = g.dispatchNewListByParentPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (g *GiMinorVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if g.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/giVersions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/giMinorVersions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + giversionnameParam, err := url.PathUnescape(matches[regex.SubexpIndex("giversionname")]) + if err != nil { + return nil, err + } + giMinorVersionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("giMinorVersionName")]) + if err != nil { + return nil, err + } + respr, errRespr := g.srv.Get(req.Context(), locationParam, giversionnameParam, giMinorVersionNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GiMinorVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (g *GiMinorVersionsServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) { + if g.srv.NewListByParentPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")} + } + newListByParentPager := g.newListByParentPager.get(req) + if newListByParentPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/giVersions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/giMinorVersions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + giversionnameParam, err := url.PathUnescape(matches[regex.SubexpIndex("giversionname")]) + if err != nil { + return nil, err + } + shapeFamilyUnescaped, err := url.QueryUnescape(qp.Get("shapeFamily")) + if err != nil { + return nil, err + } + shapeFamilyParam := getOptional(armoracledatabase.ShapeFamily(shapeFamilyUnescaped)) + zoneUnescaped, err := url.QueryUnescape(qp.Get("zone")) + if err != nil { + return nil, err + } + zoneParam := getOptional(zoneUnescaped) + var options *armoracledatabase.GiMinorVersionsClientListByParentOptions + if shapeFamilyParam != nil || zoneParam != nil { + options = &armoracledatabase.GiMinorVersionsClientListByParentOptions{ + ShapeFamily: shapeFamilyParam, + Zone: zoneParam, + } + } + resp := g.srv.NewListByParentPager(locationParam, giversionnameParam, options) + newListByParentPager = &resp + g.newListByParentPager.add(req, newListByParentPager) + server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armoracledatabase.GiMinorVersionsClientListByParentResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByParentPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.newListByParentPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByParentPager) { + g.newListByParentPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to GiMinorVersionsServerTransport +var giMinorVersionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/giversions_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/giversions_server.go index 551d8334a426..b67ed66b05da 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/giversions_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/giversions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (g *GiVersionsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GiVersionsClient.Get": - resp, err = g.dispatchGet(req) - case "GiVersionsClient.NewListByLocationPager": - resp, err = g.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GiVersionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if giVersionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = giVersionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GiVersionsClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GiVersionsClient.NewListByLocationPager": + res.resp, res.err = g.dispatchNewListByLocationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GiVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -122,11 +138,29 @@ func (g *GiVersionsServerTransport) dispatchNewListByLocationPager(req *http.Req if matches == nil || len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } + qp := req.URL.Query() locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) if err != nil { return nil, err } - resp := g.srv.NewListByLocationPager(locationParam, nil) + shapeUnescaped, err := url.QueryUnescape(qp.Get("shape")) + if err != nil { + return nil, err + } + shapeParam := getOptional(armoracledatabase.SystemShapes(shapeUnescaped)) + zoneUnescaped, err := url.QueryUnescape(qp.Get("zone")) + if err != nil { + return nil, err + } + zoneParam := getOptional(zoneUnescaped) + var options *armoracledatabase.GiVersionsClientListByLocationOptions + if shapeParam != nil || zoneParam != nil { + options = &armoracledatabase.GiVersionsClientListByLocationOptions{ + Shape: shapeParam, + Zone: zoneParam, + } + } + resp := g.srv.NewListByLocationPager(locationParam, options) newListByLocationPager = &resp g.newListByLocationPager.add(req, newListByLocationPager) server.PagerResponderInjectNextLinks(newListByLocationPager, req, func(page *armoracledatabase.GiVersionsClientListByLocationResponse, createLink func() string) { @@ -146,3 +180,9 @@ func (g *GiVersionsServerTransport) dispatchNewListByLocationPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to GiVersionsServerTransport +var giVersionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/internal.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/internal.go index 5f75802a569e..486a30a014e6 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/internal.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/internal.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -11,9 +8,15 @@ package fake import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "net/http" + "reflect" "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } @@ -31,6 +34,13 @@ func contains[T comparable](s []T, v T) bool { return false } +func getOptional[T any](v T) *T { + if reflect.ValueOf(v).IsZero() { + return nil + } + return &v +} + func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/operations_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/operations_server.go index 4921fd567d63..790a9af7acff 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/operations_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/operations_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" ) @@ -51,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/oraclesubscriptions_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/oraclesubscriptions_server.go index 712077d00f40..81f71f5a0b25 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/oraclesubscriptions_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/oraclesubscriptions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,19 +13,23 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "regexp" ) // OracleSubscriptionsServer is a fake server for instances of the armoracledatabase.OracleSubscriptionsClient type. type OracleSubscriptionsServer struct { + // BeginAddAzureSubscriptions is the fake for method OracleSubscriptionsClient.BeginAddAzureSubscriptions + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginAddAzureSubscriptions func(ctx context.Context, body armoracledatabase.AzureSubscriptions, options *armoracledatabase.OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (resp azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientAddAzureSubscriptionsResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method OracleSubscriptionsClient.BeginCreateOrUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginCreateOrUpdate func(ctx context.Context, resource armoracledatabase.OracleSubscription, options *armoracledatabase.OracleSubscriptionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method OracleSubscriptionsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, options *armoracledatabase.OracleSubscriptionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method OracleSubscriptionsClient.Get @@ -62,6 +63,7 @@ type OracleSubscriptionsServer struct { func NewOracleSubscriptionsServerTransport(srv *OracleSubscriptionsServer) *OracleSubscriptionsServerTransport { return &OracleSubscriptionsServerTransport{ srv: srv, + beginAddAzureSubscriptions: newTracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientAddAzureSubscriptionsResponse]](), beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientDeleteResponse]](), beginListActivationLinks: newTracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientListActivationLinksResponse]](), @@ -76,6 +78,7 @@ func NewOracleSubscriptionsServerTransport(srv *OracleSubscriptionsServer) *Orac // Don't use this type directly, use NewOracleSubscriptionsServerTransport instead. type OracleSubscriptionsServerTransport struct { srv *OracleSubscriptionsServer + beginAddAzureSubscriptions *tracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientAddAzureSubscriptionsResponse]] beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientDeleteResponse]] beginListActivationLinks *tracker[azfake.PollerResponder[armoracledatabase.OracleSubscriptionsClientListActivationLinksResponse]] @@ -93,34 +96,95 @@ func (o *OracleSubscriptionsServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "OracleSubscriptionsClient.BeginCreateOrUpdate": - resp, err = o.dispatchBeginCreateOrUpdate(req) - case "OracleSubscriptionsClient.BeginDelete": - resp, err = o.dispatchBeginDelete(req) - case "OracleSubscriptionsClient.Get": - resp, err = o.dispatchGet(req) - case "OracleSubscriptionsClient.BeginListActivationLinks": - resp, err = o.dispatchBeginListActivationLinks(req) - case "OracleSubscriptionsClient.NewListBySubscriptionPager": - resp, err = o.dispatchNewListBySubscriptionPager(req) - case "OracleSubscriptionsClient.BeginListCloudAccountDetails": - resp, err = o.dispatchBeginListCloudAccountDetails(req) - case "OracleSubscriptionsClient.BeginListSaasSubscriptionDetails": - resp, err = o.dispatchBeginListSaasSubscriptionDetails(req) - case "OracleSubscriptionsClient.BeginUpdate": - resp, err = o.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) + return o.dispatchToMethodFake(req, method) +} + +func (o *OracleSubscriptionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if oracleSubscriptionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = oracleSubscriptionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OracleSubscriptionsClient.BeginAddAzureSubscriptions": + res.resp, res.err = o.dispatchBeginAddAzureSubscriptions(req) + case "OracleSubscriptionsClient.BeginCreateOrUpdate": + res.resp, res.err = o.dispatchBeginCreateOrUpdate(req) + case "OracleSubscriptionsClient.BeginDelete": + res.resp, res.err = o.dispatchBeginDelete(req) + case "OracleSubscriptionsClient.Get": + res.resp, res.err = o.dispatchGet(req) + case "OracleSubscriptionsClient.BeginListActivationLinks": + res.resp, res.err = o.dispatchBeginListActivationLinks(req) + case "OracleSubscriptionsClient.NewListBySubscriptionPager": + res.resp, res.err = o.dispatchNewListBySubscriptionPager(req) + case "OracleSubscriptionsClient.BeginListCloudAccountDetails": + res.resp, res.err = o.dispatchBeginListCloudAccountDetails(req) + case "OracleSubscriptionsClient.BeginListSaasSubscriptionDetails": + res.resp, res.err = o.dispatchBeginListSaasSubscriptionDetails(req) + case "OracleSubscriptionsClient.BeginUpdate": + res.resp, res.err = o.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (o *OracleSubscriptionsServerTransport) dispatchBeginAddAzureSubscriptions(req *http.Request) (*http.Response, error) { + if o.srv.BeginAddAzureSubscriptions == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginAddAzureSubscriptions not implemented")} + } + beginAddAzureSubscriptions := o.beginAddAzureSubscriptions.get(req) + if beginAddAzureSubscriptions == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/oracleSubscriptions/default/addAzureSubscriptions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armoracledatabase.AzureSubscriptions](req) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginAddAzureSubscriptions(req.Context(), body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginAddAzureSubscriptions = &respr + o.beginAddAzureSubscriptions.add(req, beginAddAzureSubscriptions) } + resp, err := server.PollerResponderNext(beginAddAzureSubscriptions, req) if err != nil { return nil, err } + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + o.beginAddAzureSubscriptions.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginAddAzureSubscriptions) { + o.beginAddAzureSubscriptions.remove(req) + } + return resp, nil } @@ -189,9 +253,9 @@ func (o *OracleSubscriptionsServerTransport) dispatchBeginDelete(req *http.Reque return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { o.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { o.beginDelete.remove(req) @@ -405,3 +469,9 @@ func (o *OracleSubscriptionsServerTransport) dispatchBeginUpdate(req *http.Reque return resp, nil } + +// set this to conditionally intercept incoming requests to OracleSubscriptionsServerTransport +var oracleSubscriptionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/server_factory.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/server_factory.go index 429a0dab5ead..d923d81614d4 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/server_factory.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/server_factory.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -19,23 +16,71 @@ import ( // ServerFactory is a fake server for instances of the armoracledatabase.ClientFactory type. type ServerFactory struct { - AutonomousDatabaseBackupsServer AutonomousDatabaseBackupsServer - AutonomousDatabaseCharacterSetsServer AutonomousDatabaseCharacterSetsServer + // AutonomousDatabaseBackupsServer contains the fakes for client AutonomousDatabaseBackupsClient + AutonomousDatabaseBackupsServer AutonomousDatabaseBackupsServer + + // AutonomousDatabaseCharacterSetsServer contains the fakes for client AutonomousDatabaseCharacterSetsClient + AutonomousDatabaseCharacterSetsServer AutonomousDatabaseCharacterSetsServer + + // AutonomousDatabaseNationalCharacterSetsServer contains the fakes for client AutonomousDatabaseNationalCharacterSetsClient AutonomousDatabaseNationalCharacterSetsServer AutonomousDatabaseNationalCharacterSetsServer - AutonomousDatabaseVersionsServer AutonomousDatabaseVersionsServer - AutonomousDatabasesServer AutonomousDatabasesServer - CloudExadataInfrastructuresServer CloudExadataInfrastructuresServer - CloudVMClustersServer CloudVMClustersServer - DNSPrivateViewsServer DNSPrivateViewsServer - DNSPrivateZonesServer DNSPrivateZonesServer - DbNodesServer DbNodesServer - DbServersServer DbServersServer - DbSystemShapesServer DbSystemShapesServer - GiVersionsServer GiVersionsServer - OperationsServer OperationsServer - OracleSubscriptionsServer OracleSubscriptionsServer - SystemVersionsServer SystemVersionsServer - VirtualNetworkAddressesServer VirtualNetworkAddressesServer + + // AutonomousDatabaseVersionsServer contains the fakes for client AutonomousDatabaseVersionsClient + AutonomousDatabaseVersionsServer AutonomousDatabaseVersionsServer + + // AutonomousDatabasesServer contains the fakes for client AutonomousDatabasesClient + AutonomousDatabasesServer AutonomousDatabasesServer + + // CloudExadataInfrastructuresServer contains the fakes for client CloudExadataInfrastructuresClient + CloudExadataInfrastructuresServer CloudExadataInfrastructuresServer + + // CloudVMClustersServer contains the fakes for client CloudVMClustersClient + CloudVMClustersServer CloudVMClustersServer + + // DNSPrivateViewsServer contains the fakes for client DNSPrivateViewsClient + DNSPrivateViewsServer DNSPrivateViewsServer + + // DNSPrivateZonesServer contains the fakes for client DNSPrivateZonesClient + DNSPrivateZonesServer DNSPrivateZonesServer + + // DbNodesServer contains the fakes for client DbNodesClient + DbNodesServer DbNodesServer + + // DbServersServer contains the fakes for client DbServersClient + DbServersServer DbServersServer + + // DbSystemShapesServer contains the fakes for client DbSystemShapesClient + DbSystemShapesServer DbSystemShapesServer + + // ExadbVMClustersServer contains the fakes for client ExadbVMClustersClient + ExadbVMClustersServer ExadbVMClustersServer + + // ExascaleDbNodesServer contains the fakes for client ExascaleDbNodesClient + ExascaleDbNodesServer ExascaleDbNodesServer + + // ExascaleDbStorageVaultsServer contains the fakes for client ExascaleDbStorageVaultsClient + ExascaleDbStorageVaultsServer ExascaleDbStorageVaultsServer + + // FlexComponentsServer contains the fakes for client FlexComponentsClient + FlexComponentsServer FlexComponentsServer + + // GiMinorVersionsServer contains the fakes for client GiMinorVersionsClient + GiMinorVersionsServer GiMinorVersionsServer + + // GiVersionsServer contains the fakes for client GiVersionsClient + GiVersionsServer GiVersionsServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // OracleSubscriptionsServer contains the fakes for client OracleSubscriptionsClient + OracleSubscriptionsServer OracleSubscriptionsServer + + // SystemVersionsServer contains the fakes for client SystemVersionsClient + SystemVersionsServer SystemVersionsServer + + // VirtualNetworkAddressesServer contains the fakes for client VirtualNetworkAddressesClient + VirtualNetworkAddressesServer VirtualNetworkAddressesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -64,6 +109,11 @@ type ServerFactoryTransport struct { trDbNodesServer *DbNodesServerTransport trDbServersServer *DbServersServerTransport trDbSystemShapesServer *DbSystemShapesServerTransport + trExadbVMClustersServer *ExadbVMClustersServerTransport + trExascaleDbNodesServer *ExascaleDbNodesServerTransport + trExascaleDbStorageVaultsServer *ExascaleDbStorageVaultsServerTransport + trFlexComponentsServer *FlexComponentsServerTransport + trGiMinorVersionsServer *GiMinorVersionsServerTransport trGiVersionsServer *GiVersionsServerTransport trOperationsServer *OperationsServerTransport trOracleSubscriptionsServer *OracleSubscriptionsServerTransport @@ -140,6 +190,31 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewDbSystemShapesServerTransport(&s.srv.DbSystemShapesServer) }) resp, err = s.trDbSystemShapesServer.Do(req) + case "ExadbVMClustersClient": + initServer(s, &s.trExadbVMClustersServer, func() *ExadbVMClustersServerTransport { + return NewExadbVMClustersServerTransport(&s.srv.ExadbVMClustersServer) + }) + resp, err = s.trExadbVMClustersServer.Do(req) + case "ExascaleDbNodesClient": + initServer(s, &s.trExascaleDbNodesServer, func() *ExascaleDbNodesServerTransport { + return NewExascaleDbNodesServerTransport(&s.srv.ExascaleDbNodesServer) + }) + resp, err = s.trExascaleDbNodesServer.Do(req) + case "ExascaleDbStorageVaultsClient": + initServer(s, &s.trExascaleDbStorageVaultsServer, func() *ExascaleDbStorageVaultsServerTransport { + return NewExascaleDbStorageVaultsServerTransport(&s.srv.ExascaleDbStorageVaultsServer) + }) + resp, err = s.trExascaleDbStorageVaultsServer.Do(req) + case "FlexComponentsClient": + initServer(s, &s.trFlexComponentsServer, func() *FlexComponentsServerTransport { + return NewFlexComponentsServerTransport(&s.srv.FlexComponentsServer) + }) + resp, err = s.trFlexComponentsServer.Do(req) + case "GiMinorVersionsClient": + initServer(s, &s.trGiMinorVersionsServer, func() *GiMinorVersionsServerTransport { + return NewGiMinorVersionsServerTransport(&s.srv.GiMinorVersionsServer) + }) + resp, err = s.trGiMinorVersionsServer.Do(req) case "GiVersionsClient": initServer(s, &s.trGiVersionsServer, func() *GiVersionsServerTransport { return NewGiVersionsServerTransport(&s.srv.GiVersionsServer) }) resp, err = s.trGiVersionsServer.Do(req) diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/systemversions_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/systemversions_server.go index 7ebdef8fbe82..273d4100cf65 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/systemversions_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/systemversions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (s *SystemVersionsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SystemVersionsClient.Get": - resp, err = s.dispatchGet(req) - case "SystemVersionsClient.NewListByLocationPager": - resp, err = s.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SystemVersionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if systemVersionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = systemVersionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SystemVersionsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SystemVersionsClient.NewListByLocationPager": + res.resp, res.err = s.dispatchNewListByLocationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SystemVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (s *SystemVersionsServerTransport) dispatchNewListByLocationPager(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to SystemVersionsServerTransport +var systemVersionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/time_rfc3339.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/virtualnetworkaddresses_server.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/virtualnetworkaddresses_server.go index 55ab35329e8a..898637f405e3 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/virtualnetworkaddresses_server.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/fake/virtualnetworkaddresses_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2" "net/http" "net/url" "regexp" @@ -29,16 +26,16 @@ type VirtualNetworkAddressesServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, resource armoracledatabase.VirtualNetworkAddress, options *armoracledatabase.VirtualNetworkAddressesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VirtualNetworkAddressesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, options *armoracledatabase.VirtualNetworkAddressesClientBeginDeleteOptions) (resp azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method VirtualNetworkAddressesClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, options *armoracledatabase.VirtualNetworkAddressesClientGetOptions) (resp azfake.Responder[armoracledatabase.VirtualNetworkAddressesClientGetResponse], errResp azfake.ErrorResponder) - // NewListByCloudVMClusterPager is the fake for method VirtualNetworkAddressesClient.NewListByCloudVMClusterPager + // NewListByParentPager is the fake for method VirtualNetworkAddressesClient.NewListByParentPager // HTTP status codes to indicate success: http.StatusOK - NewListByCloudVMClusterPager func(resourceGroupName string, cloudvmclustername string, options *armoracledatabase.VirtualNetworkAddressesClientListByCloudVMClusterOptions) (resp azfake.PagerResponder[armoracledatabase.VirtualNetworkAddressesClientListByCloudVMClusterResponse]) + NewListByParentPager func(resourceGroupName string, cloudvmclustername string, options *armoracledatabase.VirtualNetworkAddressesClientListByParentOptions) (resp azfake.PagerResponder[armoracledatabase.VirtualNetworkAddressesClientListByParentResponse]) } // NewVirtualNetworkAddressesServerTransport creates a new instance of VirtualNetworkAddressesServerTransport with the provided implementation. @@ -46,20 +43,20 @@ type VirtualNetworkAddressesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualNetworkAddressesServerTransport(srv *VirtualNetworkAddressesServer) *VirtualNetworkAddressesServerTransport { return &VirtualNetworkAddressesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientDeleteResponse]](), - newListByCloudVMClusterPager: newTracker[azfake.PagerResponder[armoracledatabase.VirtualNetworkAddressesClientListByCloudVMClusterResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientDeleteResponse]](), + newListByParentPager: newTracker[azfake.PagerResponder[armoracledatabase.VirtualNetworkAddressesClientListByParentResponse]](), } } // VirtualNetworkAddressesServerTransport connects instances of armoracledatabase.VirtualNetworkAddressesClient to instances of VirtualNetworkAddressesServer. // Don't use this type directly, use NewVirtualNetworkAddressesServerTransport instead. type VirtualNetworkAddressesServerTransport struct { - srv *VirtualNetworkAddressesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientDeleteResponse]] - newListByCloudVMClusterPager *tracker[azfake.PagerResponder[armoracledatabase.VirtualNetworkAddressesClientListByCloudVMClusterResponse]] + srv *VirtualNetworkAddressesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armoracledatabase.VirtualNetworkAddressesClientDeleteResponse]] + newListByParentPager *tracker[azfake.PagerResponder[armoracledatabase.VirtualNetworkAddressesClientListByParentResponse]] } // Do implements the policy.Transporter interface for VirtualNetworkAddressesServerTransport. @@ -70,27 +67,46 @@ func (v *VirtualNetworkAddressesServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualNetworkAddressesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworkAddressesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworkAddressesClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworkAddressesClient.NewListByCloudVMClusterPager": - resp, err = v.dispatchNewListByCloudVMClusterPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualNetworkAddressesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualNetworkAddressesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworkAddressesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworkAddressesClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworkAddressesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworkAddressesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworkAddressesClient.NewListByParentPager": + res.resp, res.err = v.dispatchNewListByParentPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworkAddressesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -182,9 +198,9 @@ func (v *VirtualNetworkAddressesServerTransport) dispatchBeginDelete(req *http.R return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { v.beginDelete.remove(req) @@ -230,12 +246,12 @@ func (v *VirtualNetworkAddressesServerTransport) dispatchGet(req *http.Request) return resp, nil } -func (v *VirtualNetworkAddressesServerTransport) dispatchNewListByCloudVMClusterPager(req *http.Request) (*http.Response, error) { - if v.srv.NewListByCloudVMClusterPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByCloudVMClusterPager not implemented")} +func (v *VirtualNetworkAddressesServerTransport) dispatchNewListByParentPager(req *http.Request) (*http.Response, error) { + if v.srv.NewListByParentPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByParentPager not implemented")} } - newListByCloudVMClusterPager := v.newListByCloudVMClusterPager.get(req) - if newListByCloudVMClusterPager == nil { + newListByParentPager := v.newListByParentPager.get(req) + if newListByParentPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Oracle\.Database/cloudVmClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualNetworkAddresses` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -250,23 +266,29 @@ func (v *VirtualNetworkAddressesServerTransport) dispatchNewListByCloudVMCluster if err != nil { return nil, err } - resp := v.srv.NewListByCloudVMClusterPager(resourceGroupNameParam, cloudvmclusternameParam, nil) - newListByCloudVMClusterPager = &resp - v.newListByCloudVMClusterPager.add(req, newListByCloudVMClusterPager) - server.PagerResponderInjectNextLinks(newListByCloudVMClusterPager, req, func(page *armoracledatabase.VirtualNetworkAddressesClientListByCloudVMClusterResponse, createLink func() string) { + resp := v.srv.NewListByParentPager(resourceGroupNameParam, cloudvmclusternameParam, nil) + newListByParentPager = &resp + v.newListByParentPager.add(req, newListByParentPager) + server.PagerResponderInjectNextLinks(newListByParentPager, req, func(page *armoracledatabase.VirtualNetworkAddressesClientListByParentResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(newListByCloudVMClusterPager, req) + resp, err := server.PagerResponderNext(newListByParentPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { - v.newListByCloudVMClusterPager.remove(req) + v.newListByParentPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(newListByCloudVMClusterPager) { - v.newListByCloudVMClusterPager.remove(req) + if !server.PagerResponderMore(newListByParentPager) { + v.newListByParentPager.remove(req) } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworkAddressesServerTransport +var virtualNetworkAddressesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/flexcomponents_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/flexcomponents_client.go new file mode 100644 index 000000000000..c445edefe8ae --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/flexcomponents_client.go @@ -0,0 +1,168 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armoracledatabase + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// FlexComponentsClient contains the methods for the FlexComponents group. +// Don't use this type directly, use NewFlexComponentsClient() instead. +type FlexComponentsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFlexComponentsClient creates a new instance of FlexComponentsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFlexComponentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FlexComponentsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FlexComponentsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get a FlexComponent +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - location - The name of the Azure region. +// - flexComponentName - The name of the FlexComponent +// - options - FlexComponentsClientGetOptions contains the optional parameters for the FlexComponentsClient.Get method. +func (client *FlexComponentsClient) Get(ctx context.Context, location string, flexComponentName string, options *FlexComponentsClientGetOptions) (FlexComponentsClientGetResponse, error) { + var err error + const operationName = "FlexComponentsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, location, flexComponentName, options) + if err != nil { + return FlexComponentsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FlexComponentsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FlexComponentsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *FlexComponentsClient) getCreateRequest(ctx context.Context, location string, flexComponentName string, _ *FlexComponentsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if flexComponentName == "" { + return nil, errors.New("parameter flexComponentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{flexComponentName}", url.PathEscape(flexComponentName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FlexComponentsClient) getHandleResponse(resp *http.Response) (FlexComponentsClientGetResponse, error) { + result := FlexComponentsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FlexComponent); err != nil { + return FlexComponentsClientGetResponse{}, err + } + return result, nil +} + +// NewListByParentPager - List FlexComponent resources by SubscriptionLocationResource +// +// Generated from API version 2025-03-01 +// - location - The name of the Azure region. +// - options - FlexComponentsClientListByParentOptions contains the optional parameters for the FlexComponentsClient.NewListByParentPager +// method. +func (client *FlexComponentsClient) NewListByParentPager(location string, options *FlexComponentsClientListByParentOptions) *runtime.Pager[FlexComponentsClientListByParentResponse] { + return runtime.NewPager(runtime.PagingHandler[FlexComponentsClientListByParentResponse]{ + More: func(page FlexComponentsClientListByParentResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FlexComponentsClientListByParentResponse) (FlexComponentsClientListByParentResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FlexComponentsClient.NewListByParentPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByParentCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return FlexComponentsClientListByParentResponse{}, err + } + return client.listByParentHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByParentCreateRequest creates the ListByParent request. +func (client *FlexComponentsClient) listByParentCreateRequest(ctx context.Context, location string, options *FlexComponentsClientListByParentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + if options != nil && options.Shape != nil { + reqQP.Set("shape", string(*options.Shape)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByParentHandleResponse handles the ListByParent response. +func (client *FlexComponentsClient) listByParentHandleResponse(resp *http.Response) (FlexComponentsClientListByParentResponse, error) { + result := FlexComponentsClientListByParentResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FlexComponentListResult); err != nil { + return FlexComponentsClientListByParentResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/giminorversions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/giminorversions_client.go new file mode 100644 index 000000000000..84326b5b77c3 --- /dev/null +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/giminorversions_client.go @@ -0,0 +1,181 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armoracledatabase + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// GiMinorVersionsClient contains the methods for the GiMinorVersions group. +// Don't use this type directly, use NewGiMinorVersionsClient() instead. +type GiMinorVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGiMinorVersionsClient creates a new instance of GiMinorVersionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewGiMinorVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GiMinorVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GiMinorVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get a GiMinorVersion +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - location - The name of the Azure region. +// - giversionname - GiVersion name +// - giMinorVersionName - The name of the GiMinorVersion +// - options - GiMinorVersionsClientGetOptions contains the optional parameters for the GiMinorVersionsClient.Get method. +func (client *GiMinorVersionsClient) Get(ctx context.Context, location string, giversionname string, giMinorVersionName string, options *GiMinorVersionsClientGetOptions) (GiMinorVersionsClientGetResponse, error) { + var err error + const operationName = "GiMinorVersionsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, location, giversionname, giMinorVersionName, options) + if err != nil { + return GiMinorVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GiMinorVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GiMinorVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *GiMinorVersionsClient) getCreateRequest(ctx context.Context, location string, giversionname string, giMinorVersionName string, _ *GiMinorVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if giversionname == "" { + return nil, errors.New("parameter giversionname cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{giversionname}", url.PathEscape(giversionname)) + if giMinorVersionName == "" { + return nil, errors.New("parameter giMinorVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{giMinorVersionName}", url.PathEscape(giMinorVersionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GiMinorVersionsClient) getHandleResponse(resp *http.Response) (GiMinorVersionsClientGetResponse, error) { + result := GiMinorVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GiMinorVersion); err != nil { + return GiMinorVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByParentPager - List GiMinorVersion resources by GiVersion +// +// Generated from API version 2025-03-01 +// - location - The name of the Azure region. +// - giversionname - GiVersion name +// - options - GiMinorVersionsClientListByParentOptions contains the optional parameters for the GiMinorVersionsClient.NewListByParentPager +// method. +func (client *GiMinorVersionsClient) NewListByParentPager(location string, giversionname string, options *GiMinorVersionsClientListByParentOptions) *runtime.Pager[GiMinorVersionsClientListByParentResponse] { + return runtime.NewPager(runtime.PagingHandler[GiMinorVersionsClientListByParentResponse]{ + More: func(page GiMinorVersionsClientListByParentResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GiMinorVersionsClientListByParentResponse) (GiMinorVersionsClientListByParentResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GiMinorVersionsClient.NewListByParentPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByParentCreateRequest(ctx, location, giversionname, options) + }, nil) + if err != nil { + return GiMinorVersionsClientListByParentResponse{}, err + } + return client.listByParentHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByParentCreateRequest creates the ListByParent request. +func (client *GiMinorVersionsClient) listByParentCreateRequest(ctx context.Context, location string, giversionname string, options *GiMinorVersionsClientListByParentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if giversionname == "" { + return nil, errors.New("parameter giversionname cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{giversionname}", url.PathEscape(giversionname)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + if options != nil && options.ShapeFamily != nil { + reqQP.Set("shapeFamily", string(*options.ShapeFamily)) + } + if options != nil && options.Zone != nil { + reqQP.Set("zone", *options.Zone) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByParentHandleResponse handles the ListByParent response. +func (client *GiMinorVersionsClient) listByParentHandleResponse(resp *http.Response) (GiMinorVersionsClientListByParentResponse, error) { + result := GiMinorVersionsClientListByParentResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GiMinorVersionListResult); err != nil { + return GiMinorVersionsClientListByParentResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client.go index 1a3b95f94727..6b1aac599554 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewGiVersionsClient(subscriptionID string, credential azcore.TokenCredentia // Get - Get a GiVersion // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - giversionname - GiVersion name // - options - GiVersionsClientGetOptions contains the optional parameters for the GiVersionsClient.Get method. @@ -73,7 +70,7 @@ func (client *GiVersionsClient) Get(ctx context.Context, location string, givers } // getCreateRequest creates the Get request. -func (client *GiVersionsClient) getCreateRequest(ctx context.Context, location string, giversionname string, options *GiVersionsClientGetOptions) (*policy.Request, error) { +func (client *GiVersionsClient) getCreateRequest(ctx context.Context, location string, giversionname string, _ *GiVersionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +89,7 @@ func (client *GiVersionsClient) getCreateRequest(ctx context.Context, location s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,9 +104,9 @@ func (client *GiVersionsClient) getHandleResponse(resp *http.Response) (GiVersio return result, nil } -// NewListByLocationPager - List GiVersion resources by Location +// NewListByLocationPager - List GiVersion resources by SubscriptionLocationResource // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - options - GiVersionsClientListByLocationOptions contains the optional parameters for the GiVersionsClient.NewListByLocationPager // method. @@ -152,7 +149,13 @@ func (client *GiVersionsClient) listByLocationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") + if options != nil && options.Shape != nil { + reqQP.Set("shape", string(*options.Shape)) + } + if options != nil && options.Zone != nil { + reqQP.Set("zone", *options.Zone) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client_example_test.go deleted file mode 100644 index f9115c0f888b..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/giversions_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_listByLocation.json -func ExampleGiVersionsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGiVersionsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GiVersionListResult = armoracledatabase.GiVersionListResult{ - // Value: []*armoracledatabase.GiVersion{ - // { - // Type: to.Ptr("Oracle.Database/locations/giVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/giVersions/19.0.0.0"), - // Properties: &armoracledatabase.GiVersionProperties{ - // Version: to.Ptr("19.0.0.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_get.json -func ExampleGiVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGiVersionsClient().Get(ctx, "eastus", "19.0.0.0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GiVersion = armoracledatabase.GiVersion{ - // Type: to.Ptr("Oracle.Database/locations/giVersions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/giVersions/19.0.0.0"), - // Properties: &armoracledatabase.GiVersionProperties{ - // Version: to.Ptr("19.0.0.0"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/go.mod b/sdk/resourcemanager/oracledatabase/armoracledatabase/go.mod index 8ca2ccf191d8..1c7107f6dfb3 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/go.mod +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase/v2 go 1.23.0 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.36.0 // indirect golang.org/x/net v0.38.0 // indirect - golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect ) diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/go.sum b/sdk/resourcemanager/oracledatabase/armoracledatabase/go.sum index 4bacf756f06c..4de695d9e23a 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/go.sum +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/go.sum @@ -1,44 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 h1:DSDNVxqkoXJiko6x8a90zidoYqnYYa6c1MTzDKzKkTo= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1/go.mod h1:zGqV2R4Cr/k8Uye5w+dgQ06WJtEcbQG/8J7BB6hnCr4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= -github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/interfaces.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/interfaces.go index 17c4012b7ecb..93c2120a8504 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/interfaces.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/interfaces.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -11,7 +8,8 @@ package armoracledatabase // AutonomousDatabaseBasePropertiesClassification provides polymorphic access to related types. // Call the interface's GetAutonomousDatabaseBaseProperties() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AutonomousDatabaseBaseProperties, *AutonomousDatabaseCloneProperties, *AutonomousDatabaseProperties +// - *AutonomousDatabaseBaseProperties, *AutonomousDatabaseCloneProperties, *AutonomousDatabaseCrossRegionDisasterRecoveryProperties, +// - *AutonomousDatabaseFromBackupTimestampProperties, *AutonomousDatabaseProperties type AutonomousDatabaseBasePropertiesClassification interface { // GetAutonomousDatabaseBaseProperties returns the AutonomousDatabaseBaseProperties content of the underlying type. GetAutonomousDatabaseBaseProperties() *AutonomousDatabaseBaseProperties diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/models.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/models.go index 49ee984711d8..8df4e1bf12a5 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/models.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/models.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -106,7 +103,7 @@ type AutonomousDatabaseBackupProperties struct { // The user-friendly name for the backup. The name does not have to be unique. DisplayName *string - // Retention period, in days, for long-term backups. + // Retention period, in days RetentionPeriodInDays *int32 // READ-ONLY; The OCID of the Autonomous Database. @@ -152,16 +149,22 @@ type AutonomousDatabaseBackupProperties struct { TimeStarted *string } -// AutonomousDatabaseBackupUpdate - The type used for update operations of the AutonomousDatabaseBackup. +// AutonomousDatabaseBackupUpdate - AutonomousDatabaseBackup resource definition type AutonomousDatabaseBackupUpdate struct { - // The updatable properties of the AutonomousDatabaseBackup. - Properties *AutonomousDatabaseBackupUpdateProperties -} + // The resource-specific properties for this resource. + Properties *AutonomousDatabaseBackupProperties -// AutonomousDatabaseBackupUpdateProperties - The updatable properties of the AutonomousDatabaseBackup. -type AutonomousDatabaseBackupUpdateProperties struct { - // Retention period, in days, for long-term backups. - RetentionPeriodInDays *int32 + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } // AutonomousDatabaseBaseProperties - Autonomous Database base resource model. @@ -245,7 +248,7 @@ type AutonomousDatabaseBaseProperties struct { // Indicates the Autonomous Database mode. OpenMode *OpenModeType - // The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer + // The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer // database. PeerDbID *string @@ -338,10 +341,9 @@ type AutonomousDatabaseBaseProperties struct { // READ-ONLY; Status of Operations Insights for this Autonomous Database. OperationsInsightsStatus *OperationsInsightsStatusType - // READ-ONLY; The list of OCIDs [https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm] of standby databases - // located in Autonomous Data Guard remote regions that are associated with the source - // database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source - // primary database do not have OCIDs. + // READ-ONLY; The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are + // associated with the source database. Note that for Autonomous Database Serverless + // instances, standby databases located in the same region as the source primary database do not have Azure IDs. PeerDbIDs []*string // READ-ONLY; The private endpoint for the resource. @@ -353,6 +355,9 @@ type AutonomousDatabaseBaseProperties struct { // READ-ONLY; Azure resource provisioning state. ProvisioningState *AzureResourceProvisioningState + // READ-ONLY; Indicates remote disaster recovery configuration + RemoteDisasterRecoveryConfiguration *DisasterRecoveryConfigurationDetails + // READ-ONLY; The SQL Web Developer URL for the Oracle Autonomous Database. SQLWebDeveloperURL *string @@ -372,6 +377,9 @@ type AutonomousDatabaseBaseProperties struct { // READ-ONLY; The date and time the Always Free database will be automatically deleted because of inactivity. TimeDeletionOfFreeAutonomousDatabase *string + // READ-ONLY; The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + TimeDisasterRecoveryRoleChanged *time.Time + // READ-ONLY; The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned // in the same region as the primary database. TimeLocalDataGuardEnabled *string @@ -438,7 +446,7 @@ type AutonomousDatabaseCharacterSetListResult struct { // AutonomousDatabaseCharacterSetProperties - AutonomousDatabaseCharacterSet resource model type AutonomousDatabaseCharacterSetProperties struct { - // READ-ONLY; The Oracle Autonomous Database supported character sets. + // REQUIRED; The Oracle Autonomous Database supported character sets. CharacterSet *string } @@ -450,7 +458,7 @@ type AutonomousDatabaseCloneProperties struct { // REQUIRED; Database type to be created. DataBaseType *DataBaseType - // REQUIRED; The Azure ID of the Autonomous Database that was cloned to create the current Autonomous Database. + // REQUIRED; The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. SourceID *string // Admin password. @@ -529,7 +537,7 @@ type AutonomousDatabaseCloneProperties struct { // Indicates the Autonomous Database mode. OpenMode *OpenModeType - // The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer + // The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer // database. PeerDbID *string @@ -638,10 +646,9 @@ type AutonomousDatabaseCloneProperties struct { // READ-ONLY; Status of Operations Insights for this Autonomous Database. OperationsInsightsStatus *OperationsInsightsStatusType - // READ-ONLY; The list of OCIDs [https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm] of standby databases - // located in Autonomous Data Guard remote regions that are associated with the source - // database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source - // primary database do not have OCIDs. + // READ-ONLY; The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are + // associated with the source database. Note that for Autonomous Database Serverless + // instances, standby databases located in the same region as the source primary database do not have Azure IDs. PeerDbIDs []*string // READ-ONLY; The private endpoint for the resource. @@ -656,6 +663,9 @@ type AutonomousDatabaseCloneProperties struct { // READ-ONLY; The refresh status of the clone. RefreshableStatus *RefreshableStatusType + // READ-ONLY; Indicates remote disaster recovery configuration + RemoteDisasterRecoveryConfiguration *DisasterRecoveryConfigurationDetails + // READ-ONLY; The SQL Web Developer URL for the Oracle Autonomous Database. SQLWebDeveloperURL *string @@ -675,6 +685,9 @@ type AutonomousDatabaseCloneProperties struct { // READ-ONLY; The date and time the Always Free database will be automatically deleted because of inactivity. TimeDeletionOfFreeAutonomousDatabase *string + // READ-ONLY; The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + TimeDisasterRecoveryRoleChanged *time.Time + // READ-ONLY; The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned // in the same region as the primary database. TimeLocalDataGuardEnabled *string @@ -764,6 +777,7 @@ func (a *AutonomousDatabaseCloneProperties) GetAutonomousDatabaseBaseProperties( PrivateEndpointLabel: a.PrivateEndpointLabel, ProvisionableCpus: a.ProvisionableCpus, ProvisioningState: a.ProvisioningState, + RemoteDisasterRecoveryConfiguration: a.RemoteDisasterRecoveryConfiguration, Role: a.Role, SQLWebDeveloperURL: a.SQLWebDeveloperURL, ScheduledOperations: a.ScheduledOperations, @@ -773,6 +787,7 @@ func (a *AutonomousDatabaseCloneProperties) GetAutonomousDatabaseBaseProperties( TimeCreated: a.TimeCreated, TimeDataGuardRoleChanged: a.TimeDataGuardRoleChanged, TimeDeletionOfFreeAutonomousDatabase: a.TimeDeletionOfFreeAutonomousDatabase, + TimeDisasterRecoveryRoleChanged: a.TimeDisasterRecoveryRoleChanged, TimeLocalDataGuardEnabled: a.TimeLocalDataGuardEnabled, TimeMaintenanceBegin: a.TimeMaintenanceBegin, TimeMaintenanceEnd: a.TimeMaintenanceEnd, @@ -788,52 +803,23 @@ func (a *AutonomousDatabaseCloneProperties) GetAutonomousDatabaseBaseProperties( } } -// AutonomousDatabaseListResult - The response of a AutonomousDatabase list operation. -type AutonomousDatabaseListResult struct { - // REQUIRED; The AutonomousDatabase items on this page - Value []*AutonomousDatabase - - // The link to the next page of items - NextLink *string -} - -// AutonomousDatabaseNationalCharacterSets resource definition -type AutonomousDatabaseNationalCharacterSet struct { - // The resource-specific properties for this resource. - Properties *AutonomousDatabaseNationalCharacterSetProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// AutonomousDatabaseNationalCharacterSetListResult - The response of a AutonomousDatabaseNationalCharacterSet list operation. -type AutonomousDatabaseNationalCharacterSetListResult struct { - // REQUIRED; The AutonomousDatabaseNationalCharacterSet items on this page - Value []*AutonomousDatabaseNationalCharacterSet +// AutonomousDatabaseCrossRegionDisasterRecoveryProperties - Autonomous Database Cross Region Disaster Recovery resource model. +type AutonomousDatabaseCrossRegionDisasterRecoveryProperties struct { + // REQUIRED; Database type to be created. + DataBaseType *DataBaseType - // The link to the next page of items - NextLink *string -} + // REQUIRED; Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. + // Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery + // time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during + // failover or switchover. + RemoteDisasterRecoveryType *DisasterRecoveryType -// AutonomousDatabaseNationalCharacterSetProperties - AutonomousDatabaseNationalCharacterSet resource model -type AutonomousDatabaseNationalCharacterSetProperties struct { - // READ-ONLY; The Oracle Autonomous Database supported national character sets. - CharacterSet *string -} + // CONSTANT; The source of the database. + // Field has constant value "CrossRegionDisasterRecovery", any specified value is ignored. + Source *string -// AutonomousDatabaseProperties - Autonomous Database resource model. -type AutonomousDatabaseProperties struct { - // REQUIRED; Database type to be created. - DataBaseType *DataBaseType + // REQUIRED; The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + SourceID *string // Admin password. AdminPassword *string @@ -895,6 +881,11 @@ type AutonomousDatabaseProperties struct { // Specifies if the Autonomous Database preview version is being provisioned. IsPreviewVersionWithServiceTermsAccepted *bool + // If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary + // and Standby. If false, the backups taken on the Primary are not replicated to the + // Standby database. + IsReplicateAutomaticBackups *bool + // The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. LicenseModel *LicenseModel @@ -911,7 +902,7 @@ type AutonomousDatabaseProperties struct { // Indicates the Autonomous Database mode. OpenMode *OpenModeType - // The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer + // The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer // database. PeerDbID *string @@ -930,6 +921,12 @@ type AutonomousDatabaseProperties struct { // The list of scheduled operations. ScheduledOperations *ScheduledOperationsType + // The name of the region where source Autonomous Database exists. + SourceLocation *string + + // The source database ocid + SourceOcid *string + // Client subnet SubnetID *string @@ -1004,10 +1001,9 @@ type AutonomousDatabaseProperties struct { // READ-ONLY; Status of Operations Insights for this Autonomous Database. OperationsInsightsStatus *OperationsInsightsStatusType - // READ-ONLY; The list of OCIDs [https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm] of standby databases - // located in Autonomous Data Guard remote regions that are associated with the source - // database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source - // primary database do not have OCIDs. + // READ-ONLY; The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are + // associated with the source database. Note that for Autonomous Database Serverless + // instances, standby databases located in the same region as the source primary database do not have Azure IDs. PeerDbIDs []*string // READ-ONLY; The private endpoint for the resource. @@ -1019,6 +1015,9 @@ type AutonomousDatabaseProperties struct { // READ-ONLY; Azure resource provisioning state. ProvisioningState *AzureResourceProvisioningState + // READ-ONLY; Indicates remote disaster recovery configuration + RemoteDisasterRecoveryConfiguration *DisasterRecoveryConfigurationDetails + // READ-ONLY; The SQL Web Developer URL for the Oracle Autonomous Database. SQLWebDeveloperURL *string @@ -1038,6 +1037,9 @@ type AutonomousDatabaseProperties struct { // READ-ONLY; The date and time the Always Free database will be automatically deleted because of inactivity. TimeDeletionOfFreeAutonomousDatabase *string + // READ-ONLY; The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + TimeDisasterRecoveryRoleChanged *time.Time + // READ-ONLY; The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned // in the same region as the primary database. TimeLocalDataGuardEnabled *string @@ -1070,8 +1072,8 @@ type AutonomousDatabaseProperties struct { UsedDataStorageSizeInTbs *int32 } -// GetAutonomousDatabaseBaseProperties implements the AutonomousDatabaseBasePropertiesClassification interface for type AutonomousDatabaseProperties. -func (a *AutonomousDatabaseProperties) GetAutonomousDatabaseBaseProperties() *AutonomousDatabaseBaseProperties { +// GetAutonomousDatabaseBaseProperties implements the AutonomousDatabaseBasePropertiesClassification interface for type AutonomousDatabaseCrossRegionDisasterRecoveryProperties. +func (a *AutonomousDatabaseCrossRegionDisasterRecoveryProperties) GetAutonomousDatabaseBaseProperties() *AutonomousDatabaseBaseProperties { return &AutonomousDatabaseBaseProperties{ ActualUsedDataStorageSizeInTbs: a.ActualUsedDataStorageSizeInTbs, AdminPassword: a.AdminPassword, @@ -1127,6 +1129,7 @@ func (a *AutonomousDatabaseProperties) GetAutonomousDatabaseBaseProperties() *Au PrivateEndpointLabel: a.PrivateEndpointLabel, ProvisionableCpus: a.ProvisionableCpus, ProvisioningState: a.ProvisioningState, + RemoteDisasterRecoveryConfiguration: a.RemoteDisasterRecoveryConfiguration, Role: a.Role, SQLWebDeveloperURL: a.SQLWebDeveloperURL, ScheduledOperations: a.ScheduledOperations, @@ -1136,6 +1139,7 @@ func (a *AutonomousDatabaseProperties) GetAutonomousDatabaseBaseProperties() *Au TimeCreated: a.TimeCreated, TimeDataGuardRoleChanged: a.TimeDataGuardRoleChanged, TimeDeletionOfFreeAutonomousDatabase: a.TimeDeletionOfFreeAutonomousDatabase, + TimeDisasterRecoveryRoleChanged: a.TimeDisasterRecoveryRoleChanged, TimeLocalDataGuardEnabled: a.TimeLocalDataGuardEnabled, TimeMaintenanceBegin: a.TimeMaintenanceBegin, TimeMaintenanceEnd: a.TimeMaintenanceEnd, @@ -1151,39 +1155,27 @@ func (a *AutonomousDatabaseProperties) GetAutonomousDatabaseBaseProperties() *Au } } -// AutonomousDatabaseStandbySummary - Autonomous Disaster Recovery standby database details. -type AutonomousDatabaseStandbySummary struct { - // The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used - // to determine the potential data loss in the event of a failover. - LagTimeInSeconds *int32 - - // Additional information about the current lifecycle state. - LifecycleDetails *string - - // The current state of the Autonomous Database. - LifecycleState *AutonomousDatabaseLifecycleState - - // The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. - TimeDataGuardRoleChanged *string +// AutonomousDatabaseFromBackupTimestampProperties - Autonomous Database From Backup Timestamp resource model. +type AutonomousDatabaseFromBackupTimestampProperties struct { + // REQUIRED; The Autonomous Database clone type. + CloneType *CloneType - // The date and time the Disaster Recovery role was switched for the standby Autonomous Database. - TimeDisasterRecoveryRoleChanged *string -} + // REQUIRED; Database type to be created. + DataBaseType *DataBaseType -// AutonomousDatabaseUpdate - The type used for update operations of the AutonomousDatabase. -type AutonomousDatabaseUpdate struct { - // The updatable properties of the AutonomousDatabase. - Properties *AutonomousDatabaseUpdateProperties + // CONSTANT; The source of the database. + // Field has constant value "BackupFromTimestamp", any specified value is ignored. + Source *string - // Resource tags. - Tags map[string]*string -} + // REQUIRED; The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + SourceID *string -// AutonomousDatabaseUpdateProperties - The updatable properties of the AutonomousDatabase. -type AutonomousDatabaseUpdateProperties struct { // Admin password. AdminPassword *string + // Autonomous Database ID + AutonomousDatabaseID *string + // The maintenance schedule type of the Autonomous Database Serverless. AutonomousMaintenanceScheduleType *AutonomousMaintenanceScheduleType @@ -1193,9 +1185,15 @@ type AutonomousDatabaseUpdateProperties struct { // The number of CPU cores to be made available to the database. CPUCoreCount *int32 + // The character set for the autonomous database. + CharacterSet *string + // The compute amount (CPUs) available to the database. ComputeCount *float32 + // The compute model of the Autonomous Database. + ComputeModel *ComputeModel + // Customer Contacts. CustomerContacts []*CustomerContact @@ -1208,6 +1206,12 @@ type AutonomousDatabaseUpdateProperties struct { // The Oracle Database Edition that applies to the Autonomous databases. DatabaseEdition *DatabaseEditionType + // A valid Oracle Database version for Autonomous Database. + DbVersion *string + + // The Autonomous Database workload type + DbWorkload *WorkloadType + // The user-friendly name for the Autonomous Database. DisplayName *string @@ -1223,6 +1227,9 @@ type AutonomousDatabaseUpdateProperties struct { // Specifies if the Autonomous Database requires mTLS connections. IsMtlsConnectionRequired *bool + // Specifies if the Autonomous Database preview version is being provisioned. + IsPreviewVersionWithServiceTermsAccepted *bool + // The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. LicenseModel *LicenseModel @@ -1233,119 +1240,836 @@ type AutonomousDatabaseUpdateProperties struct { // Details for the long-term backup schedule. LongTermBackupSchedule *LongTermBackUpScheduleDetails + // The character set for the Autonomous Database. + NcharacterSet *string + // Indicates the Autonomous Database mode. OpenMode *OpenModeType - // The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer + // The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer // database. PeerDbID *string // The Autonomous Database permission level. PermissionLevel *PermissionLevelType + // The private endpoint Ip address for the resource. + PrivateEndpointIP *string + + // The resource's private endpoint label. + PrivateEndpointLabel *string + // The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. Role *RoleType // The list of scheduled operations. - ScheduledOperations *ScheduledOperationsTypeUpdate + ScheduledOperations *ScheduledOperationsType + + // Client subnet + SubnetID *string + + // The timestamp specified for the point-in-time clone of the source Autonomous Database. The timestamp must be in the past. + Timestamp *time.Time + + // Clone from latest available backup timestamp. + UseLatestAvailableBackupTimeStamp *bool + + // VNET for network connectivity + VnetID *string // The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate // strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25'] WhitelistedIPs []*string -} -// AutonomousDatabaseWalletFile - Autonomous Database Wallet File resource model. -type AutonomousDatabaseWalletFile struct { - // REQUIRED; The base64 encoded wallet files - WalletFiles *string -} + // READ-ONLY; The current amount of storage in use for user and system data, in terabytes (TB). + ActualUsedDataStorageSizeInTbs *float64 -// AutonomousDbVersion resource definition -type AutonomousDbVersion struct { - // The resource-specific properties for this resource. - Properties *AutonomousDbVersionProperties + // READ-ONLY; The amount of storage currently allocated for the database tables and billed for, rounded up. + AllocatedStorageSizeInTbs *float64 - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string + // READ-ONLY; Information about Oracle APEX Application Development. + ApexDetails *ApexDetailsType - // READ-ONLY; The name of the resource - Name *string + // READ-ONLY; List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, + // this list is empty. + AvailableUpgradeVersions []*string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData + // READ-ONLY; The connection string used to connect to the Autonomous Database. + ConnectionStrings *ConnectionStringType - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // READ-ONLY; The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute + // instance within your VCN or that has a direct connection to your VCN. + ConnectionUrls *ConnectionURLType -// AutonomousDbVersionListResult - The response of a AutonomousDbVersion list operation. -type AutonomousDbVersionListResult struct { - // REQUIRED; The AutonomousDbVersion items on this page - Value []*AutonomousDbVersion + // READ-ONLY; Status of the Data Safe registration for this Autonomous Database. + DataSafeStatus *DataSafeStatusType - // The link to the next page of items - NextLink *string -} + // READ-ONLY; Indicates the number of seconds of data loss for a Data Guard failover. + FailedDataRecoveryInSeconds *int32 -// AutonomousDbVersionProperties - AutonomousDbVersion resource model -type AutonomousDbVersionProperties struct { - // READ-ONLY; Supported Autonomous Db versions. - Version *string + // READ-ONLY; The area assigned to In-Memory tables in Autonomous Database. + InMemoryAreaInGbs *int32 - // READ-ONLY; The Autonomous Database workload type - DbWorkload *WorkloadType + // READ-ONLY; Indicates if the Autonomous Database version is a preview version. + IsPreview *bool - // READ-ONLY; True if this version of the Oracle Database software's default is free. - IsDefaultForFree *bool + // READ-ONLY; Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + IsRemoteDataGuardEnabled *bool - // READ-ONLY; True if this version of the Oracle Database software's default is paid. - IsDefaultForPaid *bool + // READ-ONLY; Additional information about the current lifecycle state. + LifecycleDetails *string - // READ-ONLY; True if this version of the Oracle Database software can be used for Always-Free Autonomous Databases. - IsFreeTierEnabled *bool + // READ-ONLY; Views lifecycleState + LifecycleState *AutonomousDatabaseLifecycleState - // READ-ONLY; True if this version of the Oracle Database software has payments enabled. - IsPaidEnabled *bool -} + // READ-ONLY; Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data + // Guard (ADG) DR type provides business critical DR with a faster recovery time objective + // (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + LocalDisasterRecoveryType *DisasterRecoveryType -// CloudAccountDetails - Cloud Account Details model -type CloudAccountDetails struct { - // READ-ONLY; Cloud Account Home region - CloudAccountHomeRegion *string + // READ-ONLY; Local Autonomous Disaster Recovery standby database details. + LocalStandbyDb *AutonomousDatabaseStandbySummary - // READ-ONLY; Cloud Account name - CloudAccountName *string -} + // READ-ONLY; The amount of memory (in GBs) enabled per ECPU or OCPU. + MemoryPerOracleComputeUnitInGbs *int32 -// CloudExadataInfrastructure resource definition -type CloudExadataInfrastructure struct { - // REQUIRED; The geo-location where the resource lives - Location *string + // READ-ONLY; The date and time when the next long-term backup would be created. + NextLongTermBackupTimeStamp *time.Time - // REQUIRED; CloudExadataInfrastructure zones - Zones []*string + // READ-ONLY; HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + OciURL *string - // The resource-specific properties for this resource. - Properties *CloudExadataInfrastructureProperties + // READ-ONLY; Database ocid + Ocid *string - // Resource tags. - Tags map[string]*string + // READ-ONLY; Status of Operations Insights for this Autonomous Database. + OperationsInsightsStatus *OperationsInsightsStatusType - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string + // READ-ONLY; The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are + // associated with the source database. Note that for Autonomous Database Serverless + // instances, standby databases located in the same region as the source primary database do not have Azure IDs. + PeerDbIDs []*string - // READ-ONLY; The name of the resource - Name *string + // READ-ONLY; The private endpoint for the resource. + PrivateEndpoint *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData + // READ-ONLY; An array of CPU values that an Autonomous Database can be scaled to. + ProvisionableCpus []*int32 - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // READ-ONLY; Azure resource provisioning state. + ProvisioningState *AzureResourceProvisioningState -// CloudExadataInfrastructureListResult - The response of a CloudExadataInfrastructure list operation. -type CloudExadataInfrastructureListResult struct { + // READ-ONLY; Indicates remote disaster recovery configuration + RemoteDisasterRecoveryConfiguration *DisasterRecoveryConfigurationDetails + + // READ-ONLY; The SQL Web Developer URL for the Oracle Autonomous Database. + SQLWebDeveloperURL *string + + // READ-ONLY; The URL of the Service Console for the Autonomous Database. + ServiceConsoleURL *string + + // READ-ONLY; The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby + // database. + SupportedRegionsToCloneTo []*string + + // READ-ONLY; The date and time that the database was created. + TimeCreated *time.Time + + // READ-ONLY; The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + TimeDataGuardRoleChanged *string + + // READ-ONLY; The date and time the Always Free database will be automatically deleted because of inactivity. + TimeDeletionOfFreeAutonomousDatabase *string + + // READ-ONLY; The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + TimeDisasterRecoveryRoleChanged *time.Time + + // READ-ONLY; The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned + // in the same region as the primary database. + TimeLocalDataGuardEnabled *string + + // READ-ONLY; The date and time when maintenance will begin. + TimeMaintenanceBegin *time.Time + + // READ-ONLY; The date and time when maintenance will end. + TimeMaintenanceEnd *time.Time + + // READ-ONLY; The timestamp of the last failover operation. + TimeOfLastFailover *string + + // READ-ONLY; The date and time when last refresh happened. + TimeOfLastRefresh *string + + // READ-ONLY; The refresh point timestamp (UTC). + TimeOfLastRefreshPoint *string + + // READ-ONLY; The timestamp of the last switchover operation for the Autonomous Database. + TimeOfLastSwitchover *string + + // READ-ONLY; The date and time the Always Free database will be stopped because of inactivity. + TimeReclamationOfFreeAutonomousDatabase *string + + // READ-ONLY; The storage space consumed by Autonomous Database in GBs. + UsedDataStorageSizeInGbs *int32 + + // READ-ONLY; The amount of storage that has been used, in terabytes. + UsedDataStorageSizeInTbs *int32 +} + +// GetAutonomousDatabaseBaseProperties implements the AutonomousDatabaseBasePropertiesClassification interface for type AutonomousDatabaseFromBackupTimestampProperties. +func (a *AutonomousDatabaseFromBackupTimestampProperties) GetAutonomousDatabaseBaseProperties() *AutonomousDatabaseBaseProperties { + return &AutonomousDatabaseBaseProperties{ + ActualUsedDataStorageSizeInTbs: a.ActualUsedDataStorageSizeInTbs, + AdminPassword: a.AdminPassword, + AllocatedStorageSizeInTbs: a.AllocatedStorageSizeInTbs, + ApexDetails: a.ApexDetails, + AutonomousDatabaseID: a.AutonomousDatabaseID, + AutonomousMaintenanceScheduleType: a.AutonomousMaintenanceScheduleType, + AvailableUpgradeVersions: a.AvailableUpgradeVersions, + BackupRetentionPeriodInDays: a.BackupRetentionPeriodInDays, + CPUCoreCount: a.CPUCoreCount, + CharacterSet: a.CharacterSet, + ComputeCount: a.ComputeCount, + ComputeModel: a.ComputeModel, + ConnectionStrings: a.ConnectionStrings, + ConnectionUrls: a.ConnectionUrls, + CustomerContacts: a.CustomerContacts, + DataBaseType: a.DataBaseType, + DataSafeStatus: a.DataSafeStatus, + DataStorageSizeInGbs: a.DataStorageSizeInGbs, + DataStorageSizeInTbs: a.DataStorageSizeInTbs, + DatabaseEdition: a.DatabaseEdition, + DbVersion: a.DbVersion, + DbWorkload: a.DbWorkload, + DisplayName: a.DisplayName, + FailedDataRecoveryInSeconds: a.FailedDataRecoveryInSeconds, + InMemoryAreaInGbs: a.InMemoryAreaInGbs, + IsAutoScalingEnabled: a.IsAutoScalingEnabled, + IsAutoScalingForStorageEnabled: a.IsAutoScalingForStorageEnabled, + IsLocalDataGuardEnabled: a.IsLocalDataGuardEnabled, + IsMtlsConnectionRequired: a.IsMtlsConnectionRequired, + IsPreview: a.IsPreview, + IsPreviewVersionWithServiceTermsAccepted: a.IsPreviewVersionWithServiceTermsAccepted, + IsRemoteDataGuardEnabled: a.IsRemoteDataGuardEnabled, + LicenseModel: a.LicenseModel, + LifecycleDetails: a.LifecycleDetails, + LifecycleState: a.LifecycleState, + LocalAdgAutoFailoverMaxDataLossLimit: a.LocalAdgAutoFailoverMaxDataLossLimit, + LocalDisasterRecoveryType: a.LocalDisasterRecoveryType, + LocalStandbyDb: a.LocalStandbyDb, + LongTermBackupSchedule: a.LongTermBackupSchedule, + MemoryPerOracleComputeUnitInGbs: a.MemoryPerOracleComputeUnitInGbs, + NcharacterSet: a.NcharacterSet, + NextLongTermBackupTimeStamp: a.NextLongTermBackupTimeStamp, + OciURL: a.OciURL, + Ocid: a.Ocid, + OpenMode: a.OpenMode, + OperationsInsightsStatus: a.OperationsInsightsStatus, + PeerDbID: a.PeerDbID, + PeerDbIDs: a.PeerDbIDs, + PermissionLevel: a.PermissionLevel, + PrivateEndpoint: a.PrivateEndpoint, + PrivateEndpointIP: a.PrivateEndpointIP, + PrivateEndpointLabel: a.PrivateEndpointLabel, + ProvisionableCpus: a.ProvisionableCpus, + ProvisioningState: a.ProvisioningState, + RemoteDisasterRecoveryConfiguration: a.RemoteDisasterRecoveryConfiguration, + Role: a.Role, + SQLWebDeveloperURL: a.SQLWebDeveloperURL, + ScheduledOperations: a.ScheduledOperations, + ServiceConsoleURL: a.ServiceConsoleURL, + SubnetID: a.SubnetID, + SupportedRegionsToCloneTo: a.SupportedRegionsToCloneTo, + TimeCreated: a.TimeCreated, + TimeDataGuardRoleChanged: a.TimeDataGuardRoleChanged, + TimeDeletionOfFreeAutonomousDatabase: a.TimeDeletionOfFreeAutonomousDatabase, + TimeDisasterRecoveryRoleChanged: a.TimeDisasterRecoveryRoleChanged, + TimeLocalDataGuardEnabled: a.TimeLocalDataGuardEnabled, + TimeMaintenanceBegin: a.TimeMaintenanceBegin, + TimeMaintenanceEnd: a.TimeMaintenanceEnd, + TimeOfLastFailover: a.TimeOfLastFailover, + TimeOfLastRefresh: a.TimeOfLastRefresh, + TimeOfLastRefreshPoint: a.TimeOfLastRefreshPoint, + TimeOfLastSwitchover: a.TimeOfLastSwitchover, + TimeReclamationOfFreeAutonomousDatabase: a.TimeReclamationOfFreeAutonomousDatabase, + UsedDataStorageSizeInGbs: a.UsedDataStorageSizeInGbs, + UsedDataStorageSizeInTbs: a.UsedDataStorageSizeInTbs, + VnetID: a.VnetID, + WhitelistedIPs: a.WhitelistedIPs, + } +} + +// AutonomousDatabaseListResult - The response of a AutonomousDatabase list operation. +type AutonomousDatabaseListResult struct { + // REQUIRED; The AutonomousDatabase items on this page + Value []*AutonomousDatabase + + // The link to the next page of items + NextLink *string +} + +// AutonomousDatabaseNationalCharacterSets resource definition +type AutonomousDatabaseNationalCharacterSet struct { + // The resource-specific properties for this resource. + Properties *AutonomousDatabaseNationalCharacterSetProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AutonomousDatabaseNationalCharacterSetListResult - The response of a AutonomousDatabaseNationalCharacterSet list operation. +type AutonomousDatabaseNationalCharacterSetListResult struct { + // REQUIRED; The AutonomousDatabaseNationalCharacterSet items on this page + Value []*AutonomousDatabaseNationalCharacterSet + + // The link to the next page of items + NextLink *string +} + +// AutonomousDatabaseNationalCharacterSetProperties - AutonomousDatabaseNationalCharacterSet resource model +type AutonomousDatabaseNationalCharacterSetProperties struct { + // REQUIRED; The Oracle Autonomous Database supported national character sets. + CharacterSet *string +} + +// AutonomousDatabaseProperties - Autonomous Database resource model. +type AutonomousDatabaseProperties struct { + // REQUIRED; Database type to be created. + DataBaseType *DataBaseType + + // Admin password. + AdminPassword *string + + // Autonomous Database ID + AutonomousDatabaseID *string + + // The maintenance schedule type of the Autonomous Database Serverless. + AutonomousMaintenanceScheduleType *AutonomousMaintenanceScheduleType + + // Retention period, in days, for long-term backups + BackupRetentionPeriodInDays *int32 + + // The number of CPU cores to be made available to the database. + CPUCoreCount *int32 + + // The character set for the autonomous database. + CharacterSet *string + + // The compute amount (CPUs) available to the database. + ComputeCount *float32 + + // The compute model of the Autonomous Database. + ComputeModel *ComputeModel + + // Customer Contacts. + CustomerContacts []*CustomerContact + + // The size, in gigabytes, of the data volume that will be created and attached to the database. + DataStorageSizeInGbs *int32 + + // The quantity of data in the database, in terabytes. + DataStorageSizeInTbs *int32 + + // The Oracle Database Edition that applies to the Autonomous databases. + DatabaseEdition *DatabaseEditionType + + // A valid Oracle Database version for Autonomous Database. + DbVersion *string + + // The Autonomous Database workload type + DbWorkload *WorkloadType + + // The user-friendly name for the Autonomous Database. + DisplayName *string + + // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + IsAutoScalingEnabled *bool + + // Indicates if auto scaling is enabled for the Autonomous Database storage. + IsAutoScalingForStorageEnabled *bool + + // Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + IsLocalDataGuardEnabled *bool + + // Specifies if the Autonomous Database requires mTLS connections. + IsMtlsConnectionRequired *bool + + // Specifies if the Autonomous Database preview version is being provisioned. + IsPreviewVersionWithServiceTermsAccepted *bool + + // The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + LicenseModel *LicenseModel + + // Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover + // will be triggered when necessary for a Local Autonomous Data Guard + LocalAdgAutoFailoverMaxDataLossLimit *int32 + + // Details for the long-term backup schedule. + LongTermBackupSchedule *LongTermBackUpScheduleDetails + + // The character set for the Autonomous Database. + NcharacterSet *string + + // Indicates the Autonomous Database mode. + OpenMode *OpenModeType + + // The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer + // database. + PeerDbID *string + + // The Autonomous Database permission level. + PermissionLevel *PermissionLevelType + + // The private endpoint Ip address for the resource. + PrivateEndpointIP *string + + // The resource's private endpoint label. + PrivateEndpointLabel *string + + // The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + Role *RoleType + + // The list of scheduled operations. + ScheduledOperations *ScheduledOperationsType + + // Client subnet + SubnetID *string + + // VNET for network connectivity + VnetID *string + + // The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate + // strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25'] + WhitelistedIPs []*string + + // READ-ONLY; The current amount of storage in use for user and system data, in terabytes (TB). + ActualUsedDataStorageSizeInTbs *float64 + + // READ-ONLY; The amount of storage currently allocated for the database tables and billed for, rounded up. + AllocatedStorageSizeInTbs *float64 + + // READ-ONLY; Information about Oracle APEX Application Development. + ApexDetails *ApexDetailsType + + // READ-ONLY; List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, + // this list is empty. + AvailableUpgradeVersions []*string + + // READ-ONLY; The connection string used to connect to the Autonomous Database. + ConnectionStrings *ConnectionStringType + + // READ-ONLY; The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute + // instance within your VCN or that has a direct connection to your VCN. + ConnectionUrls *ConnectionURLType + + // READ-ONLY; Status of the Data Safe registration for this Autonomous Database. + DataSafeStatus *DataSafeStatusType + + // READ-ONLY; Indicates the number of seconds of data loss for a Data Guard failover. + FailedDataRecoveryInSeconds *int32 + + // READ-ONLY; The area assigned to In-Memory tables in Autonomous Database. + InMemoryAreaInGbs *int32 + + // READ-ONLY; Indicates if the Autonomous Database version is a preview version. + IsPreview *bool + + // READ-ONLY; Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + IsRemoteDataGuardEnabled *bool + + // READ-ONLY; Additional information about the current lifecycle state. + LifecycleDetails *string + + // READ-ONLY; Views lifecycleState + LifecycleState *AutonomousDatabaseLifecycleState + + // READ-ONLY; Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data + // Guard (ADG) DR type provides business critical DR with a faster recovery time objective + // (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + LocalDisasterRecoveryType *DisasterRecoveryType + + // READ-ONLY; Local Autonomous Disaster Recovery standby database details. + LocalStandbyDb *AutonomousDatabaseStandbySummary + + // READ-ONLY; The amount of memory (in GBs) enabled per ECPU or OCPU. + MemoryPerOracleComputeUnitInGbs *int32 + + // READ-ONLY; The date and time when the next long-term backup would be created. + NextLongTermBackupTimeStamp *time.Time + + // READ-ONLY; HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + OciURL *string + + // READ-ONLY; Database ocid + Ocid *string + + // READ-ONLY; Status of Operations Insights for this Autonomous Database. + OperationsInsightsStatus *OperationsInsightsStatusType + + // READ-ONLY; The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are + // associated with the source database. Note that for Autonomous Database Serverless + // instances, standby databases located in the same region as the source primary database do not have Azure IDs. + PeerDbIDs []*string + + // READ-ONLY; The private endpoint for the resource. + PrivateEndpoint *string + + // READ-ONLY; An array of CPU values that an Autonomous Database can be scaled to. + ProvisionableCpus []*int32 + + // READ-ONLY; Azure resource provisioning state. + ProvisioningState *AzureResourceProvisioningState + + // READ-ONLY; Indicates remote disaster recovery configuration + RemoteDisasterRecoveryConfiguration *DisasterRecoveryConfigurationDetails + + // READ-ONLY; The SQL Web Developer URL for the Oracle Autonomous Database. + SQLWebDeveloperURL *string + + // READ-ONLY; The URL of the Service Console for the Autonomous Database. + ServiceConsoleURL *string + + // READ-ONLY; The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby + // database. + SupportedRegionsToCloneTo []*string + + // READ-ONLY; The date and time that the database was created. + TimeCreated *time.Time + + // READ-ONLY; The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + TimeDataGuardRoleChanged *string + + // READ-ONLY; The date and time the Always Free database will be automatically deleted because of inactivity. + TimeDeletionOfFreeAutonomousDatabase *string + + // READ-ONLY; The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + TimeDisasterRecoveryRoleChanged *time.Time + + // READ-ONLY; The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned + // in the same region as the primary database. + TimeLocalDataGuardEnabled *string + + // READ-ONLY; The date and time when maintenance will begin. + TimeMaintenanceBegin *time.Time + + // READ-ONLY; The date and time when maintenance will end. + TimeMaintenanceEnd *time.Time + + // READ-ONLY; The timestamp of the last failover operation. + TimeOfLastFailover *string + + // READ-ONLY; The date and time when last refresh happened. + TimeOfLastRefresh *string + + // READ-ONLY; The refresh point timestamp (UTC). + TimeOfLastRefreshPoint *string + + // READ-ONLY; The timestamp of the last switchover operation for the Autonomous Database. + TimeOfLastSwitchover *string + + // READ-ONLY; The date and time the Always Free database will be stopped because of inactivity. + TimeReclamationOfFreeAutonomousDatabase *string + + // READ-ONLY; The storage space consumed by Autonomous Database in GBs. + UsedDataStorageSizeInGbs *int32 + + // READ-ONLY; The amount of storage that has been used, in terabytes. + UsedDataStorageSizeInTbs *int32 +} + +// GetAutonomousDatabaseBaseProperties implements the AutonomousDatabaseBasePropertiesClassification interface for type AutonomousDatabaseProperties. +func (a *AutonomousDatabaseProperties) GetAutonomousDatabaseBaseProperties() *AutonomousDatabaseBaseProperties { + return &AutonomousDatabaseBaseProperties{ + ActualUsedDataStorageSizeInTbs: a.ActualUsedDataStorageSizeInTbs, + AdminPassword: a.AdminPassword, + AllocatedStorageSizeInTbs: a.AllocatedStorageSizeInTbs, + ApexDetails: a.ApexDetails, + AutonomousDatabaseID: a.AutonomousDatabaseID, + AutonomousMaintenanceScheduleType: a.AutonomousMaintenanceScheduleType, + AvailableUpgradeVersions: a.AvailableUpgradeVersions, + BackupRetentionPeriodInDays: a.BackupRetentionPeriodInDays, + CPUCoreCount: a.CPUCoreCount, + CharacterSet: a.CharacterSet, + ComputeCount: a.ComputeCount, + ComputeModel: a.ComputeModel, + ConnectionStrings: a.ConnectionStrings, + ConnectionUrls: a.ConnectionUrls, + CustomerContacts: a.CustomerContacts, + DataBaseType: a.DataBaseType, + DataSafeStatus: a.DataSafeStatus, + DataStorageSizeInGbs: a.DataStorageSizeInGbs, + DataStorageSizeInTbs: a.DataStorageSizeInTbs, + DatabaseEdition: a.DatabaseEdition, + DbVersion: a.DbVersion, + DbWorkload: a.DbWorkload, + DisplayName: a.DisplayName, + FailedDataRecoveryInSeconds: a.FailedDataRecoveryInSeconds, + InMemoryAreaInGbs: a.InMemoryAreaInGbs, + IsAutoScalingEnabled: a.IsAutoScalingEnabled, + IsAutoScalingForStorageEnabled: a.IsAutoScalingForStorageEnabled, + IsLocalDataGuardEnabled: a.IsLocalDataGuardEnabled, + IsMtlsConnectionRequired: a.IsMtlsConnectionRequired, + IsPreview: a.IsPreview, + IsPreviewVersionWithServiceTermsAccepted: a.IsPreviewVersionWithServiceTermsAccepted, + IsRemoteDataGuardEnabled: a.IsRemoteDataGuardEnabled, + LicenseModel: a.LicenseModel, + LifecycleDetails: a.LifecycleDetails, + LifecycleState: a.LifecycleState, + LocalAdgAutoFailoverMaxDataLossLimit: a.LocalAdgAutoFailoverMaxDataLossLimit, + LocalDisasterRecoveryType: a.LocalDisasterRecoveryType, + LocalStandbyDb: a.LocalStandbyDb, + LongTermBackupSchedule: a.LongTermBackupSchedule, + MemoryPerOracleComputeUnitInGbs: a.MemoryPerOracleComputeUnitInGbs, + NcharacterSet: a.NcharacterSet, + NextLongTermBackupTimeStamp: a.NextLongTermBackupTimeStamp, + OciURL: a.OciURL, + Ocid: a.Ocid, + OpenMode: a.OpenMode, + OperationsInsightsStatus: a.OperationsInsightsStatus, + PeerDbID: a.PeerDbID, + PeerDbIDs: a.PeerDbIDs, + PermissionLevel: a.PermissionLevel, + PrivateEndpoint: a.PrivateEndpoint, + PrivateEndpointIP: a.PrivateEndpointIP, + PrivateEndpointLabel: a.PrivateEndpointLabel, + ProvisionableCpus: a.ProvisionableCpus, + ProvisioningState: a.ProvisioningState, + RemoteDisasterRecoveryConfiguration: a.RemoteDisasterRecoveryConfiguration, + Role: a.Role, + SQLWebDeveloperURL: a.SQLWebDeveloperURL, + ScheduledOperations: a.ScheduledOperations, + ServiceConsoleURL: a.ServiceConsoleURL, + SubnetID: a.SubnetID, + SupportedRegionsToCloneTo: a.SupportedRegionsToCloneTo, + TimeCreated: a.TimeCreated, + TimeDataGuardRoleChanged: a.TimeDataGuardRoleChanged, + TimeDeletionOfFreeAutonomousDatabase: a.TimeDeletionOfFreeAutonomousDatabase, + TimeDisasterRecoveryRoleChanged: a.TimeDisasterRecoveryRoleChanged, + TimeLocalDataGuardEnabled: a.TimeLocalDataGuardEnabled, + TimeMaintenanceBegin: a.TimeMaintenanceBegin, + TimeMaintenanceEnd: a.TimeMaintenanceEnd, + TimeOfLastFailover: a.TimeOfLastFailover, + TimeOfLastRefresh: a.TimeOfLastRefresh, + TimeOfLastRefreshPoint: a.TimeOfLastRefreshPoint, + TimeOfLastSwitchover: a.TimeOfLastSwitchover, + TimeReclamationOfFreeAutonomousDatabase: a.TimeReclamationOfFreeAutonomousDatabase, + UsedDataStorageSizeInGbs: a.UsedDataStorageSizeInGbs, + UsedDataStorageSizeInTbs: a.UsedDataStorageSizeInTbs, + VnetID: a.VnetID, + WhitelistedIPs: a.WhitelistedIPs, + } +} + +// AutonomousDatabaseStandbySummary - Autonomous Disaster Recovery standby database details. +type AutonomousDatabaseStandbySummary struct { + // The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used + // to determine the potential data loss in the event of a failover. + LagTimeInSeconds *int32 + + // Additional information about the current lifecycle state. + LifecycleDetails *string + + // The current state of the Autonomous Database. + LifecycleState *AutonomousDatabaseLifecycleState + + // The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. + TimeDataGuardRoleChanged *string + + // The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + TimeDisasterRecoveryRoleChanged *string +} + +// AutonomousDatabaseUpdate - The type used for update operations of the AutonomousDatabase. +type AutonomousDatabaseUpdate struct { + // The resource-specific properties for this resource. + Properties *AutonomousDatabaseUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// AutonomousDatabaseUpdateProperties - The updatable properties of the AutonomousDatabase. +type AutonomousDatabaseUpdateProperties struct { + // Admin password. + AdminPassword *string + + // The maintenance schedule type of the Autonomous Database Serverless. + AutonomousMaintenanceScheduleType *AutonomousMaintenanceScheduleType + + // Retention period, in days, for long-term backups + BackupRetentionPeriodInDays *int32 + + // The number of CPU cores to be made available to the database. + CPUCoreCount *int32 + + // The compute amount (CPUs) available to the database. + ComputeCount *float32 + + // Customer Contacts. + CustomerContacts []*CustomerContact + + // The size, in gigabytes, of the data volume that will be created and attached to the database. + DataStorageSizeInGbs *int32 + + // The quantity of data in the database, in terabytes. + DataStorageSizeInTbs *int32 + + // The Oracle Database Edition that applies to the Autonomous databases. + DatabaseEdition *DatabaseEditionType + + // The user-friendly name for the Autonomous Database. + DisplayName *string + + // Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + IsAutoScalingEnabled *bool + + // Indicates if auto scaling is enabled for the Autonomous Database storage. + IsAutoScalingForStorageEnabled *bool + + // Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + IsLocalDataGuardEnabled *bool + + // Specifies if the Autonomous Database requires mTLS connections. + IsMtlsConnectionRequired *bool + + // The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + LicenseModel *LicenseModel + + // Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover + // will be triggered when necessary for a Local Autonomous Data Guard + LocalAdgAutoFailoverMaxDataLossLimit *int32 + + // Details for the long-term backup schedule. + LongTermBackupSchedule *LongTermBackUpScheduleDetails + + // Indicates the Autonomous Database mode. + OpenMode *OpenModeType + + // The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer + // database. + PeerDbID *string + + // The Autonomous Database permission level. + PermissionLevel *PermissionLevelType + + // The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + Role *RoleType + + // The list of scheduled operations. + ScheduledOperations *ScheduledOperationsTypeUpdate + + // The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate + // strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25'] + WhitelistedIPs []*string +} + +// AutonomousDatabaseWalletFile - Autonomous Database Wallet File resource model. +type AutonomousDatabaseWalletFile struct { + // REQUIRED; The base64 encoded wallet files + WalletFiles *string +} + +// AutonomousDbVersion resource definition +type AutonomousDbVersion struct { + // The resource-specific properties for this resource. + Properties *AutonomousDbVersionProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AutonomousDbVersionListResult - The response of a AutonomousDbVersion list operation. +type AutonomousDbVersionListResult struct { + // REQUIRED; The AutonomousDbVersion items on this page + Value []*AutonomousDbVersion + + // The link to the next page of items + NextLink *string +} + +// AutonomousDbVersionProperties - AutonomousDbVersion resource model +type AutonomousDbVersionProperties struct { + // REQUIRED; Supported Autonomous Db versions. + Version *string + + // The Autonomous Database workload type + DbWorkload *WorkloadType + + // True if this version of the Oracle Database software's default is free. + IsDefaultForFree *bool + + // True if this version of the Oracle Database software's default is paid. + IsDefaultForPaid *bool + + // True if this version of the Oracle Database software can be used for Always-Free Autonomous Databases. + IsFreeTierEnabled *bool + + // True if this version of the Oracle Database software has payments enabled. + IsPaidEnabled *bool +} + +// AzureSubscriptions - Azure Subscriptions model +type AzureSubscriptions struct { + // REQUIRED; Azure Subscription Ids to be updated + AzureSubscriptionIDs []*string +} + +// CloudAccountDetails - Cloud Account Details model +type CloudAccountDetails struct { + // READ-ONLY; Cloud Account Home region + CloudAccountHomeRegion *string + + // READ-ONLY; Cloud Account name + CloudAccountName *string +} + +// CloudExadataInfrastructure resource definition +type CloudExadataInfrastructure struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // REQUIRED; CloudExadataInfrastructure zones + Zones []*string + + // The resource-specific properties for this resource. + Properties *CloudExadataInfrastructureProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CloudExadataInfrastructureListResult - The response of a CloudExadataInfrastructure list operation. +type CloudExadataInfrastructureListResult struct { // REQUIRED; The CloudExadataInfrastructure items on this page Value []*CloudExadataInfrastructure @@ -1353,151 +2077,731 @@ type CloudExadataInfrastructureListResult struct { NextLink *string } -// CloudExadataInfrastructureProperties - CloudExadataInfrastructure resource model -type CloudExadataInfrastructureProperties struct { - // REQUIRED; The name for the Exadata infrastructure. +// CloudExadataInfrastructureProperties - CloudExadataInfrastructure resource model +type CloudExadataInfrastructureProperties struct { + // REQUIRED; The name for the Exadata infrastructure. + DisplayName *string + + // REQUIRED; The model name of the cloud Exadata infrastructure resource. + Shape *string + + // The number of compute servers for the cloud Exadata infrastructure. + ComputeCount *int32 + + // The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. + // Oracle uses these email addresses to send notifications about planned and + // unplanned software maintenance updates, information about system hardware, and other information needed by administrators. + // Up to 10 email addresses can be added to the customer contacts for a cloud + // Exadata infrastructure instance. + CustomerContacts []*CustomerContact + + // The database server model type of the cloud Exadata infrastructure resource. + DatabaseServerType *string + + // maintenanceWindow property + MaintenanceWindow *MaintenanceWindow + + // The number of storage servers for the cloud Exadata infrastructure. + StorageCount *int32 + + // The storage server model type of the cloud Exadata infrastructure resource. + StorageServerType *string + + // READ-ONLY; The requested number of additional storage servers activated for the Exadata infrastructure. + ActivatedStorageCount *int32 + + // READ-ONLY; The requested number of additional storage servers for the Exadata infrastructure. + AdditionalStorageCount *int32 + + // READ-ONLY; The available storage can be allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + AvailableStorageSizeInGbs *int32 + + // READ-ONLY; The total number of CPU cores allocated. + CPUCount *int32 + + // READ-ONLY; The compute model of the Exadata Infrastructure + ComputeModel *ComputeModel + + // READ-ONLY; The quantity of data in the database, in terabytes. + DataStorageSizeInTbs *float64 + + // READ-ONLY; The local node storage to be allocated in GBs. + DbNodeStorageSizeInGbs *int32 + + // READ-ONLY; The software version of the database servers (dom0) in the Exadata infrastructure. + DbServerVersion *string + + // READ-ONLY; Defined file system configurations + DefinedFileSystemConfiguration []*DefinedFileSystemConfiguration + + // READ-ONLY; The estimated total time required in minutes for all patching operations (database server, storage server, and + // network switch patching). + EstimatedPatchingTime *EstimatedPatchingTime + + // READ-ONLY; The OCID of the last maintenance run. + LastMaintenanceRunID *string + + // READ-ONLY; Additional information about the current lifecycle state. + LifecycleDetails *string + + // READ-ONLY; CloudExadataInfrastructure lifecycle state + LifecycleState *CloudExadataInfrastructureLifecycleState + + // READ-ONLY; The total number of CPU cores available. + MaxCPUCount *int32 + + // READ-ONLY; The total available DATA disk group size. + MaxDataStorageInTbs *float64 + + // READ-ONLY; The total local node storage available in GBs. + MaxDbNodeStorageSizeInGbs *int32 + + // READ-ONLY; The total memory available in GBs. + MaxMemoryInGbs *int32 + + // READ-ONLY; The memory allocated in GBs. + MemorySizeInGbs *int32 + + // READ-ONLY; Monthly Db Server version + MonthlyDbServerVersion *string + + // READ-ONLY; Monthly Storage Server version + MonthlyStorageServerVersion *string + + // READ-ONLY; The OCID of the next maintenance run. + NextMaintenanceRunID *string + + // READ-ONLY; HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + OciURL *string + + // READ-ONLY; Exadata infra ocid + Ocid *string + + // READ-ONLY; CloudExadataInfrastructure provisioning state + ProvisioningState *AzureResourceProvisioningState + + // READ-ONLY; The software version of the storage servers (cells) in the Exadata infrastructure. + StorageServerVersion *string + + // READ-ONLY; The date and time the cloud Exadata infrastructure resource was created. + TimeCreated *string + + // READ-ONLY; The total storage allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + TotalStorageSizeInGbs *int32 +} + +// CloudExadataInfrastructureUpdate - The type used for update operations of the CloudExadataInfrastructure. +type CloudExadataInfrastructureUpdate struct { + // The resource-specific properties for this resource. + Properties *CloudExadataInfrastructureUpdateProperties + + // Resource tags. + Tags map[string]*string + + // CloudExadataInfrastructure zones + Zones []*string +} + +// CloudExadataInfrastructureUpdateProperties - The updatable properties of the CloudExadataInfrastructure. +type CloudExadataInfrastructureUpdateProperties struct { + // The number of compute servers for the cloud Exadata infrastructure. + ComputeCount *int32 + + // The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. + // Oracle uses these email addresses to send notifications about planned and + // unplanned software maintenance updates, information about system hardware, and other information needed by administrators. + // Up to 10 email addresses can be added to the customer contacts for a cloud + // Exadata infrastructure instance. + CustomerContacts []*CustomerContact + + // The name for the Exadata infrastructure. + DisplayName *string + + // maintenanceWindow property + MaintenanceWindow *MaintenanceWindow + + // The number of storage servers for the cloud Exadata infrastructure. + StorageCount *int32 +} + +// CloudVMCluster - CloudVmCluster resource definition +type CloudVMCluster struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // The resource-specific properties for this resource. + Properties *CloudVMClusterProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// CloudVMClusterListResult - The response of a CloudVmCluster list operation. +type CloudVMClusterListResult struct { + // REQUIRED; The CloudVmCluster items on this page + Value []*CloudVMCluster + + // The link to the next page of items + NextLink *string +} + +// CloudVMClusterProperties - CloudVmCluster resource model +type CloudVMClusterProperties struct { + // REQUIRED; The number of CPU cores enabled on the cloud VM cluster. + CPUCoreCount *int32 + + // REQUIRED; Cloud Exadata Infrastructure ID + CloudExadataInfrastructureID *string + + // REQUIRED; Display Name + DisplayName *string + + // REQUIRED; Oracle Grid Infrastructure (GI) software version + GiVersion *string + + // REQUIRED; The hostname for the cloud VM cluster. + Hostname *string + + // REQUIRED; The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + SSHPublicKeys []*string + + // REQUIRED; Client subnet + SubnetID *string + + // REQUIRED; VNET for network connectivity + VnetID *string + + // Client OCI backup subnet CIDR, default is 192.168.252.0/22 + BackupSubnetCidr *string + + // The cluster name for cloud VM cluster. The cluster name must begin with an alphabetic character, and may contain hyphens + // (-). Underscores (_) are not permitted. The cluster name can be no longer than + // 11 characters and is not case sensitive. + ClusterName *string + + // The list of compute servers to be added to the cloud VM cluster. + ComputeNodes []*string + + // Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + DataCollectionOptions *DataCollectionOptions + + // The percentage assigned to DATA storage (user data and database files). The remaining percentage is assigned to RECO storage + // (database redo logs, archive logs, and recovery manager backups). Accepted + // values are 35, 40, 60 and 80. The default is 80 percent assigned to DATA storage. See Storage Configuration [/Content/Database/Concepts/exaoverview.htm#Exadata] + // in the Exadata documentation for + // details on the impact of the configuration settings on storage. + DataStoragePercentage *int32 + + // The data disk group size to be allocated in TBs. + DataStorageSizeInTbs *float64 + + // The local node storage to be allocated in GBs. + DbNodeStorageSizeInGbs *int32 + + // The list of DB servers. + DbServers []*string + + // The domain name for the cloud VM cluster. + Domain *string + + // Array of mount path and size. + FileSystemConfigurationDetails []*FileSystemConfigurationDetails + + // If true, database backup on local Exadata storage is configured for the cloud VM cluster. If false, database backup on + // local Exadata storage is not available in the cloud VM cluster. + IsLocalBackupEnabled *bool + + // If true, sparse disk group is configured for the cloud VM cluster. If false, sparse disk group is not created. + IsSparseDiskgroupEnabled *bool + + // The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + LicenseModel *LicenseModel + + // The memory to be allocated in GBs. + MemorySizeInGbs *int32 + + // CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + NsgCidrs []*NsgCidr + + // The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. + OcpuCount *float32 + + // The TCP Single Client Access Name (SCAN) port. The default port is 1521. + ScanListenerPortTCP *int32 + + // The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + ScanListenerPortTCPSSL *int32 + + // The data disk group size to be allocated in GBs per VM. + StorageSizeInGbs *int32 + + // Operating system version of the image. + SystemVersion *string + + // The time zone of the cloud VM cluster. For details, see Exadata Infrastructure Time Zones [/Content/Database/References/timezones.htm]. + TimeZone *string + + // The OCID of the zone the cloud VM cluster is associated with. + ZoneID *string + + // READ-ONLY; Cluster compartmentId + CompartmentID *string + + // READ-ONLY; The compute model of the VM Cluster. + ComputeModel *ComputeModel + + // READ-ONLY; The type of redundancy configured for the cloud Vm cluster. NORMAL is 2-way redundancy. HIGH is 3-way redundancy. + DiskRedundancy *DiskRedundancy + + // READ-ONLY; iormConfigCache details for cloud VM cluster. + IormConfigCache *ExadataIormConfig + + // READ-ONLY; The OCID of the last maintenance update history entry. + LastUpdateHistoryEntryID *string + + // READ-ONLY; Additional information about the current lifecycle state. + LifecycleDetails *string + + // READ-ONLY; CloudVmCluster lifecycle state + LifecycleState *CloudVMClusterLifecycleState + + // READ-ONLY; The port number configured for the listener on the cloud VM cluster. + ListenerPort *int64 + + // READ-ONLY; The number of nodes in the cloud VM cluster. + NodeCount *int32 + + // READ-ONLY; HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + NsgURL *string + + // READ-ONLY; HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + OciURL *string + + // READ-ONLY; Cloud VM Cluster ocid + Ocid *string + + // READ-ONLY; CloudVmCluster provisioning state + ProvisioningState *AzureResourceProvisioningState + + // READ-ONLY; The FQDN of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + ScanDNSName *string + + // READ-ONLY; The OCID of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + ScanDNSRecordID *string + + // READ-ONLY; The Single Client Access Name (SCAN) IP addresses associated with the cloud VM cluster. SCAN IP addresses are + // typically used for load balancing and are not assigned to any interface. Oracle + // Clusterware directs the requests to the appropriate nodes in the cluster. Note: For a single-node DB system, this list + // is empty. + ScanIPIDs []*string + + // READ-ONLY; The model name of the Exadata hardware running the cloud VM cluster. + Shape *string + + // READ-ONLY; Cluster subnet ocid + SubnetOcid *string + + // READ-ONLY; The date and time that the cloud VM cluster was created. + TimeCreated *time.Time + + // READ-ONLY; The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster Ready Services (CRS) creates + // and maintains one VIP address for each node in the Exadata Cloud Service instance to + // enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. Note: For a single-node + // DB system, this list is empty. + VipIDs []*string +} + +// CloudVMClusterUpdate - The type used for update operations of the CloudVmCluster. +type CloudVMClusterUpdate struct { + // The resource-specific properties for this resource. + Properties *CloudVMClusterUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// CloudVMClusterUpdateProperties - The updatable properties of the CloudVmCluster. +type CloudVMClusterUpdateProperties struct { + // The number of CPU cores enabled on the cloud VM cluster. + CPUCoreCount *int32 + + // The list of compute servers to be added to the cloud VM cluster. + ComputeNodes []*string + + // Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + DataCollectionOptions *DataCollectionOptions + + // The data disk group size to be allocated in TBs. + DataStorageSizeInTbs *float64 + + // The local node storage to be allocated in GBs. + DbNodeStorageSizeInGbs *int32 + + // Display Name + DisplayName *string + + // Array of mount path and size. + FileSystemConfigurationDetails []*FileSystemConfigurationDetails + + // The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + LicenseModel *LicenseModel + + // The memory to be allocated in GBs. + MemorySizeInGbs *int32 + + // The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. + OcpuCount *float32 + + // The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + SSHPublicKeys []*string + + // The data disk group size to be allocated in GBs per VM. + StorageSizeInGbs *int32 +} + +// ConnectionStringType - Connection strings to connect to an Oracle Autonomous Database. +type ConnectionStringType struct { + // Returns all connection strings that can be used to connect to the Autonomous Database. + AllConnectionStrings *AllConnectionStringType + + // The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent + // SQL statements. + Dedicated *string + + // The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, + // but supports the fewest number of concurrent SQL statements. + High *string + + // The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent + // SQL statements. + Low *string + + // The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level + // of performance, but supports more concurrent SQL statements. + Medium *string + + // A list of connection string profiles to allow clients to group, filter and select connection string values based on structured + // metadata. + Profiles []*ProfileType +} + +// ConnectionURLType - The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from +// a Compute instance within your VCN or that has a direct connection to your VCN. +type ConnectionURLType struct { + // Oracle Application Express (APEX) URL. + ApexURL *string + + // The URL of the Database Transforms for the Autonomous Database. + DatabaseTransformsURL *string + + // The URL of the Graph Studio for the Autonomous Database. + GraphStudioURL *string + + // The URL of the Oracle Machine Learning (OML) Notebook for the Autonomous Database. + MachineLearningNotebookURL *string + + // The URL of the MongoDB API for the Autonomous Database. + MongoDbURL *string + + // The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous Database. + OrdsURL *string + + // Oracle SQL Developer Web URL. + SQLDevWebURL *string +} + +// CustomerContact resource properties +type CustomerContact struct { + // REQUIRED; The email address used by Oracle to send notifications regarding databases and infrastructure. + Email *string +} + +// DNSPrivateView - DnsPrivateView resource definition +type DNSPrivateView struct { + // The resource-specific properties for this resource. + Properties *DNSPrivateViewProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// DNSPrivateViewListResult - The response of a DnsPrivateView list operation. +type DNSPrivateViewListResult struct { + // REQUIRED; The DnsPrivateView items on this page + Value []*DNSPrivateView + + // The link to the next page of items + NextLink *string +} + +// DNSPrivateViewProperties - Views resource model +type DNSPrivateViewProperties struct { + // REQUIRED; The display name of the view resource DisplayName *string - // REQUIRED; The model name of the cloud Exadata infrastructure resource. - Shape *string + // REQUIRED; A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + IsProtected *bool - // The number of compute servers for the cloud Exadata infrastructure. - ComputeCount *int32 + // REQUIRED; Views lifecycleState + LifecycleState *DNSPrivateViewsLifecycleState - // The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. - // Oracle uses these email addresses to send notifications about planned and - // unplanned software maintenance updates, information about system hardware, and other information needed by administrators. - // Up to 10 email addresses can be added to the customer contacts for a cloud - // Exadata infrastructure instance. - CustomerContacts []*CustomerContact + // REQUIRED; The OCID of the view + Ocid *string - // maintenanceWindow property - MaintenanceWindow *MaintenanceWindow + // REQUIRED; The canonical absolute URL of the resource. + Self *string - // The number of storage servers for the cloud Exadata infrastructure. - StorageCount *int32 + // REQUIRED; views timeCreated + TimeCreated *time.Time - // READ-ONLY; The requested number of additional storage servers activated for the Exadata infrastructure. - ActivatedStorageCount *int32 + // REQUIRED; views timeCreated + TimeUpdated *time.Time - // READ-ONLY; The requested number of additional storage servers for the Exadata infrastructure. - AdditionalStorageCount *int32 + // READ-ONLY; Azure resource provisioning state. + ProvisioningState *ResourceProvisioningState +} - // READ-ONLY; The available storage can be allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). - AvailableStorageSizeInGbs *int32 +// DNSPrivateZone - DnsPrivateZone resource definition +type DNSPrivateZone struct { + // The resource-specific properties for this resource. + Properties *DNSPrivateZoneProperties - // READ-ONLY; The total number of CPU cores allocated. - CPUCount *int32 + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string - // READ-ONLY; The quantity of data in the database, in terabytes. - DataStorageSizeInTbs *float64 + // READ-ONLY; The name of the resource + Name *string - // READ-ONLY; The local node storage to be allocated in GBs. - DbNodeStorageSizeInGbs *int32 + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData - // READ-ONLY; The software version of the database servers (dom0) in the Exadata infrastructure. - DbServerVersion *string + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} - // READ-ONLY; The estimated total time required in minutes for all patching operations (database server, storage server, and - // network switch patching). - EstimatedPatchingTime *EstimatedPatchingTime +// DNSPrivateZoneListResult - The response of a DnsPrivateZone list operation. +type DNSPrivateZoneListResult struct { + // REQUIRED; The DnsPrivateZone items on this page + Value []*DNSPrivateZone - // READ-ONLY; The OCID of the last maintenance run. - LastMaintenanceRunID *string + // The link to the next page of items + NextLink *string +} - // READ-ONLY; Additional information about the current lifecycle state. - LifecycleDetails *string +// DNSPrivateZoneProperties - Zones resource model +type DNSPrivateZoneProperties struct { + // REQUIRED; A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + IsProtected *bool - // READ-ONLY; CloudExadataInfrastructure lifecycle state - LifecycleState *CloudExadataInfrastructureLifecycleState + // REQUIRED; Zones lifecycleState + LifecycleState *DNSPrivateZonesLifecycleState - // READ-ONLY; The total number of CPU cores available. - MaxCPUCount *int32 + // REQUIRED; The OCID of the Zone + Ocid *string - // READ-ONLY; The total available DATA disk group size. - MaxDataStorageInTbs *float64 + // REQUIRED; The canonical absolute URL of the resource. + Self *string - // READ-ONLY; The total local node storage available in GBs. - MaxDbNodeStorageSizeInGbs *int32 + // REQUIRED; The current serial of the zone. As seen in the zone's SOA record. + Serial *int32 - // READ-ONLY; The total memory available in GBs. - MaxMemoryInGbs *int32 + // REQUIRED; Zones timeCreated + TimeCreated *time.Time - // READ-ONLY; The memory allocated in GBs. - MemorySizeInGbs *int32 + // REQUIRED; Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's + // SOA record is derived. + Version *string - // READ-ONLY; Monthly Db Server version - MonthlyDbServerVersion *string + // REQUIRED; The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. + ZoneType *ZoneType - // READ-ONLY; Monthly Storage Server version - MonthlyStorageServerVersion *string + // The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which are publicly + // resolvable and not part of a private view. + ViewID *string - // READ-ONLY; The OCID of the next maintenance run. - NextMaintenanceRunID *string + // READ-ONLY; Azure resource provisioning state. + ProvisioningState *ResourceProvisioningState +} - // READ-ONLY; HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - OciURL *string +// DataCollectionOptions resource properties +type DataCollectionOptions struct { + // Indicates whether diagnostic collection is enabled for the VM cluster/Cloud VM cluster/VMBM DBCS. + IsDiagnosticsEventsEnabled *bool + + // Indicates whether health monitoring is enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + IsHealthMonitoringEnabled *bool + + // Indicates whether incident logs and trace collection are enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + IsIncidentLogsEnabled *bool +} + +// DayOfWeek resource properties +type DayOfWeek struct { + // REQUIRED; Name of the day of the week. + Name *DayOfWeekName +} + +// DayOfWeekUpdate - DayOfWeek resource properties +type DayOfWeekUpdate struct { + // Name of the day of the week. + Name *DayOfWeekName +} + +// DbActionResponse - ExascaleDbNode action response +type DbActionResponse struct { + // READ-ONLY; ExascaleDbNode provisioning state + ProvisioningState *AzureResourceProvisioningState +} + +// DbIormConfig for cloud vm cluster +type DbIormConfig struct { + // The database name. For the default DbPlan, the dbName is default. + DbName *string + + // The flash cache limit for this database. This value is internally configured based on the share value assigned to the database. + FlashCacheLimit *string + + // The relative priority of this database. + Share *int32 +} + +// DbNode - The DbNode resource belonging to vmCluster +type DbNode struct { + // The resource-specific properties for this resource. + Properties *DbNodeProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// DbNodeAction - DbNode action object +type DbNodeAction struct { + // REQUIRED; Db action + Action *DbNodeActionEnum +} + +// DbNodeDetails - Details of the ExaCS Db node. Applies to Exadata Database Service on Exascale Infrastructure only. +type DbNodeDetails struct { + // REQUIRED; Exascale DbNode Azure Resource ID + DbNodeID *string +} + +// DbNodeListResult - The response of a DbNode list operation. +type DbNodeListResult struct { + // REQUIRED; The DbNode items on this page + Value []*DbNode + + // The link to the next page of items + NextLink *string +} + +// DbNodeProperties - The properties of DbNodeResource +type DbNodeProperties struct { + // REQUIRED; The OCID of the DB system. + DbSystemID *string + + // REQUIRED; The current state of the database node. + LifecycleState *DbNodeProvisioningState + + // REQUIRED; DbNode OCID + Ocid *string + + // REQUIRED; The date and time that the database node was created. + TimeCreated *time.Time + + // REQUIRED; The OCID of the VNIC. + VnicID *string + + // Additional information about the planned maintenance. + AdditionalDetails *string + + // The OCID of the backup IP address associated with the database node. + BackupIPID *string + + // The OCID of the second backup VNIC. + BackupVnic2ID *string + + // The OCID of the backup VNIC. + BackupVnicID *string - // READ-ONLY; Exadata infra ocid - Ocid *string + // The number of CPU cores enabled on the Db node. + CPUCoreCount *int32 - // READ-ONLY; CloudExadataInfrastructure provisioning state - ProvisioningState *AzureResourceProvisioningState + // The allocated local node storage in GBs on the Db node. + DbNodeStorageSizeInGbs *int32 - // READ-ONLY; The software version of the storage servers (cells) in the Exadata infrastructure. - StorageServerVersion *string + // The OCID of the Exacc Db server associated with the database node. + DbServerID *string - // READ-ONLY; The date and time the cloud Exadata infrastructure resource was created. - TimeCreated *string + // The name of the Fault Domain the instance is contained in. + FaultDomain *string - // READ-ONLY; The total storage allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). - TotalStorageSizeInGbs *int32 -} + // The OCID of the host IP address associated with the database node. + HostIPID *string -// CloudExadataInfrastructureUpdate - The type used for update operations of the CloudExadataInfrastructure. -type CloudExadataInfrastructureUpdate struct { - // The updatable properties of the CloudExadataInfrastructure. - Properties *CloudExadataInfrastructureUpdateProperties + // The host name for the database node. + Hostname *string - // Resource tags. - Tags map[string]*string + // Lifecycle details of Db Node. + LifecycleDetails *string - // CloudExadataInfrastructure zones - Zones []*string -} + // The type of database node maintenance. + MaintenanceType *DbNodeMaintenanceType -// CloudExadataInfrastructureUpdateProperties - The updatable properties of the CloudExadataInfrastructure. -type CloudExadataInfrastructureUpdateProperties struct { - // The number of compute servers for the cloud Exadata infrastructure. - ComputeCount *int32 + // The allocated memory in GBs on the Db node. + MemorySizeInGbs *int32 - // The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. - // Oracle uses these email addresses to send notifications about planned and - // unplanned software maintenance updates, information about system hardware, and other information needed by administrators. - // Up to 10 email addresses can be added to the customer contacts for a cloud - // Exadata infrastructure instance. - CustomerContacts []*CustomerContact + // The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine + // DB systems. + SoftwareStorageSizeInGb *int32 - // The name for the Exadata infrastructure. - DisplayName *string + // End date and time of maintenance window. + TimeMaintenanceWindowEnd *time.Time - // maintenanceWindow property - MaintenanceWindow *MaintenanceWindow + // Start date and time of maintenance window. + TimeMaintenanceWindowStart *time.Time - // The number of storage servers for the cloud Exadata infrastructure. - StorageCount *int32 -} + // The OCID of the second VNIC. + Vnic2ID *string -// CloudVMCluster - CloudVmCluster resource definition -type CloudVMCluster struct { - // REQUIRED; The geo-location where the resource lives - Location *string + // READ-ONLY; Azure resource provisioning state. + ProvisioningState *ResourceProvisioningState +} +// DbServer resource model +type DbServer struct { // The resource-specific properties for this resource. - Properties *CloudVMClusterProperties - - // Resource tags. - Tags map[string]*string + Properties *DbServerProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -1512,281 +2816,281 @@ type CloudVMCluster struct { Type *string } -// CloudVMClusterListResult - The response of a CloudVmCluster list operation. -type CloudVMClusterListResult struct { - // REQUIRED; The CloudVmCluster items on this page - Value []*CloudVMCluster +// DbServerListResult - The response of a DbServer list operation. +type DbServerListResult struct { + // REQUIRED; The DbServer items on this page + Value []*DbServer // The link to the next page of items NextLink *string } -// CloudVMClusterProperties - CloudVmCluster resource model -type CloudVMClusterProperties struct { - // REQUIRED; The number of CPU cores enabled on the cloud VM cluster. - CPUCoreCount *int32 - - // REQUIRED; Cloud Exadata Infrastructure ID - CloudExadataInfrastructureID *string - - // REQUIRED; Display Name - DisplayName *string - - // REQUIRED; Oracle Grid Infrastructure (GI) software version - GiVersion *string - - // REQUIRED; The hostname for the cloud VM cluster. - Hostname *string +// DbServerPatchingDetails - DbServer Patching Properties +type DbServerPatchingDetails struct { + // READ-ONLY; Estimated Patch Duration + EstimatedPatchDuration *int32 - // REQUIRED; The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. - SSHPublicKeys []*string + // READ-ONLY; Patching Status + PatchingStatus *DbServerPatchingStatus - // REQUIRED; Client subnet - SubnetID *string + // READ-ONLY; Time Patching Ended + TimePatchingEnded *time.Time - // REQUIRED; VNET for network connectivity - VnetID *string + // READ-ONLY; Time Patching Started + TimePatchingStarted *time.Time +} - // Client OCI backup subnet CIDR, default is 192.168.252.0/22 - BackupSubnetCidr *string +// DbServerProperties - DbServer resource properties +type DbServerProperties struct { + // READ-ONLY; The list of OCIDs of the Autonomous VM Clusters associated with the Db server. + AutonomousVMClusterIDs []*string - // The cluster name for cloud VM cluster. The cluster name must begin with an alphabetic character, and may contain hyphens - // (-). Underscores (_) are not permitted. The cluster name can be no longer than - // 11 characters and is not case sensitive. - ClusterName *string + // READ-ONLY; The list of OCIDs of the Autonomous Virtual Machines associated with the Db server. + AutonomousVirtualMachineIDs []*string - // The list of compute servers to be added to the cloud VM cluster. - ComputeNodes []*string + // READ-ONLY; The number of CPU cores enabled on the Db server. + CPUCoreCount *int32 - // Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. - DataCollectionOptions *DataCollectionOptions + // READ-ONLY; The OCID of the compartment. + CompartmentID *string - // The percentage assigned to DATA storage (user data and database files). The remaining percentage is assigned to RECO storage - // (database redo logs, archive logs, and recovery manager backups). Accepted - // values are 35, 40, 60 and 80. The default is 80 percent assigned to DATA storage. See Storage Configuration [/Content/Database/Concepts/exaoverview.htm#Exadata] - // in the Exadata documentation for - // details on the impact of the configuration settings on storage. - DataStoragePercentage *int32 + // READ-ONLY; The compute model of the Exadata Infrastructure + ComputeModel *ComputeModel - // The data disk group size to be allocated in TBs. - DataStorageSizeInTbs *float64 + // READ-ONLY; The OCID of the Db nodes associated with the Db server. + DbNodeIDs []*string - // The local node storage to be allocated in GBs. + // READ-ONLY; The allocated local node storage in GBs on the Db server. DbNodeStorageSizeInGbs *int32 - // The list of DB servers. - DbServers []*string - - // The domain name for the cloud VM cluster. - Domain *string - - // If true, database backup on local Exadata storage is configured for the cloud VM cluster. If false, database backup on - // local Exadata storage is not available in the cloud VM cluster. - IsLocalBackupEnabled *bool - - // If true, sparse disk group is configured for the cloud VM cluster. If false, sparse disk group is not created. - IsSparseDiskgroupEnabled *bool - - // The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. - LicenseModel *LicenseModel - - // The memory to be allocated in GBs. - MemorySizeInGbs *int32 - - // CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. - NsgCidrs []*NsgCidr - - // The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. - OcpuCount *float32 + // READ-ONLY; dbServerPatching details of the Db server. + DbServerPatchingDetails *DbServerPatchingDetails - // The TCP Single Client Access Name (SCAN) port. The default port is 1521. - ScanListenerPortTCP *int32 + // READ-ONLY; The name for the Db Server. + DisplayName *string - // The TCPS Single Client Access Name (SCAN) port. The default port is 2484. - ScanListenerPortTCPSSL *int32 + // READ-ONLY; The OCID of the Exadata infrastructure. + ExadataInfrastructureID *string - // The data disk group size to be allocated in GBs per VM. - StorageSizeInGbs *int32 + // READ-ONLY; Lifecycle details of dbServer. + LifecycleDetails *string - // Operating system version of the image. - SystemVersion *string + // READ-ONLY; DbServer provisioning state. + LifecycleState *DbServerProvisioningState - // The time zone of the cloud VM cluster. For details, see Exadata Infrastructure Time Zones [/Content/Database/References/timezones.htm]. - TimeZone *string + // READ-ONLY; The total number of CPU cores available. + MaxCPUCount *int32 - // The OCID of the zone the cloud VM cluster is associated with. - ZoneID *string + // READ-ONLY; The total max dbNode storage in GBs. + MaxDbNodeStorageInGbs *int32 - // READ-ONLY; Cluster compartmentId - CompartmentID *string + // READ-ONLY; The total memory available in GBs. + MaxMemoryInGbs *int32 - // READ-ONLY; The type of redundancy configured for the cloud Vm cluster. NORMAL is 2-way redundancy. HIGH is 3-way redundancy. - DiskRedundancy *DiskRedundancy + // READ-ONLY; The total memory size in GBs. + MemorySizeInGbs *int32 - // READ-ONLY; iormConfigCache details for cloud VM cluster. - IormConfigCache *ExadataIormConfig + // READ-ONLY; Db server name. + Ocid *string - // READ-ONLY; The OCID of the last maintenance update history entry. - LastUpdateHistoryEntryID *string + // READ-ONLY; Azure resource provisioning state. + ProvisioningState *ResourceProvisioningState - // READ-ONLY; Additional information about the current lifecycle state. - LifecycleDetails *string + // READ-ONLY; The shape of the Db server. The shape determines the amount of CPU, storage, and memory resources available. + Shape *string - // READ-ONLY; CloudVmCluster lifecycle state - LifecycleState *CloudVMClusterLifecycleState + // READ-ONLY; The date and time that the Db Server was created. + TimeCreated *time.Time - // READ-ONLY; The port number configured for the listener on the cloud VM cluster. - ListenerPort *int64 + // READ-ONLY; The OCID of the VM Clusters associated with the Db server. + VMClusterIDs []*string +} - // READ-ONLY; The number of nodes in the cloud VM cluster. - NodeCount *int32 +// DbSystemShape resource definition +type DbSystemShape struct { + // The resource-specific properties for this resource. + Properties *DbSystemShapeProperties - // READ-ONLY; HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. - NsgURL *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string - // READ-ONLY; HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - OciURL *string + // READ-ONLY; The name of the resource + Name *string - // READ-ONLY; Cloud VM Cluster ocid - Ocid *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData - // READ-ONLY; CloudVmCluster provisioning state - ProvisioningState *AzureResourceProvisioningState + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} - // READ-ONLY; The FQDN of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. - ScanDNSName *string +// DbSystemShapeListResult - The response of a DbSystemShape list operation. +type DbSystemShapeListResult struct { + // REQUIRED; The DbSystemShape items on this page + Value []*DbSystemShape - // READ-ONLY; The OCID of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. - ScanDNSRecordID *string + // The link to the next page of items + NextLink *string +} - // READ-ONLY; The Single Client Access Name (SCAN) IP addresses associated with the cloud VM cluster. SCAN IP addresses are - // typically used for load balancing and are not assigned to any interface. Oracle - // Clusterware directs the requests to the appropriate nodes in the cluster. Note: For a single-node DB system, this list - // is empty. - ScanIPIDs []*string +// DbSystemShapeProperties - DbSystemShape resource model +type DbSystemShapeProperties struct { + // REQUIRED; The maximum number of CPU cores that can be enabled on the DB system for this shape. + AvailableCoreCount *int32 - // READ-ONLY; The model name of the Exadata hardware running the cloud VM cluster. - Shape *string + // REQUIRED; The shape used for the DB system. + ShapeName *string - // READ-ONLY; Cluster subnet ocid - SubnetOcid *string + // Indicates if the shape supports database and storage server types + AreServerTypesSupported *bool - // READ-ONLY; The date and time that the cloud VM cluster was created. - TimeCreated *time.Time + // The maximum number of CPU cores per database node that can be enabled for this shape. Only applicable to the flex Exadata + // shape and ExaCC Elastic shapes. + AvailableCoreCountPerNode *int32 - // READ-ONLY; The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster Ready Services (CRS) creates - // and maintains one VIP address for each node in the Exadata Cloud Service instance to - // enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. Note: For a single-node - // DB system, this list is empty. - VipIDs []*string -} + // The maximum DATA storage that can be enabled for this shape. + AvailableDataStorageInTbs *int32 -// CloudVMClusterUpdate - The type used for update operations of the CloudVmCluster. -type CloudVMClusterUpdate struct { - // The updatable properties of the CloudVmCluster. - Properties *CloudVMClusterUpdateProperties + // The maximum data storage available per storage server for this shape. Only applicable to ExaCC Elastic shapes. + AvailableDataStoragePerServerInTbs *float64 - // Resource tags. - Tags map[string]*string -} + // The maximum Db Node storage available per database node for this shape. Only applicable to ExaCC Elastic shapes. + AvailableDbNodePerNodeInGbs *int32 -// CloudVMClusterUpdateProperties - The updatable properties of the CloudVmCluster. -type CloudVMClusterUpdateProperties struct { - // The number of CPU cores enabled on the cloud VM cluster. - CPUCoreCount *int32 + // The maximum Db Node storage that can be enabled for this shape. + AvailableDbNodeStorageInGbs *int32 - // The list of compute servers to be added to the cloud VM cluster. - ComputeNodes []*string + // The maximum memory that can be enabled for this shape. + AvailableMemoryInGbs *int32 - // Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. - DataCollectionOptions *DataCollectionOptions + // The maximum memory available per database node for this shape. Only applicable to ExaCC Elastic shapes. + AvailableMemoryPerNodeInGbs *int32 - // The data disk group size to be allocated in TBs. - DataStorageSizeInTbs *float64 + // The compute model of the Exadata Infrastructure + ComputeModel *ComputeModel - // The local node storage to be allocated in GBs. - DbNodeStorageSizeInGbs *int32 + // The discrete number by which the CPU core count for this shape can be increased or decreased. + CoreCountIncrement *int32 - // Display Name + // The display name of the shape used for the DB system DisplayName *string - // The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. - LicenseModel *LicenseModel + // The maximum number of Exadata storage servers available for the Exadata infrastructure. + MaxStorageCount *int32 - // The memory to be allocated in GBs. - MemorySizeInGbs *int32 + // The maximum number of database nodes available for this shape. + MaximumNodeCount *int32 - // The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. - OcpuCount *float32 + // The minimum number of CPU cores that can be enabled per node for this shape. + MinCoreCountPerNode *int32 - // The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. - SSHPublicKeys []*string + // The minimum data storage that need be allocated for this shape. + MinDataStorageInTbs *int32 - // The data disk group size to be allocated in GBs per VM. - StorageSizeInGbs *int32 -} + // The minimum Db Node storage that need be allocated per node for this shape. + MinDbNodeStoragePerNodeInGbs *int32 -// ConnectionStringType - Connection strings to connect to an Oracle Autonomous Database. -type ConnectionStringType struct { - // Returns all connection strings that can be used to connect to the Autonomous Database. - AllConnectionStrings *AllConnectionStringType + // The minimum memory that need be allocated per node for this shape. + MinMemoryPerNodeInGbs *int32 - // The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent - // SQL statements. - Dedicated *string + // The minimum number of Exadata storage servers available for the Exadata infrastructure. + MinStorageCount *int32 - // The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, - // but supports the fewest number of concurrent SQL statements. - High *string + // The minimum number of CPU cores that can be enabled on the DB system for this shape. + MinimumCoreCount *int32 - // The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent - // SQL statements. - Low *string + // The minimum number of database nodes available for this shape. + MinimumNodeCount *int32 - // The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level - // of performance, but supports more concurrent SQL statements. - Medium *string + // The runtime minimum number of CPU cores that can be enabled on the DB system for this shape. + RuntimeMinimumCoreCount *int32 - // A list of connection string profiles to allow clients to group, filter and select connection string values based on structured - // metadata. - Profiles []*ProfileType + // The family of the shape used for the DB system. + ShapeFamily *string } -// ConnectionURLType - The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from -// a Compute instance within your VCN or that has a direct connection to your VCN. -type ConnectionURLType struct { - // Oracle Application Express (APEX) URL. - ApexURL *string +// DefinedFileSystemConfiguration - Predefined configurations for the file system +type DefinedFileSystemConfiguration struct { + // Checks if the data can be backed up + IsBackupPartition *bool - // The URL of the Database Transforms for the Autonomous Database. - DatabaseTransformsURL *string + // Checks if the mount path is resizable + IsResizable *bool - // The URL of the Graph Studio for the Autonomous Database. - GraphStudioURL *string + // Minimum size of mount path in Gb + MinSizeGb *int32 - // The URL of the Oracle Machine Learning (OML) Notebook for the Autonomous Database. - MachineLearningNotebookURL *string + // Mount path for the file system + MountPoint *string +} - // The URL of the MongoDB API for the Autonomous Database. - MongoDbURL *string +// DisasterRecoveryConfigurationDetails - Configurations of a Disaster Recovery Details +type DisasterRecoveryConfigurationDetails struct { + // Indicates the disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR + // type provides business critical DR with a faster recovery time objective (RTO) + // during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + DisasterRecoveryType *DisasterRecoveryType + + // If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary + // and Standby. If false, the backups taken on the Primary are not replicated to the + // Standby database. + IsReplicateAutomaticBackups *bool + + // Indicates if user wants to convert to a snapshot standby. For example, true would set a standby database to snapshot standby + // database. False would set a snapshot standby database back to regular + // standby database. + IsSnapshotStandby *bool + + // Time and date stored as an RFC 3339 formatted timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit + // for the snapshot standby to be converted back to a cross-region standby + // database. + TimeSnapshotStandbyEnabledTill *time.Time +} - // The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous Database. - OrdsURL *string +// EstimatedPatchingTime - The estimated total time required in minutes for all patching operations (database server, storage +// server, and network switch patching). +type EstimatedPatchingTime struct { + // READ-ONLY; The estimated time required in minutes for database server patching. + EstimatedDbServerPatchingTime *int32 - // Oracle SQL Developer Web URL. - SQLDevWebURL *string + // READ-ONLY; The estimated time required in minutes for network switch patching. + EstimatedNetworkSwitchesPatchingTime *int32 + + // READ-ONLY; The estimated time required in minutes for storage server patching. + EstimatedStorageServerPatchingTime *int32 + + // READ-ONLY; The estimated total time required in minutes for all patching operations. + TotalEstimatedPatchingTime *int32 } -// CustomerContact resource properties -type CustomerContact struct { - // REQUIRED; The email address used by Oracle to send notifications regarding databases and infrastructure. - Email *string +// ExadataIormConfig for cloud vm cluster +type ExadataIormConfig struct { + // An array of IORM settings for all the database in the Exadata DB system. + DbPlans []*DbIormConfig + + // Additional information about the current lifecycleState. + LifecycleDetails *string + + // The current state of IORM configuration for the Exadata DB system. + LifecycleState *IormLifecycleState + + // The current value for the IORM objective. The default is AUTO. + Objective *Objective } -// DNSPrivateView - DnsPrivateView resource definition -type DNSPrivateView struct { +// ExadbVMCluster - ExadbVmCluster resource definition +type ExadbVMCluster struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // The resource-specific properties for this resource. - Properties *DNSPrivateViewProperties + Properties *ExadbVMClusterProperties + + // Resource tags. + Tags map[string]*string + + // The availability zones. + Zones []*string // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -1801,144 +3105,186 @@ type DNSPrivateView struct { Type *string } -// DNSPrivateViewListResult - The response of a DnsPrivateView list operation. -type DNSPrivateViewListResult struct { - // REQUIRED; The DnsPrivateView items on this page - Value []*DNSPrivateView +// ExadbVMClusterListResult - The response of a ExadbVmCluster list operation. +type ExadbVMClusterListResult struct { + // REQUIRED; The ExadbVmCluster items on this page + Value []*ExadbVMCluster // The link to the next page of items NextLink *string } -// DNSPrivateViewProperties - Views resource model -type DNSPrivateViewProperties struct { - // READ-ONLY; A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. - IsProtected *bool +// ExadbVMClusterProperties - ExadbVmCluster resource model +type ExadbVMClusterProperties struct { + // REQUIRED; Display Name + DisplayName *string - // READ-ONLY; The OCID of the view - Ocid *string + // REQUIRED; The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + EnabledEcpuCount *int32 - // READ-ONLY; The canonical absolute URL of the resource. - Self *string + // REQUIRED; The Azure Resource ID of the Exadata Database Storage Vault. + ExascaleDbStorageVaultID *string - // READ-ONLY; views timeCreated - TimeCreated *time.Time + // REQUIRED; The hostname for the Exadata VM cluster on Exascale Infrastructure. + Hostname *string - // READ-ONLY; views timeCreated - TimeUpdated *time.Time + // REQUIRED; The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + NodeCount *int32 - // READ-ONLY; The display name of the view resource - DisplayName *string + // REQUIRED; The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + SSHPublicKeys []*string - // READ-ONLY; Views lifecycleState - LifecycleState *DNSPrivateViewsLifecycleState + // REQUIRED; The shape of the Exadata VM cluster on Exascale Infrastructure resource + Shape *string - // READ-ONLY; Azure resource provisioning state. - ProvisioningState *ResourceProvisioningState -} + // REQUIRED; Client subnet + SubnetID *string -// DNSPrivateZone - DnsPrivateZone resource definition -type DNSPrivateZone struct { - // The resource-specific properties for this resource. - Properties *DNSPrivateZoneProperties + // REQUIRED; The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + TotalEcpuCount *int32 - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string + // REQUIRED; Filesystem storage details. + VMFileSystemStorage *ExadbVMClusterStorageDetails - // READ-ONLY; The name of the resource - Name *string + // REQUIRED; VNET for network connectivity + VnetID *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData + // Client OCI backup subnet CIDR, default is 192.168.252.0/22 + BackupSubnetCidr *string - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin with an alphabetic character, + // and may contain hyphens (-). Underscores (_) are not permitted. The + // cluster name can be no longer than 11 characters and is not case sensitive. + ClusterName *string -// DNSPrivateZoneListResult - The response of a DnsPrivateZone list operation. -type DNSPrivateZoneListResult struct { - // REQUIRED; The DnsPrivateZone items on this page - Value []*DNSPrivateZone + // Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + DataCollectionOptions *DataCollectionOptions - // The link to the next page of items - NextLink *string -} + // A domain name used for the Exadata VM cluster on Exascale Infrastructure + Domain *string -// DNSPrivateZoneProperties - Zones resource model -type DNSPrivateZoneProperties struct { - // READ-ONLY; A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. - IsProtected *bool + // Grid Setup will be done using this Grid Image OCID. Can be obtained using giMinorVersions API + GridImageOcid *string - // READ-ONLY; The OCID of the Zone - Ocid *string + // The Oracle license model that applies to the Exadata VM cluster on Exascale Infrastructure. The default is LICENSE_INCLUDED. + LicenseModel *LicenseModel - // READ-ONLY; The canonical absolute URL of the resource. - Self *string + // CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + NsgCidrs []*NsgCidr - // READ-ONLY; The current serial of the zone. As seen in the zone's SOA record. - Serial *int32 + // The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + PrivateZoneOcid *string - // READ-ONLY; Zones timeCreated - TimeCreated *time.Time + // The TCP Single Client Access Name (SCAN) port. The default port is 1521. + ScanListenerPortTCP *int32 - // READ-ONLY; Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's - // SOA record is derived. - Version *string + // The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + ScanListenerPortTCPSSL *int32 - // READ-ONLY; The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. - ZoneType *ZoneType + // Operating system version of the image. + SystemVersion *string - // READ-ONLY; Zones lifecycleState - LifecycleState *DNSPrivateZonesLifecycleState + // The time zone of the Exadata VM cluster on Exascale Infrastructure. For details, see Exadata Infrastructure Time Zones + // [/Content/Database/References/timezones.htm]. + TimeZone *string - // READ-ONLY; Azure resource provisioning state. - ProvisioningState *ResourceProvisioningState + // READ-ONLY; Cluster backup subnet ocid + BackupSubnetOcid *string - // READ-ONLY; The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which - // are publicly resolvable and not part of a private view. - ViewID *string -} + // READ-ONLY; Oracle Grid Infrastructure (GI) software version + GiVersion *string -// DataCollectionOptions resource properties -type DataCollectionOptions struct { - // Indicates whether diagnostic collection is enabled for the VM cluster/Cloud VM cluster/VMBM DBCS. - IsDiagnosticsEventsEnabled *bool + // READ-ONLY; The type of Grid Image + GridImageType *GridImageType + + // READ-ONLY; iormConfigCache details for Exadata VM cluster on Exascale Infrastructure. + IormConfigCache *ExadataIormConfig + + // READ-ONLY; Additional information about the current lifecycle state. + LifecycleDetails *string + + // READ-ONLY; CloudVmCluster lifecycle state + LifecycleState *ExadbVMClusterLifecycleState + + // READ-ONLY; The port number configured for the listener on the Exadata VM cluster on Exascale Infrastructure. + ListenerPort *int32 + + // READ-ONLY; The memory that you want to be allocated in GBs. Memory is calculated based on 11 GB per VM core reserved. + MemorySizeInGbs *int32 + + // READ-ONLY; HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + NsgURL *string + + // READ-ONLY; HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + OciURL *string + + // READ-ONLY; ExadbVmCluster ocid + Ocid *string + + // READ-ONLY; Exadata VM cluster on Exascale Infrastructure provisioning state + ProvisioningState *AzureResourceProvisioningState + + // READ-ONLY; The FQDN of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale + // Infrastructure. + ScanDNSName *string + + // READ-ONLY; The OCID of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale + // Infrastructure. + ScanDNSRecordID *string + + // READ-ONLY; The Single Client Access Name (SCAN) IP addresses associated with the Exadata VM cluster on Exascale Infrastructure. + // SCAN IP addresses are typically used for load balancing and are not assigned to any + // interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. Note: For a single-node DB + // system, this list is empty. + ScanIPIDs []*string + + // READ-ONLY; Snapshot filesystem storage details. + SnapshotFileSystemStorage *ExadbVMClusterStorageDetails + + // READ-ONLY; Cluster subnet ocid + SubnetOcid *string - // Indicates whether health monitoring is enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. - IsHealthMonitoringEnabled *bool + // READ-ONLY; Total file system storage details. + TotalFileSystemStorage *ExadbVMClusterStorageDetails - // Indicates whether incident logs and trace collection are enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. - IsIncidentLogsEnabled *bool -} + // READ-ONLY; The virtual IP (VIP) addresses associated with the Exadata VM cluster on Exascale Infrastructure. The Cluster + // Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata + // Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. + // Note: For a single-node DB system, this list is empty. + VipIDs []*string -// DayOfWeek resource properties -type DayOfWeek struct { - // REQUIRED; Name of the day of the week. - Name *DayOfWeekName + // READ-ONLY; The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + ZoneOcid *string } -// DayOfWeekUpdate - DayOfWeek resource properties -type DayOfWeekUpdate struct { - // Name of the day of the week. - Name *DayOfWeekName +// ExadbVMClusterStorageDetails - Storage Details on the Exadata VM cluster. +type ExadbVMClusterStorageDetails struct { + // REQUIRED; Total Capacity + TotalSizeInGbs *int32 } -// DbIormConfig for cloud vm cluster -type DbIormConfig struct { - // The database name. For the default DbPlan, the dbName is default. - DbName *string +// ExadbVMClusterUpdate - The type used for update operations of the ExadbVmCluster. +type ExadbVMClusterUpdate struct { + // The resource-specific properties for this resource. + Properties *ExadbVMClusterUpdateProperties - // The flash cache limit for this database. This value is internally configured based on the share value assigned to the database. - FlashCacheLimit *string + // Resource tags. + Tags map[string]*string - // The relative priority of this database. - Share *int32 + // The availability zones. + Zones []*string } -// DbNode - The DbNode resource belonging to vmCluster -type DbNode struct { +// ExadbVMClusterUpdateProperties - The updatable properties of the ExadbVmCluster. +type ExadbVMClusterUpdateProperties struct { + // The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + NodeCount *int32 +} + +// ExascaleDbNode - The DbNode resource belonging to ExadbVmCluster +type ExascaleDbNode struct { // The resource-specific properties for this resource. - Properties *DbNodeProperties + Properties *ExascaleDbNodeProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -1953,98 +3299,86 @@ type DbNode struct { Type *string } -// DbNodeAction - DbNode action object -type DbNodeAction struct { - // REQUIRED; Db action - Action *DbNodeActionEnum -} - -// DbNodeListResult - The response of a DbNode list operation. -type DbNodeListResult struct { - // REQUIRED; The DbNode items on this page - Value []*DbNode +// ExascaleDbNodeListResult - The response of a ExascaleDbNode list operation. +type ExascaleDbNodeListResult struct { + // REQUIRED; The ExascaleDbNode items on this page + Value []*ExascaleDbNode // The link to the next page of items NextLink *string } -// DbNodeProperties - The properties of DbNodeResource -type DbNodeProperties struct { - // READ-ONLY; The OCID of the DB system. - DbSystemID *string - - // READ-ONLY; DbNode OCID +// ExascaleDbNodeProperties - The properties of DbNodeResource +type ExascaleDbNodeProperties struct { + // REQUIRED; DbNode OCID Ocid *string - // READ-ONLY; Additional information about the planned maintenance. + // Additional information about the planned maintenance. AdditionalDetails *string - // READ-ONLY; The OCID of the backup IP address associated with the database node. - BackupIPID *string - - // READ-ONLY; The OCID of the second backup VNIC. - BackupVnic2ID *string - - // READ-ONLY; The OCID of the backup VNIC. - BackupVnicID *string - - // READ-ONLY; The number of CPU cores enabled on the Db node. + // The number of CPU cores enabled on the Db node. CPUCoreCount *int32 - // READ-ONLY; The allocated local node storage in GBs on the Db node. + // The allocated local node storage in GBs on the Db node. DbNodeStorageSizeInGbs *int32 - // READ-ONLY; The OCID of the Exacc Db server associated with the database node. - DbServerID *string - - // READ-ONLY; The name of the Fault Domain the instance is contained in. + // The name of the Fault Domain the instance is contained in. FaultDomain *string - // READ-ONLY; The OCID of the host IP address associated with the database node. - HostIPID *string - - // READ-ONLY; The host name for the database node. + // The host name for the database node. Hostname *string - // READ-ONLY; Lifecycle details of Db Node. - LifecycleDetails *string - - // READ-ONLY; The current state of the database node. + // The current state of the database node. LifecycleState *DbNodeProvisioningState - // READ-ONLY; The type of database node maintenance. - MaintenanceType *DbNodeMaintenanceType + // The type of database node maintenance. + MaintenanceType *string - // READ-ONLY; The allocated memory in GBs on the Db node. + // The allocated memory in GBs on the Db node. MemorySizeInGbs *int32 - // READ-ONLY; Azure resource provisioning state. - ProvisioningState *ResourceProvisioningState - - // READ-ONLY; The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual - // machine DB systems. + // The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine + // DB systems. SoftwareStorageSizeInGb *int32 - // READ-ONLY; The date and time that the database node was created. - TimeCreated *time.Time - - // READ-ONLY; End date and time of maintenance window. + // End date and time of maintenance window. TimeMaintenanceWindowEnd *time.Time - // READ-ONLY; Start date and time of maintenance window. + // Start date and time of maintenance window. TimeMaintenanceWindowStart *time.Time - // READ-ONLY; The OCID of the second VNIC. - Vnic2ID *string + // The total number of CPU cores reserved on the Db node. + TotalCPUCoreCount *int32 +} - // READ-ONLY; The OCID of the VNIC. - VnicID *string +// ExascaleDbStorageDetails - Exadata Database Storage Details +type ExascaleDbStorageDetails struct { + // Available Capacity + AvailableSizeInGbs *int32 + + // Total Capacity + TotalSizeInGbs *int32 } -// DbServer resource model -type DbServer struct { +// ExascaleDbStorageInputDetails - Create exadata Database Storage Details model +type ExascaleDbStorageInputDetails struct { + // REQUIRED; Total Capacity + TotalSizeInGbs *int32 +} + +// ExascaleDbStorageVault resource definition +type ExascaleDbStorageVault struct { + // REQUIRED; The geo-location where the resource lives + Location *string + // The resource-specific properties for this resource. - Properties *DbServerProperties + Properties *ExascaleDbStorageVaultProperties + + // Resource tags. + Tags map[string]*string + + // The availability zones. + Zones []*string // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -2059,97 +3393,73 @@ type DbServer struct { Type *string } -// DbServerListResult - The response of a DbServer list operation. -type DbServerListResult struct { - // REQUIRED; The DbServer items on this page - Value []*DbServer +// ExascaleDbStorageVaultListResult - The response of a ExascaleDbStorageVault list operation. +type ExascaleDbStorageVaultListResult struct { + // REQUIRED; The ExascaleDbStorageVault items on this page + Value []*ExascaleDbStorageVault // The link to the next page of items NextLink *string } -// DbServerPatchingDetails - DbServer Patching Properties -type DbServerPatchingDetails struct { - // READ-ONLY; Estimated Patch Duration - EstimatedPatchDuration *int32 - - // READ-ONLY; Patching Status - PatchingStatus *DbServerPatchingStatus - - // READ-ONLY; Time Patching Ended - TimePatchingEnded *time.Time - - // READ-ONLY; Time Patching Started - TimePatchingStarted *time.Time -} - -// DbServerProperties - DbServer resource properties -type DbServerProperties struct { - // READ-ONLY; The list of OCIDs of the Autonomous VM Clusters associated with the Db server. - AutonomousVMClusterIDs []*string - - // READ-ONLY; The list of OCIDs of the Autonomous Virtual Machines associated with the Db server. - AutonomousVirtualMachineIDs []*string - - // READ-ONLY; The number of CPU cores enabled on the Db server. - CPUCoreCount *int32 - - // READ-ONLY; The OCID of the compartment. - CompartmentID *string +// ExascaleDbStorageVaultProperties - ExascaleDbStorageVault resource model +type ExascaleDbStorageVaultProperties struct { + // REQUIRED; The user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + DisplayName *string - // READ-ONLY; The OCID of the Db nodes associated with the Db server. - DbNodeIDs []*string + // REQUIRED; Create exadata Database Storage Details + HighCapacityDatabaseStorageInput *ExascaleDbStorageInputDetails - // READ-ONLY; The allocated local node storage in GBs on the Db server. - DbNodeStorageSizeInGbs *int32 + // The size of additional Flash Cache in percentage of High Capacity database storage. + AdditionalFlashCacheInPercent *int32 - // READ-ONLY; dbServerPatching details of the Db server. - DbServerPatchingDetails *DbServerPatchingDetails + // Exadata Database Storage Vault description. + Description *string - // READ-ONLY; The name for the Db Server. - DisplayName *string + // The time zone that you want to use for the Exadata Database Storage Vault + TimeZone *string - // READ-ONLY; The OCID of the Exadata infrastructure. - ExadataInfrastructureID *string + // READ-ONLY; Response exadata Database Storage Details + HighCapacityDatabaseStorage *ExascaleDbStorageDetails - // READ-ONLY; Lifecycle details of dbServer. + // READ-ONLY; Additional information about the current lifecycle state. LifecycleDetails *string - // READ-ONLY; DbServer provisioning state. - LifecycleState *DbServerProvisioningState - - // READ-ONLY; The total number of CPU cores available. - MaxCPUCount *int32 - - // READ-ONLY; The total max dbNode storage in GBs. - MaxDbNodeStorageInGbs *int32 - - // READ-ONLY; The total memory available in GBs. - MaxMemoryInGbs *int32 + // READ-ONLY; Exadata Database Storage Vault lifecycle state + LifecycleState *ExascaleDbStorageVaultLifecycleState - // READ-ONLY; The total memory size in GBs. - MemorySizeInGbs *int32 + // READ-ONLY; HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + OciURL *string - // READ-ONLY; Db server name. + // READ-ONLY; The OCID of the Exadata Database Storage Vault. Ocid *string - // READ-ONLY; Azure resource provisioning state. - ProvisioningState *ResourceProvisioningState + // READ-ONLY; Exadata Database Storage Vault provisioning state + ProvisioningState *AzureResourceProvisioningState - // READ-ONLY; The shape of the Db server. The shape determines the amount of CPU, storage, and memory resources available. - Shape *string + // READ-ONLY; The number of Exadata VM clusters used the Exadata Database Storage Vault. + VMClusterCount *int32 +} - // READ-ONLY; The date and time that the Db Server was created. - TimeCreated *time.Time +// ExascaleDbStorageVaultTagsUpdate - The type used for updating tags in ExascaleDbStorageVault resources. +type ExascaleDbStorageVaultTagsUpdate struct { + // Resource tags. + Tags map[string]*string +} - // READ-ONLY; The OCID of the VM Clusters associated with the Db server. - VMClusterIDs []*string +// FileSystemConfigurationDetails - File configuration options +type FileSystemConfigurationDetails struct { + // Size of the VM + FileSystemSizeGb *int32 + + // Mount path + MountPoint *string } -// DbSystemShape resource definition -type DbSystemShape struct { +// FlexComponent Resource Definition +type FlexComponent struct { // The resource-specific properties for this resource. - Properties *DbSystemShapeProperties + Properties *FlexComponentProperties // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -2164,120 +3474,94 @@ type DbSystemShape struct { Type *string } -// DbSystemShapeListResult - The response of a DbSystemShape list operation. -type DbSystemShapeListResult struct { - // REQUIRED; The DbSystemShape items on this page - Value []*DbSystemShape +// FlexComponentListResult - The response of a FlexComponent list operation. +type FlexComponentListResult struct { + // REQUIRED; The FlexComponent items on this page + Value []*FlexComponent // The link to the next page of items NextLink *string } -// DbSystemShapeProperties - DbSystemShape resource model -type DbSystemShapeProperties struct { - // READ-ONLY; The maximum number of CPU cores that can be enabled on the DB system for this shape. +// FlexComponentProperties - FlexComponent resource model +type FlexComponentProperties struct { + // READ-ONLY; The maximum number of CPU cores that can be enabled on the DB Server for this Flex Component. AvailableCoreCount *int32 - // READ-ONLY; The maximum number of CPU cores per database node that can be enabled for this shape. Only applicable to the - // flex Exadata shape and ExaCC Elastic shapes. - AvailableCoreCountPerNode *int32 - - // READ-ONLY; The maximum DATA storage that can be enabled for this shape. - AvailableDataStorageInTbs *int32 - - // READ-ONLY; The maximum data storage available per storage server for this shape. Only applicable to ExaCC Elastic shapes. - AvailableDataStoragePerServerInTbs *float64 - - // READ-ONLY; The maximum Db Node storage available per database node for this shape. Only applicable to ExaCC Elastic shapes. - AvailableDbNodePerNodeInGbs *int32 + // READ-ONLY; The maximum storage that can be enabled on the Storage Server for this Flex Component. + AvailableDbStorageInGbs *int32 - // READ-ONLY; The maximum Db Node storage that can be enabled for this shape. - AvailableDbNodeStorageInGbs *int32 + // READ-ONLY; The maximum local storage that can be enabled on the DB Server for this Flex Component. + AvailableLocalStorageInGbs *int32 - // READ-ONLY; The maximum memory that can be enabled for this shape. + // READ-ONLY; The maximum memory size that can be enabled on the DB Server for this Flex Component. AvailableMemoryInGbs *int32 - // READ-ONLY; The maximum memory available per database node for this shape. Only applicable to ExaCC Elastic shapes. - AvailableMemoryPerNodeInGbs *int32 - - // READ-ONLY; The discrete number by which the CPU core count for this shape can be increased or decreased. - CoreCountIncrement *int32 - - // READ-ONLY; The maximum number of Exadata storage servers available for the Exadata infrastructure. - MaxStorageCount *int32 - - // READ-ONLY; The maximum number of database nodes available for this shape. - MaximumNodeCount *int32 - - // READ-ONLY; The minimum number of CPU cores that can be enabled per node for this shape. - MinCoreCountPerNode *int32 - - // READ-ONLY; The minimum data storage that need be allocated for this shape. - MinDataStorageInTbs *int32 - - // READ-ONLY; The minimum Db Node storage that need be allocated per node for this shape. - MinDbNodeStoragePerNodeInGbs *int32 + // READ-ONLY; The compute model of the DB Server for this Flex Component. + ComputeModel *string - // READ-ONLY; The minimum memory that need be allocated per node for this shape. - MinMemoryPerNodeInGbs *int32 + // READ-ONLY; The description summary for this Flex Component. + DescriptionSummary *string - // READ-ONLY; The minimum number of Exadata storage servers available for the Exadata infrastructure. - MinStorageCount *int32 + // READ-ONLY; The hardware type of the DB (Compute) or Storage (Cell) Server for this Flex Component. + HardwareType *HardwareType - // READ-ONLY; The minimum number of CPU cores that can be enabled on the DB system for this shape. + // READ-ONLY; The minimum number of CPU cores that can be enabled on the DB Server for this Flex Component. MinimumCoreCount *int32 - // READ-ONLY; The minimum number of database nodes available for this shape. - MinimumNodeCount *int32 - - // READ-ONLY; The runtime minimum number of CPU cores that can be enabled on the DB system for this shape. + // READ-ONLY; The runtime minimum number of CPU cores that can be enabled for this Flex Component. RuntimeMinimumCoreCount *int32 - // READ-ONLY; The family of the shape used for the DB system. - ShapeFamily *string + // READ-ONLY; The name of the DB system shape for this Flex Component. + Shape *string } -// EstimatedPatchingTime - The estimated total time required in minutes for all patching operations (database server, storage -// server, and network switch patching). -type EstimatedPatchingTime struct { - // READ-ONLY; The estimated time required in minutes for database server patching. - EstimatedDbServerPatchingTime *int32 - - // READ-ONLY; The estimated time required in minutes for network switch patching. - EstimatedNetworkSwitchesPatchingTime *int32 +// GenerateAutonomousDatabaseWalletDetails - Autonomous Database Generate Wallet resource model. +type GenerateAutonomousDatabaseWalletDetails struct { + // REQUIRED; The password to encrypt the keys inside the wallet + Password *string - // READ-ONLY; The estimated time required in minutes for storage server patching. - EstimatedStorageServerPatchingTime *int32 + // The type of wallet to generate. + GenerateType *GenerateType - // READ-ONLY; The estimated total time required in minutes for all patching operations. - TotalEstimatedPatchingTime *int32 + // True when requesting regional connection strings in PDB connect info, applicable to cross-region DG only. + IsRegional *bool } -// ExadataIormConfig for cloud vm cluster -type ExadataIormConfig struct { - // An array of IORM settings for all the database in the Exadata DB system. - DbPlans []*DbIormConfig +// GiMinorVersion - The Oracle Grid Infrastructure (GI) minor version resource definition. +type GiMinorVersion struct { + // The resource-specific properties for this resource. + Properties *GiMinorVersionProperties - // Additional information about the current lifecycleState. - LifecycleDetails *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string - // The current state of IORM configuration for the Exadata DB system. - LifecycleState *IormLifecycleState + // READ-ONLY; The name of the resource + Name *string - // The current value for the IORM objective. The default is AUTO. - Objective *Objective + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } -// GenerateAutonomousDatabaseWalletDetails - Autonomous Database Generate Wallet resource model. -type GenerateAutonomousDatabaseWalletDetails struct { - // REQUIRED; The password to encrypt the keys inside the wallet - Password *string +// GiMinorVersionListResult - The response of a GiMinorVersion list operation. +type GiMinorVersionListResult struct { + // REQUIRED; The GiMinorVersion items on this page + Value []*GiMinorVersion - // The type of wallet to generate. - GenerateType *GenerateType + // The link to the next page of items + NextLink *string +} - // True when requesting regional connection strings in PDB connect info, applicable to cross-region DG only. - IsRegional *bool +// GiMinorVersionProperties - The Oracle Grid Infrastructure (GI) minor version properties +type GiMinorVersionProperties struct { + // REQUIRED; A valid Oracle Grid Infrastructure (GI) software version. + Version *string + + // Grid Infrastructure Image Id + GridImageOcid *string } // GiVersion resource definition @@ -2309,7 +3593,7 @@ type GiVersionListResult struct { // GiVersionProperties - GiVersion resource model type GiVersionProperties struct { - // READ-ONLY; A valid Oracle Grid Infrastructure (GI) software version. + // REQUIRED; A valid Oracle Grid Infrastructure (GI) software version. Version *string } @@ -2478,12 +3762,21 @@ type OracleSubscriptionProperties struct { // Term Unit. P1Y, P3Y, etc, see Durations https://en.wikipedia.org/wiki/ISO_8601 TermUnit *string + // READ-ONLY; State of the add Azure subscription operation on Oracle subscription + AddSubscriptionOperationState *AddSubscriptionOperationState + + // READ-ONLY; Azure subscriptions to be added + AzureSubscriptionIDs []*string + // READ-ONLY; Cloud Account Id CloudAccountID *string // READ-ONLY; Cloud Account provisioning state. CloudAccountState *CloudAccountProvisioningState + // READ-ONLY; Status details of the last operation on Oracle subscription + LastOperationStatusDetail *string + // READ-ONLY; OracleSubscriptionProvisioningState provisioning state ProvisioningState *OracleSubscriptionProvisioningState @@ -2496,7 +3789,7 @@ type OracleSubscriptionUpdate struct { // Details of the resource plan. Plan *PlanUpdate - // The updatable properties of the OracleSubscription. + // The resource-specific properties for this resource. Properties *OracleSubscriptionUpdateProperties } @@ -2511,9 +3804,15 @@ type OracleSubscriptionUpdateProperties struct { // PeerDbDetails - PeerDb Details type PeerDbDetails struct { - // The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer + // The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer // database. PeerDbID *string + + // The location of the Disaster Recovery peer database. + PeerDbLocation *string + + // Ocid of the Disaster Recovery peer database, which is located in a different region from the current peer database. + PeerDbOcid *string } // Plan for the resource. @@ -2623,6 +3922,13 @@ type ProfileType struct { TLSAuthentication *TLSAuthenticationType } +// RemoveVirtualMachineFromExadbVMClusterDetails - Details of removing Virtual Machines from the Exadata VM cluster on Exascale +// Infrastructure. Applies to Exadata Database Service on Exascale Infrastructure only. +type RemoveVirtualMachineFromExadbVMClusterDetails struct { + // REQUIRED; The list of ExaCS DB nodes for the Exadata VM cluster on Exascale Infrastructure to be removed. + DbNodes []*DbNodeDetails +} + // RestoreAutonomousDatabaseDetails - Details to restore an Oracle Autonomous Database. type RestoreAutonomousDatabaseDetails struct { // REQUIRED; The time to restore the database to. @@ -2742,7 +4048,7 @@ type SystemVersionListResult struct { // SystemVersionProperties - System Version Resource model type SystemVersionProperties struct { - // READ-ONLY; A valid Oracle System Version + // REQUIRED; A valid Oracle System Version SystemVersion *string } diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/models_serde.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/models_serde.go index 3c239e9ac5d9..104e5715077e 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/models_serde.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/models_serde.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -354,7 +351,11 @@ func (a *AutonomousDatabaseBackupProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseBackupUpdate. func (a AutonomousDatabaseBackupUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } @@ -367,35 +368,20 @@ func (a *AutonomousDatabaseBackupUpdate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseBackupUpdateProperties. -func (a AutonomousDatabaseBackupUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "retentionPeriodInDays", a.RetentionPeriodInDays) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseBackupUpdateProperties. -func (a *AutonomousDatabaseBackupUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "retentionPeriodInDays": - err = unpopulate(val, "RetentionPeriodInDays", &a.RetentionPeriodInDays) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -462,6 +448,7 @@ func (a AutonomousDatabaseBaseProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "privateEndpointLabel", a.PrivateEndpointLabel) populate(objectMap, "provisionableCpus", a.ProvisionableCpus) populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "remoteDisasterRecoveryConfiguration", a.RemoteDisasterRecoveryConfiguration) populate(objectMap, "role", a.Role) populate(objectMap, "sqlWebDeveloperUrl", a.SQLWebDeveloperURL) populate(objectMap, "scheduledOperations", a.ScheduledOperations) @@ -471,6 +458,7 @@ func (a AutonomousDatabaseBaseProperties) MarshalJSON() ([]byte, error) { populateDateTimeRFC3339(objectMap, "timeCreated", a.TimeCreated) populate(objectMap, "timeDataGuardRoleChanged", a.TimeDataGuardRoleChanged) populate(objectMap, "timeDeletionOfFreeAutonomousDatabase", a.TimeDeletionOfFreeAutonomousDatabase) + populateDateTimeRFC3339(objectMap, "timeDisasterRecoveryRoleChanged", a.TimeDisasterRecoveryRoleChanged) populate(objectMap, "timeLocalDataGuardEnabled", a.TimeLocalDataGuardEnabled) populateDateTimeRFC3339(objectMap, "timeMaintenanceBegin", a.TimeMaintenanceBegin) populateDateTimeRFC3339(objectMap, "timeMaintenanceEnd", a.TimeMaintenanceEnd) @@ -657,6 +645,9 @@ func (a *AutonomousDatabaseBaseProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) + case "remoteDisasterRecoveryConfiguration": + err = unpopulate(val, "RemoteDisasterRecoveryConfiguration", &a.RemoteDisasterRecoveryConfiguration) + delete(rawMsg, key) case "role": err = unpopulate(val, "Role", &a.Role) delete(rawMsg, key) @@ -684,6 +675,9 @@ func (a *AutonomousDatabaseBaseProperties) UnmarshalJSON(data []byte) error { case "timeDeletionOfFreeAutonomousDatabase": err = unpopulate(val, "TimeDeletionOfFreeAutonomousDatabase", &a.TimeDeletionOfFreeAutonomousDatabase) delete(rawMsg, key) + case "timeDisasterRecoveryRoleChanged": + err = unpopulateDateTimeRFC3339(val, "TimeDisasterRecoveryRoleChanged", &a.TimeDisasterRecoveryRoleChanged) + delete(rawMsg, key) case "timeLocalDataGuardEnabled": err = unpopulate(val, "TimeLocalDataGuardEnabled", &a.TimeLocalDataGuardEnabled) delete(rawMsg, key) @@ -891,6 +885,7 @@ func (a AutonomousDatabaseCloneProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "provisioningState", a.ProvisioningState) populate(objectMap, "refreshableModel", a.RefreshableModel) populate(objectMap, "refreshableStatus", a.RefreshableStatus) + populate(objectMap, "remoteDisasterRecoveryConfiguration", a.RemoteDisasterRecoveryConfiguration) populate(objectMap, "role", a.Role) populate(objectMap, "sqlWebDeveloperUrl", a.SQLWebDeveloperURL) populate(objectMap, "scheduledOperations", a.ScheduledOperations) @@ -902,6 +897,7 @@ func (a AutonomousDatabaseCloneProperties) MarshalJSON() ([]byte, error) { populateDateTimeRFC3339(objectMap, "timeCreated", a.TimeCreated) populate(objectMap, "timeDataGuardRoleChanged", a.TimeDataGuardRoleChanged) populate(objectMap, "timeDeletionOfFreeAutonomousDatabase", a.TimeDeletionOfFreeAutonomousDatabase) + populateDateTimeRFC3339(objectMap, "timeDisasterRecoveryRoleChanged", a.TimeDisasterRecoveryRoleChanged) populate(objectMap, "timeLocalDataGuardEnabled", a.TimeLocalDataGuardEnabled) populateDateTimeRFC3339(objectMap, "timeMaintenanceBegin", a.TimeMaintenanceBegin) populateDateTimeRFC3339(objectMap, "timeMaintenanceEnd", a.TimeMaintenanceEnd) @@ -1104,6 +1100,9 @@ func (a *AutonomousDatabaseCloneProperties) UnmarshalJSON(data []byte) error { case "refreshableStatus": err = unpopulate(val, "RefreshableStatus", &a.RefreshableStatus) delete(rawMsg, key) + case "remoteDisasterRecoveryConfiguration": + err = unpopulate(val, "RemoteDisasterRecoveryConfiguration", &a.RemoteDisasterRecoveryConfiguration) + delete(rawMsg, key) case "role": err = unpopulate(val, "Role", &a.Role) delete(rawMsg, key) @@ -1137,6 +1136,9 @@ func (a *AutonomousDatabaseCloneProperties) UnmarshalJSON(data []byte) error { case "timeDeletionOfFreeAutonomousDatabase": err = unpopulate(val, "TimeDeletionOfFreeAutonomousDatabase", &a.TimeDeletionOfFreeAutonomousDatabase) delete(rawMsg, key) + case "timeDisasterRecoveryRoleChanged": + err = unpopulateDateTimeRFC3339(val, "TimeDisasterRecoveryRoleChanged", &a.TimeDisasterRecoveryRoleChanged) + delete(rawMsg, key) case "timeLocalDataGuardEnabled": err = unpopulate(val, "TimeLocalDataGuardEnabled", &a.TimeLocalDataGuardEnabled) delete(rawMsg, key) @@ -1184,140 +1186,8 @@ func (a *AutonomousDatabaseCloneProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseListResult. -func (a AutonomousDatabaseListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseListResult. -func (a *AutonomousDatabaseListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseNationalCharacterSet. -func (a AutonomousDatabaseNationalCharacterSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseNationalCharacterSet. -func (a *AutonomousDatabaseNationalCharacterSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseNationalCharacterSetListResult. -func (a AutonomousDatabaseNationalCharacterSetListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseNationalCharacterSetListResult. -func (a *AutonomousDatabaseNationalCharacterSetListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseNationalCharacterSetProperties. -func (a AutonomousDatabaseNationalCharacterSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "characterSet", a.CharacterSet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseNationalCharacterSetProperties. -func (a *AutonomousDatabaseNationalCharacterSetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "characterSet": - err = unpopulate(val, "CharacterSet", &a.CharacterSet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseProperties. -func (a AutonomousDatabaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseCrossRegionDisasterRecoveryProperties. +func (a AutonomousDatabaseCrossRegionDisasterRecoveryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "actualUsedDataStorageSizeInTbs", a.ActualUsedDataStorageSizeInTbs) populate(objectMap, "adminPassword", a.AdminPassword) @@ -1334,7 +1204,7 @@ func (a AutonomousDatabaseProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "connectionStrings", a.ConnectionStrings) populate(objectMap, "connectionUrls", a.ConnectionUrls) populate(objectMap, "customerContacts", a.CustomerContacts) - objectMap["dataBaseType"] = DataBaseTypeRegular + objectMap["dataBaseType"] = DataBaseTypeCrossRegionDisasterRecovery populate(objectMap, "dataSafeStatus", a.DataSafeStatus) populate(objectMap, "dataStorageSizeInGbs", a.DataStorageSizeInGbs) populate(objectMap, "dataStorageSizeInTbs", a.DataStorageSizeInTbs) @@ -1351,6 +1221,7 @@ func (a AutonomousDatabaseProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "isPreview", a.IsPreview) populate(objectMap, "isPreviewVersionWithServiceTermsAccepted", a.IsPreviewVersionWithServiceTermsAccepted) populate(objectMap, "isRemoteDataGuardEnabled", a.IsRemoteDataGuardEnabled) + populate(objectMap, "isReplicateAutomaticBackups", a.IsReplicateAutomaticBackups) populate(objectMap, "licenseModel", a.LicenseModel) populate(objectMap, "lifecycleDetails", a.LifecycleDetails) populate(objectMap, "lifecycleState", a.LifecycleState) @@ -1373,15 +1244,22 @@ func (a AutonomousDatabaseProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "privateEndpointLabel", a.PrivateEndpointLabel) populate(objectMap, "provisionableCpus", a.ProvisionableCpus) populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "remoteDisasterRecoveryConfiguration", a.RemoteDisasterRecoveryConfiguration) + populate(objectMap, "remoteDisasterRecoveryType", a.RemoteDisasterRecoveryType) populate(objectMap, "role", a.Role) populate(objectMap, "sqlWebDeveloperUrl", a.SQLWebDeveloperURL) populate(objectMap, "scheduledOperations", a.ScheduledOperations) populate(objectMap, "serviceConsoleUrl", a.ServiceConsoleURL) + objectMap["source"] = "CrossRegionDisasterRecovery" + populate(objectMap, "sourceId", a.SourceID) + populate(objectMap, "sourceLocation", a.SourceLocation) + populate(objectMap, "sourceOcid", a.SourceOcid) populate(objectMap, "subnetId", a.SubnetID) populate(objectMap, "supportedRegionsToCloneTo", a.SupportedRegionsToCloneTo) populateDateTimeRFC3339(objectMap, "timeCreated", a.TimeCreated) populate(objectMap, "timeDataGuardRoleChanged", a.TimeDataGuardRoleChanged) populate(objectMap, "timeDeletionOfFreeAutonomousDatabase", a.TimeDeletionOfFreeAutonomousDatabase) + populateDateTimeRFC3339(objectMap, "timeDisasterRecoveryRoleChanged", a.TimeDisasterRecoveryRoleChanged) populate(objectMap, "timeLocalDataGuardEnabled", a.TimeLocalDataGuardEnabled) populateDateTimeRFC3339(objectMap, "timeMaintenanceBegin", a.TimeMaintenanceBegin) populateDateTimeRFC3339(objectMap, "timeMaintenanceEnd", a.TimeMaintenanceEnd) @@ -1397,8 +1275,8 @@ func (a AutonomousDatabaseProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseProperties. -func (a *AutonomousDatabaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseCrossRegionDisasterRecoveryProperties. +func (a *AutonomousDatabaseCrossRegionDisasterRecoveryProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1502,6 +1380,9 @@ func (a *AutonomousDatabaseProperties) UnmarshalJSON(data []byte) error { case "isRemoteDataGuardEnabled": err = unpopulate(val, "IsRemoteDataGuardEnabled", &a.IsRemoteDataGuardEnabled) delete(rawMsg, key) + case "isReplicateAutomaticBackups": + err = unpopulate(val, "IsReplicateAutomaticBackups", &a.IsReplicateAutomaticBackups) + delete(rawMsg, key) case "licenseModel": err = unpopulate(val, "LicenseModel", &a.LicenseModel) delete(rawMsg, key) @@ -1568,6 +1449,12 @@ func (a *AutonomousDatabaseProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) + case "remoteDisasterRecoveryConfiguration": + err = unpopulate(val, "RemoteDisasterRecoveryConfiguration", &a.RemoteDisasterRecoveryConfiguration) + delete(rawMsg, key) + case "remoteDisasterRecoveryType": + err = unpopulate(val, "RemoteDisasterRecoveryType", &a.RemoteDisasterRecoveryType) + delete(rawMsg, key) case "role": err = unpopulate(val, "Role", &a.Role) delete(rawMsg, key) @@ -1580,6 +1467,18 @@ func (a *AutonomousDatabaseProperties) UnmarshalJSON(data []byte) error { case "serviceConsoleUrl": err = unpopulate(val, "ServiceConsoleURL", &a.ServiceConsoleURL) delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &a.Source) + delete(rawMsg, key) + case "sourceId": + err = unpopulate(val, "SourceID", &a.SourceID) + delete(rawMsg, key) + case "sourceLocation": + err = unpopulate(val, "SourceLocation", &a.SourceLocation) + delete(rawMsg, key) + case "sourceOcid": + err = unpopulate(val, "SourceOcid", &a.SourceOcid) + delete(rawMsg, key) case "subnetId": err = unpopulate(val, "SubnetID", &a.SubnetID) delete(rawMsg, key) @@ -1595,6 +1494,9 @@ func (a *AutonomousDatabaseProperties) UnmarshalJSON(data []byte) error { case "timeDeletionOfFreeAutonomousDatabase": err = unpopulate(val, "TimeDeletionOfFreeAutonomousDatabase", &a.TimeDeletionOfFreeAutonomousDatabase) delete(rawMsg, key) + case "timeDisasterRecoveryRoleChanged": + err = unpopulateDateTimeRFC3339(val, "TimeDisasterRecoveryRoleChanged", &a.TimeDisasterRecoveryRoleChanged) + delete(rawMsg, key) case "timeLocalDataGuardEnabled": err = unpopulate(val, "TimeLocalDataGuardEnabled", &a.TimeLocalDataGuardEnabled) delete(rawMsg, key) @@ -1639,111 +1541,96 @@ func (a *AutonomousDatabaseProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseStandbySummary. -func (a AutonomousDatabaseStandbySummary) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseFromBackupTimestampProperties. +func (a AutonomousDatabaseFromBackupTimestampProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "lagTimeInSeconds", a.LagTimeInSeconds) + populate(objectMap, "actualUsedDataStorageSizeInTbs", a.ActualUsedDataStorageSizeInTbs) + populate(objectMap, "adminPassword", a.AdminPassword) + populate(objectMap, "allocatedStorageSizeInTbs", a.AllocatedStorageSizeInTbs) + populate(objectMap, "apexDetails", a.ApexDetails) + populate(objectMap, "autonomousDatabaseId", a.AutonomousDatabaseID) + populate(objectMap, "autonomousMaintenanceScheduleType", a.AutonomousMaintenanceScheduleType) + populate(objectMap, "availableUpgradeVersions", a.AvailableUpgradeVersions) + populate(objectMap, "backupRetentionPeriodInDays", a.BackupRetentionPeriodInDays) + populate(objectMap, "cpuCoreCount", a.CPUCoreCount) + populate(objectMap, "characterSet", a.CharacterSet) + populate(objectMap, "cloneType", a.CloneType) + populate(objectMap, "computeCount", a.ComputeCount) + populate(objectMap, "computeModel", a.ComputeModel) + populate(objectMap, "connectionStrings", a.ConnectionStrings) + populate(objectMap, "connectionUrls", a.ConnectionUrls) + populate(objectMap, "customerContacts", a.CustomerContacts) + objectMap["dataBaseType"] = DataBaseTypeCloneFromBackupTimestamp + populate(objectMap, "dataSafeStatus", a.DataSafeStatus) + populate(objectMap, "dataStorageSizeInGbs", a.DataStorageSizeInGbs) + populate(objectMap, "dataStorageSizeInTbs", a.DataStorageSizeInTbs) + populate(objectMap, "databaseEdition", a.DatabaseEdition) + populate(objectMap, "dbVersion", a.DbVersion) + populate(objectMap, "dbWorkload", a.DbWorkload) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "failedDataRecoveryInSeconds", a.FailedDataRecoveryInSeconds) + populate(objectMap, "inMemoryAreaInGbs", a.InMemoryAreaInGbs) + populate(objectMap, "isAutoScalingEnabled", a.IsAutoScalingEnabled) + populate(objectMap, "isAutoScalingForStorageEnabled", a.IsAutoScalingForStorageEnabled) + populate(objectMap, "isLocalDataGuardEnabled", a.IsLocalDataGuardEnabled) + populate(objectMap, "isMtlsConnectionRequired", a.IsMtlsConnectionRequired) + populate(objectMap, "isPreview", a.IsPreview) + populate(objectMap, "isPreviewVersionWithServiceTermsAccepted", a.IsPreviewVersionWithServiceTermsAccepted) + populate(objectMap, "isRemoteDataGuardEnabled", a.IsRemoteDataGuardEnabled) + populate(objectMap, "licenseModel", a.LicenseModel) populate(objectMap, "lifecycleDetails", a.LifecycleDetails) populate(objectMap, "lifecycleState", a.LifecycleState) - populate(objectMap, "timeDataGuardRoleChanged", a.TimeDataGuardRoleChanged) - populate(objectMap, "timeDisasterRecoveryRoleChanged", a.TimeDisasterRecoveryRoleChanged) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseStandbySummary. -func (a *AutonomousDatabaseStandbySummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "lagTimeInSeconds": - err = unpopulate(val, "LagTimeInSeconds", &a.LagTimeInSeconds) - delete(rawMsg, key) - case "lifecycleDetails": - err = unpopulate(val, "LifecycleDetails", &a.LifecycleDetails) - delete(rawMsg, key) - case "lifecycleState": - err = unpopulate(val, "LifecycleState", &a.LifecycleState) - delete(rawMsg, key) - case "timeDataGuardRoleChanged": - err = unpopulate(val, "TimeDataGuardRoleChanged", &a.TimeDataGuardRoleChanged) - delete(rawMsg, key) - case "timeDisasterRecoveryRoleChanged": - err = unpopulate(val, "TimeDisasterRecoveryRoleChanged", &a.TimeDisasterRecoveryRoleChanged) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseUpdate. -func (a AutonomousDatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseUpdate. -func (a *AutonomousDatabaseUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseUpdateProperties. -func (a AutonomousDatabaseUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "adminPassword", a.AdminPassword) - populate(objectMap, "autonomousMaintenanceScheduleType", a.AutonomousMaintenanceScheduleType) - populate(objectMap, "backupRetentionPeriodInDays", a.BackupRetentionPeriodInDays) - populate(objectMap, "cpuCoreCount", a.CPUCoreCount) - populate(objectMap, "computeCount", a.ComputeCount) - populate(objectMap, "customerContacts", a.CustomerContacts) - populate(objectMap, "dataStorageSizeInGbs", a.DataStorageSizeInGbs) - populate(objectMap, "dataStorageSizeInTbs", a.DataStorageSizeInTbs) - populate(objectMap, "databaseEdition", a.DatabaseEdition) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "isAutoScalingEnabled", a.IsAutoScalingEnabled) - populate(objectMap, "isAutoScalingForStorageEnabled", a.IsAutoScalingForStorageEnabled) - populate(objectMap, "isLocalDataGuardEnabled", a.IsLocalDataGuardEnabled) - populate(objectMap, "isMtlsConnectionRequired", a.IsMtlsConnectionRequired) - populate(objectMap, "licenseModel", a.LicenseModel) populate(objectMap, "localAdgAutoFailoverMaxDataLossLimit", a.LocalAdgAutoFailoverMaxDataLossLimit) + populate(objectMap, "localDisasterRecoveryType", a.LocalDisasterRecoveryType) + populate(objectMap, "localStandbyDb", a.LocalStandbyDb) populate(objectMap, "longTermBackupSchedule", a.LongTermBackupSchedule) + populate(objectMap, "memoryPerOracleComputeUnitInGbs", a.MemoryPerOracleComputeUnitInGbs) + populate(objectMap, "ncharacterSet", a.NcharacterSet) + populateDateTimeRFC3339(objectMap, "nextLongTermBackupTimeStamp", a.NextLongTermBackupTimeStamp) + populate(objectMap, "ociUrl", a.OciURL) + populate(objectMap, "ocid", a.Ocid) populate(objectMap, "openMode", a.OpenMode) + populate(objectMap, "operationsInsightsStatus", a.OperationsInsightsStatus) populate(objectMap, "peerDbId", a.PeerDbID) + populate(objectMap, "peerDbIds", a.PeerDbIDs) populate(objectMap, "permissionLevel", a.PermissionLevel) + populate(objectMap, "privateEndpoint", a.PrivateEndpoint) + populate(objectMap, "privateEndpointIp", a.PrivateEndpointIP) + populate(objectMap, "privateEndpointLabel", a.PrivateEndpointLabel) + populate(objectMap, "provisionableCpus", a.ProvisionableCpus) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "remoteDisasterRecoveryConfiguration", a.RemoteDisasterRecoveryConfiguration) populate(objectMap, "role", a.Role) + populate(objectMap, "sqlWebDeveloperUrl", a.SQLWebDeveloperURL) populate(objectMap, "scheduledOperations", a.ScheduledOperations) + populate(objectMap, "serviceConsoleUrl", a.ServiceConsoleURL) + objectMap["source"] = "BackupFromTimestamp" + populate(objectMap, "sourceId", a.SourceID) + populate(objectMap, "subnetId", a.SubnetID) + populate(objectMap, "supportedRegionsToCloneTo", a.SupportedRegionsToCloneTo) + populateDateTimeRFC3339(objectMap, "timeCreated", a.TimeCreated) + populate(objectMap, "timeDataGuardRoleChanged", a.TimeDataGuardRoleChanged) + populate(objectMap, "timeDeletionOfFreeAutonomousDatabase", a.TimeDeletionOfFreeAutonomousDatabase) + populateDateTimeRFC3339(objectMap, "timeDisasterRecoveryRoleChanged", a.TimeDisasterRecoveryRoleChanged) + populate(objectMap, "timeLocalDataGuardEnabled", a.TimeLocalDataGuardEnabled) + populateDateTimeRFC3339(objectMap, "timeMaintenanceBegin", a.TimeMaintenanceBegin) + populateDateTimeRFC3339(objectMap, "timeMaintenanceEnd", a.TimeMaintenanceEnd) + populate(objectMap, "timeOfLastFailover", a.TimeOfLastFailover) + populate(objectMap, "timeOfLastRefresh", a.TimeOfLastRefresh) + populate(objectMap, "timeOfLastRefreshPoint", a.TimeOfLastRefreshPoint) + populate(objectMap, "timeOfLastSwitchover", a.TimeOfLastSwitchover) + populate(objectMap, "timeReclamationOfFreeAutonomousDatabase", a.TimeReclamationOfFreeAutonomousDatabase) + populateDateTimeRFC3339(objectMap, "timestamp", a.Timestamp) + populate(objectMap, "useLatestAvailableBackupTimeStamp", a.UseLatestAvailableBackupTimeStamp) + populate(objectMap, "usedDataStorageSizeInGbs", a.UsedDataStorageSizeInGbs) + populate(objectMap, "usedDataStorageSizeInTbs", a.UsedDataStorageSizeInTbs) + populate(objectMap, "vnetId", a.VnetID) populate(objectMap, "whitelistedIps", a.WhitelistedIPs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseUpdateProperties. -func (a *AutonomousDatabaseUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseFromBackupTimestampProperties. +func (a *AutonomousDatabaseFromBackupTimestampProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1751,24 +1638,60 @@ func (a *AutonomousDatabaseUpdateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "actualUsedDataStorageSizeInTbs": + err = unpopulate(val, "ActualUsedDataStorageSizeInTbs", &a.ActualUsedDataStorageSizeInTbs) + delete(rawMsg, key) case "adminPassword": err = unpopulate(val, "AdminPassword", &a.AdminPassword) delete(rawMsg, key) + case "allocatedStorageSizeInTbs": + err = unpopulate(val, "AllocatedStorageSizeInTbs", &a.AllocatedStorageSizeInTbs) + delete(rawMsg, key) + case "apexDetails": + err = unpopulate(val, "ApexDetails", &a.ApexDetails) + delete(rawMsg, key) + case "autonomousDatabaseId": + err = unpopulate(val, "AutonomousDatabaseID", &a.AutonomousDatabaseID) + delete(rawMsg, key) case "autonomousMaintenanceScheduleType": err = unpopulate(val, "AutonomousMaintenanceScheduleType", &a.AutonomousMaintenanceScheduleType) delete(rawMsg, key) + case "availableUpgradeVersions": + err = unpopulate(val, "AvailableUpgradeVersions", &a.AvailableUpgradeVersions) + delete(rawMsg, key) case "backupRetentionPeriodInDays": err = unpopulate(val, "BackupRetentionPeriodInDays", &a.BackupRetentionPeriodInDays) delete(rawMsg, key) case "cpuCoreCount": err = unpopulate(val, "CPUCoreCount", &a.CPUCoreCount) delete(rawMsg, key) + case "characterSet": + err = unpopulate(val, "CharacterSet", &a.CharacterSet) + delete(rawMsg, key) + case "cloneType": + err = unpopulate(val, "CloneType", &a.CloneType) + delete(rawMsg, key) case "computeCount": err = unpopulate(val, "ComputeCount", &a.ComputeCount) delete(rawMsg, key) + case "computeModel": + err = unpopulate(val, "ComputeModel", &a.ComputeModel) + delete(rawMsg, key) + case "connectionStrings": + err = unpopulate(val, "ConnectionStrings", &a.ConnectionStrings) + delete(rawMsg, key) + case "connectionUrls": + err = unpopulate(val, "ConnectionUrls", &a.ConnectionUrls) + delete(rawMsg, key) case "customerContacts": err = unpopulate(val, "CustomerContacts", &a.CustomerContacts) delete(rawMsg, key) + case "dataBaseType": + err = unpopulate(val, "DataBaseType", &a.DataBaseType) + delete(rawMsg, key) + case "dataSafeStatus": + err = unpopulate(val, "DataSafeStatus", &a.DataSafeStatus) + delete(rawMsg, key) case "dataStorageSizeInGbs": err = unpopulate(val, "DataStorageSizeInGbs", &a.DataStorageSizeInGbs) delete(rawMsg, key) @@ -1778,9 +1701,21 @@ func (a *AutonomousDatabaseUpdateProperties) UnmarshalJSON(data []byte) error { case "databaseEdition": err = unpopulate(val, "DatabaseEdition", &a.DatabaseEdition) delete(rawMsg, key) + case "dbVersion": + err = unpopulate(val, "DbVersion", &a.DbVersion) + delete(rawMsg, key) + case "dbWorkload": + err = unpopulate(val, "DbWorkload", &a.DbWorkload) + delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &a.DisplayName) delete(rawMsg, key) + case "failedDataRecoveryInSeconds": + err = unpopulate(val, "FailedDataRecoveryInSeconds", &a.FailedDataRecoveryInSeconds) + delete(rawMsg, key) + case "inMemoryAreaInGbs": + err = unpopulate(val, "InMemoryAreaInGbs", &a.InMemoryAreaInGbs) + delete(rawMsg, key) case "isAutoScalingEnabled": err = unpopulate(val, "IsAutoScalingEnabled", &a.IsAutoScalingEnabled) delete(rawMsg, key) @@ -1793,102 +1728,161 @@ func (a *AutonomousDatabaseUpdateProperties) UnmarshalJSON(data []byte) error { case "isMtlsConnectionRequired": err = unpopulate(val, "IsMtlsConnectionRequired", &a.IsMtlsConnectionRequired) delete(rawMsg, key) + case "isPreview": + err = unpopulate(val, "IsPreview", &a.IsPreview) + delete(rawMsg, key) + case "isPreviewVersionWithServiceTermsAccepted": + err = unpopulate(val, "IsPreviewVersionWithServiceTermsAccepted", &a.IsPreviewVersionWithServiceTermsAccepted) + delete(rawMsg, key) + case "isRemoteDataGuardEnabled": + err = unpopulate(val, "IsRemoteDataGuardEnabled", &a.IsRemoteDataGuardEnabled) + delete(rawMsg, key) case "licenseModel": err = unpopulate(val, "LicenseModel", &a.LicenseModel) delete(rawMsg, key) + case "lifecycleDetails": + err = unpopulate(val, "LifecycleDetails", &a.LifecycleDetails) + delete(rawMsg, key) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &a.LifecycleState) + delete(rawMsg, key) case "localAdgAutoFailoverMaxDataLossLimit": err = unpopulate(val, "LocalAdgAutoFailoverMaxDataLossLimit", &a.LocalAdgAutoFailoverMaxDataLossLimit) delete(rawMsg, key) + case "localDisasterRecoveryType": + err = unpopulate(val, "LocalDisasterRecoveryType", &a.LocalDisasterRecoveryType) + delete(rawMsg, key) + case "localStandbyDb": + err = unpopulate(val, "LocalStandbyDb", &a.LocalStandbyDb) + delete(rawMsg, key) case "longTermBackupSchedule": err = unpopulate(val, "LongTermBackupSchedule", &a.LongTermBackupSchedule) delete(rawMsg, key) + case "memoryPerOracleComputeUnitInGbs": + err = unpopulate(val, "MemoryPerOracleComputeUnitInGbs", &a.MemoryPerOracleComputeUnitInGbs) + delete(rawMsg, key) + case "ncharacterSet": + err = unpopulate(val, "NcharacterSet", &a.NcharacterSet) + delete(rawMsg, key) + case "nextLongTermBackupTimeStamp": + err = unpopulateDateTimeRFC3339(val, "NextLongTermBackupTimeStamp", &a.NextLongTermBackupTimeStamp) + delete(rawMsg, key) + case "ociUrl": + err = unpopulate(val, "OciURL", &a.OciURL) + delete(rawMsg, key) + case "ocid": + err = unpopulate(val, "Ocid", &a.Ocid) + delete(rawMsg, key) case "openMode": err = unpopulate(val, "OpenMode", &a.OpenMode) delete(rawMsg, key) + case "operationsInsightsStatus": + err = unpopulate(val, "OperationsInsightsStatus", &a.OperationsInsightsStatus) + delete(rawMsg, key) case "peerDbId": err = unpopulate(val, "PeerDbID", &a.PeerDbID) delete(rawMsg, key) + case "peerDbIds": + err = unpopulate(val, "PeerDbIDs", &a.PeerDbIDs) + delete(rawMsg, key) case "permissionLevel": err = unpopulate(val, "PermissionLevel", &a.PermissionLevel) delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &a.PrivateEndpoint) + delete(rawMsg, key) + case "privateEndpointIp": + err = unpopulate(val, "PrivateEndpointIP", &a.PrivateEndpointIP) + delete(rawMsg, key) + case "privateEndpointLabel": + err = unpopulate(val, "PrivateEndpointLabel", &a.PrivateEndpointLabel) + delete(rawMsg, key) + case "provisionableCpus": + err = unpopulate(val, "ProvisionableCpus", &a.ProvisionableCpus) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "remoteDisasterRecoveryConfiguration": + err = unpopulate(val, "RemoteDisasterRecoveryConfiguration", &a.RemoteDisasterRecoveryConfiguration) + delete(rawMsg, key) case "role": err = unpopulate(val, "Role", &a.Role) delete(rawMsg, key) + case "sqlWebDeveloperUrl": + err = unpopulate(val, "SQLWebDeveloperURL", &a.SQLWebDeveloperURL) + delete(rawMsg, key) case "scheduledOperations": err = unpopulate(val, "ScheduledOperations", &a.ScheduledOperations) delete(rawMsg, key) - case "whitelistedIps": - err = unpopulate(val, "WhitelistedIPs", &a.WhitelistedIPs) + case "serviceConsoleUrl": + err = unpopulate(val, "ServiceConsoleURL", &a.ServiceConsoleURL) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseWalletFile. -func (a AutonomousDatabaseWalletFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "walletFiles", a.WalletFiles) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseWalletFile. -func (a *AutonomousDatabaseWalletFile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "walletFiles": - err = unpopulate(val, "WalletFiles", &a.WalletFiles) + case "source": + err = unpopulate(val, "Source", &a.Source) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutonomousDbVersion. -func (a AutonomousDbVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDbVersion. -func (a *AutonomousDbVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) + case "sourceId": + err = unpopulate(val, "SourceID", &a.SourceID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) + case "subnetId": + err = unpopulate(val, "SubnetID", &a.SubnetID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) + case "supportedRegionsToCloneTo": + err = unpopulate(val, "SupportedRegionsToCloneTo", &a.SupportedRegionsToCloneTo) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) + case "timeCreated": + err = unpopulateDateTimeRFC3339(val, "TimeCreated", &a.TimeCreated) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "timeDataGuardRoleChanged": + err = unpopulate(val, "TimeDataGuardRoleChanged", &a.TimeDataGuardRoleChanged) + delete(rawMsg, key) + case "timeDeletionOfFreeAutonomousDatabase": + err = unpopulate(val, "TimeDeletionOfFreeAutonomousDatabase", &a.TimeDeletionOfFreeAutonomousDatabase) + delete(rawMsg, key) + case "timeDisasterRecoveryRoleChanged": + err = unpopulateDateTimeRFC3339(val, "TimeDisasterRecoveryRoleChanged", &a.TimeDisasterRecoveryRoleChanged) + delete(rawMsg, key) + case "timeLocalDataGuardEnabled": + err = unpopulate(val, "TimeLocalDataGuardEnabled", &a.TimeLocalDataGuardEnabled) + delete(rawMsg, key) + case "timeMaintenanceBegin": + err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceBegin", &a.TimeMaintenanceBegin) + delete(rawMsg, key) + case "timeMaintenanceEnd": + err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceEnd", &a.TimeMaintenanceEnd) + delete(rawMsg, key) + case "timeOfLastFailover": + err = unpopulate(val, "TimeOfLastFailover", &a.TimeOfLastFailover) + delete(rawMsg, key) + case "timeOfLastRefresh": + err = unpopulate(val, "TimeOfLastRefresh", &a.TimeOfLastRefresh) + delete(rawMsg, key) + case "timeOfLastRefreshPoint": + err = unpopulate(val, "TimeOfLastRefreshPoint", &a.TimeOfLastRefreshPoint) + delete(rawMsg, key) + case "timeOfLastSwitchover": + err = unpopulate(val, "TimeOfLastSwitchover", &a.TimeOfLastSwitchover) + delete(rawMsg, key) + case "timeReclamationOfFreeAutonomousDatabase": + err = unpopulate(val, "TimeReclamationOfFreeAutonomousDatabase", &a.TimeReclamationOfFreeAutonomousDatabase) + delete(rawMsg, key) + case "timestamp": + err = unpopulateDateTimeRFC3339(val, "Timestamp", &a.Timestamp) + delete(rawMsg, key) + case "useLatestAvailableBackupTimeStamp": + err = unpopulate(val, "UseLatestAvailableBackupTimeStamp", &a.UseLatestAvailableBackupTimeStamp) + delete(rawMsg, key) + case "usedDataStorageSizeInGbs": + err = unpopulate(val, "UsedDataStorageSizeInGbs", &a.UsedDataStorageSizeInGbs) + delete(rawMsg, key) + case "usedDataStorageSizeInTbs": + err = unpopulate(val, "UsedDataStorageSizeInTbs", &a.UsedDataStorageSizeInTbs) + delete(rawMsg, key) + case "vnetId": + err = unpopulate(val, "VnetID", &a.VnetID) + delete(rawMsg, key) + case "whitelistedIps": + err = unpopulate(val, "WhitelistedIPs", &a.WhitelistedIPs) delete(rawMsg, key) } if err != nil { @@ -1898,16 +1892,16 @@ func (a *AutonomousDbVersion) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AutonomousDbVersionListResult. -func (a AutonomousDbVersionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseListResult. +func (a AutonomousDatabaseListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDbVersionListResult. -func (a *AutonomousDbVersionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseListResult. +func (a *AutonomousDatabaseListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1929,20 +1923,19 @@ func (a *AutonomousDbVersionListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AutonomousDbVersionProperties. -func (a AutonomousDbVersionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseNationalCharacterSet. +func (a AutonomousDatabaseNationalCharacterSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dbWorkload", a.DbWorkload) - populate(objectMap, "isDefaultForFree", a.IsDefaultForFree) - populate(objectMap, "isDefaultForPaid", a.IsDefaultForPaid) - populate(objectMap, "isFreeTierEnabled", a.IsFreeTierEnabled) - populate(objectMap, "isPaidEnabled", a.IsPaidEnabled) - populate(objectMap, "version", a.Version) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDbVersionProperties. -func (a *AutonomousDbVersionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseNationalCharacterSet. +func (a *AutonomousDatabaseNationalCharacterSet) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1950,23 +1943,20 @@ func (a *AutonomousDbVersionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "dbWorkload": - err = unpopulate(val, "DbWorkload", &a.DbWorkload) - delete(rawMsg, key) - case "isDefaultForFree": - err = unpopulate(val, "IsDefaultForFree", &a.IsDefaultForFree) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "isDefaultForPaid": - err = unpopulate(val, "IsDefaultForPaid", &a.IsDefaultForPaid) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "isFreeTierEnabled": - err = unpopulate(val, "IsFreeTierEnabled", &a.IsFreeTierEnabled) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "isPaidEnabled": - err = unpopulate(val, "IsPaidEnabled", &a.IsPaidEnabled) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &a.Version) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -1976,870 +1966,2531 @@ func (a *AutonomousDbVersionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudAccountDetails. -func (c CloudAccountDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "cloudAccountHomeRegion", c.CloudAccountHomeRegion) - populate(objectMap, "cloudAccountName", c.CloudAccountName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudAccountDetails. -func (c *CloudAccountDetails) 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 "cloudAccountHomeRegion": - err = unpopulate(val, "CloudAccountHomeRegion", &c.CloudAccountHomeRegion) - delete(rawMsg, key) - case "cloudAccountName": - err = unpopulate(val, "CloudAccountName", &c.CloudAccountName) - 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 CloudExadataInfrastructure. -func (c CloudExadataInfrastructure) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseNationalCharacterSetListResult. +func (a AutonomousDatabaseNationalCharacterSetListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructure. -func (c *CloudExadataInfrastructure) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseNationalCharacterSetListResult. +func (a *AutonomousDatabaseNationalCharacterSetListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudExadataInfrastructureListResult. -func (c CloudExadataInfrastructureListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseNationalCharacterSetProperties. +func (a AutonomousDatabaseNationalCharacterSetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "characterSet", a.CharacterSet) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructureListResult. -func (c *CloudExadataInfrastructureListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseNationalCharacterSetProperties. +func (a *AutonomousDatabaseNationalCharacterSetProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "characterSet": + err = unpopulate(val, "CharacterSet", &a.CharacterSet) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudExadataInfrastructureProperties. -func (c CloudExadataInfrastructureProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseProperties. +func (a AutonomousDatabaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activatedStorageCount", c.ActivatedStorageCount) - populate(objectMap, "additionalStorageCount", c.AdditionalStorageCount) - populate(objectMap, "availableStorageSizeInGbs", c.AvailableStorageSizeInGbs) - populate(objectMap, "cpuCount", c.CPUCount) - populate(objectMap, "computeCount", c.ComputeCount) - populate(objectMap, "customerContacts", c.CustomerContacts) - populate(objectMap, "dataStorageSizeInTbs", c.DataStorageSizeInTbs) - populate(objectMap, "dbNodeStorageSizeInGbs", c.DbNodeStorageSizeInGbs) - populate(objectMap, "dbServerVersion", c.DbServerVersion) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "estimatedPatchingTime", c.EstimatedPatchingTime) - populate(objectMap, "lastMaintenanceRunId", c.LastMaintenanceRunID) - populate(objectMap, "lifecycleDetails", c.LifecycleDetails) - populate(objectMap, "lifecycleState", c.LifecycleState) - populate(objectMap, "maintenanceWindow", c.MaintenanceWindow) - populate(objectMap, "maxCpuCount", c.MaxCPUCount) - populate(objectMap, "maxDataStorageInTbs", c.MaxDataStorageInTbs) - populate(objectMap, "maxDbNodeStorageSizeInGbs", c.MaxDbNodeStorageSizeInGbs) - populate(objectMap, "maxMemoryInGbs", c.MaxMemoryInGbs) - populate(objectMap, "memorySizeInGbs", c.MemorySizeInGbs) - populate(objectMap, "monthlyDbServerVersion", c.MonthlyDbServerVersion) - populate(objectMap, "monthlyStorageServerVersion", c.MonthlyStorageServerVersion) - populate(objectMap, "nextMaintenanceRunId", c.NextMaintenanceRunID) - populate(objectMap, "ociUrl", c.OciURL) - populate(objectMap, "ocid", c.Ocid) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "shape", c.Shape) - populate(objectMap, "storageCount", c.StorageCount) - populate(objectMap, "storageServerVersion", c.StorageServerVersion) - populate(objectMap, "timeCreated", c.TimeCreated) - populate(objectMap, "totalStorageSizeInGbs", c.TotalStorageSizeInGbs) + populate(objectMap, "actualUsedDataStorageSizeInTbs", a.ActualUsedDataStorageSizeInTbs) + populate(objectMap, "adminPassword", a.AdminPassword) + populate(objectMap, "allocatedStorageSizeInTbs", a.AllocatedStorageSizeInTbs) + populate(objectMap, "apexDetails", a.ApexDetails) + populate(objectMap, "autonomousDatabaseId", a.AutonomousDatabaseID) + populate(objectMap, "autonomousMaintenanceScheduleType", a.AutonomousMaintenanceScheduleType) + populate(objectMap, "availableUpgradeVersions", a.AvailableUpgradeVersions) + populate(objectMap, "backupRetentionPeriodInDays", a.BackupRetentionPeriodInDays) + populate(objectMap, "cpuCoreCount", a.CPUCoreCount) + populate(objectMap, "characterSet", a.CharacterSet) + populate(objectMap, "computeCount", a.ComputeCount) + populate(objectMap, "computeModel", a.ComputeModel) + populate(objectMap, "connectionStrings", a.ConnectionStrings) + populate(objectMap, "connectionUrls", a.ConnectionUrls) + populate(objectMap, "customerContacts", a.CustomerContacts) + objectMap["dataBaseType"] = DataBaseTypeRegular + populate(objectMap, "dataSafeStatus", a.DataSafeStatus) + populate(objectMap, "dataStorageSizeInGbs", a.DataStorageSizeInGbs) + populate(objectMap, "dataStorageSizeInTbs", a.DataStorageSizeInTbs) + populate(objectMap, "databaseEdition", a.DatabaseEdition) + populate(objectMap, "dbVersion", a.DbVersion) + populate(objectMap, "dbWorkload", a.DbWorkload) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "failedDataRecoveryInSeconds", a.FailedDataRecoveryInSeconds) + populate(objectMap, "inMemoryAreaInGbs", a.InMemoryAreaInGbs) + populate(objectMap, "isAutoScalingEnabled", a.IsAutoScalingEnabled) + populate(objectMap, "isAutoScalingForStorageEnabled", a.IsAutoScalingForStorageEnabled) + populate(objectMap, "isLocalDataGuardEnabled", a.IsLocalDataGuardEnabled) + populate(objectMap, "isMtlsConnectionRequired", a.IsMtlsConnectionRequired) + populate(objectMap, "isPreview", a.IsPreview) + populate(objectMap, "isPreviewVersionWithServiceTermsAccepted", a.IsPreviewVersionWithServiceTermsAccepted) + populate(objectMap, "isRemoteDataGuardEnabled", a.IsRemoteDataGuardEnabled) + populate(objectMap, "licenseModel", a.LicenseModel) + populate(objectMap, "lifecycleDetails", a.LifecycleDetails) + populate(objectMap, "lifecycleState", a.LifecycleState) + populate(objectMap, "localAdgAutoFailoverMaxDataLossLimit", a.LocalAdgAutoFailoverMaxDataLossLimit) + populate(objectMap, "localDisasterRecoveryType", a.LocalDisasterRecoveryType) + populate(objectMap, "localStandbyDb", a.LocalStandbyDb) + populate(objectMap, "longTermBackupSchedule", a.LongTermBackupSchedule) + populate(objectMap, "memoryPerOracleComputeUnitInGbs", a.MemoryPerOracleComputeUnitInGbs) + populate(objectMap, "ncharacterSet", a.NcharacterSet) + populateDateTimeRFC3339(objectMap, "nextLongTermBackupTimeStamp", a.NextLongTermBackupTimeStamp) + populate(objectMap, "ociUrl", a.OciURL) + populate(objectMap, "ocid", a.Ocid) + populate(objectMap, "openMode", a.OpenMode) + populate(objectMap, "operationsInsightsStatus", a.OperationsInsightsStatus) + populate(objectMap, "peerDbId", a.PeerDbID) + populate(objectMap, "peerDbIds", a.PeerDbIDs) + populate(objectMap, "permissionLevel", a.PermissionLevel) + populate(objectMap, "privateEndpoint", a.PrivateEndpoint) + populate(objectMap, "privateEndpointIp", a.PrivateEndpointIP) + populate(objectMap, "privateEndpointLabel", a.PrivateEndpointLabel) + populate(objectMap, "provisionableCpus", a.ProvisionableCpus) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "remoteDisasterRecoveryConfiguration", a.RemoteDisasterRecoveryConfiguration) + populate(objectMap, "role", a.Role) + populate(objectMap, "sqlWebDeveloperUrl", a.SQLWebDeveloperURL) + populate(objectMap, "scheduledOperations", a.ScheduledOperations) + populate(objectMap, "serviceConsoleUrl", a.ServiceConsoleURL) + populate(objectMap, "subnetId", a.SubnetID) + populate(objectMap, "supportedRegionsToCloneTo", a.SupportedRegionsToCloneTo) + populateDateTimeRFC3339(objectMap, "timeCreated", a.TimeCreated) + populate(objectMap, "timeDataGuardRoleChanged", a.TimeDataGuardRoleChanged) + populate(objectMap, "timeDeletionOfFreeAutonomousDatabase", a.TimeDeletionOfFreeAutonomousDatabase) + populateDateTimeRFC3339(objectMap, "timeDisasterRecoveryRoleChanged", a.TimeDisasterRecoveryRoleChanged) + populate(objectMap, "timeLocalDataGuardEnabled", a.TimeLocalDataGuardEnabled) + populateDateTimeRFC3339(objectMap, "timeMaintenanceBegin", a.TimeMaintenanceBegin) + populateDateTimeRFC3339(objectMap, "timeMaintenanceEnd", a.TimeMaintenanceEnd) + populate(objectMap, "timeOfLastFailover", a.TimeOfLastFailover) + populate(objectMap, "timeOfLastRefresh", a.TimeOfLastRefresh) + populate(objectMap, "timeOfLastRefreshPoint", a.TimeOfLastRefreshPoint) + populate(objectMap, "timeOfLastSwitchover", a.TimeOfLastSwitchover) + populate(objectMap, "timeReclamationOfFreeAutonomousDatabase", a.TimeReclamationOfFreeAutonomousDatabase) + populate(objectMap, "usedDataStorageSizeInGbs", a.UsedDataStorageSizeInGbs) + populate(objectMap, "usedDataStorageSizeInTbs", a.UsedDataStorageSizeInTbs) + populate(objectMap, "vnetId", a.VnetID) + populate(objectMap, "whitelistedIps", a.WhitelistedIPs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructureProperties. -func (c *CloudExadataInfrastructureProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseProperties. +func (a *AutonomousDatabaseProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "activatedStorageCount": - err = unpopulate(val, "ActivatedStorageCount", &c.ActivatedStorageCount) + case "actualUsedDataStorageSizeInTbs": + err = unpopulate(val, "ActualUsedDataStorageSizeInTbs", &a.ActualUsedDataStorageSizeInTbs) delete(rawMsg, key) - case "additionalStorageCount": - err = unpopulate(val, "AdditionalStorageCount", &c.AdditionalStorageCount) + case "adminPassword": + err = unpopulate(val, "AdminPassword", &a.AdminPassword) delete(rawMsg, key) - case "availableStorageSizeInGbs": - err = unpopulate(val, "AvailableStorageSizeInGbs", &c.AvailableStorageSizeInGbs) + case "allocatedStorageSizeInTbs": + err = unpopulate(val, "AllocatedStorageSizeInTbs", &a.AllocatedStorageSizeInTbs) delete(rawMsg, key) - case "cpuCount": - err = unpopulate(val, "CPUCount", &c.CPUCount) + case "apexDetails": + err = unpopulate(val, "ApexDetails", &a.ApexDetails) + delete(rawMsg, key) + case "autonomousDatabaseId": + err = unpopulate(val, "AutonomousDatabaseID", &a.AutonomousDatabaseID) + delete(rawMsg, key) + case "autonomousMaintenanceScheduleType": + err = unpopulate(val, "AutonomousMaintenanceScheduleType", &a.AutonomousMaintenanceScheduleType) + delete(rawMsg, key) + case "availableUpgradeVersions": + err = unpopulate(val, "AvailableUpgradeVersions", &a.AvailableUpgradeVersions) + delete(rawMsg, key) + case "backupRetentionPeriodInDays": + err = unpopulate(val, "BackupRetentionPeriodInDays", &a.BackupRetentionPeriodInDays) + delete(rawMsg, key) + case "cpuCoreCount": + err = unpopulate(val, "CPUCoreCount", &a.CPUCoreCount) + delete(rawMsg, key) + case "characterSet": + err = unpopulate(val, "CharacterSet", &a.CharacterSet) delete(rawMsg, key) case "computeCount": - err = unpopulate(val, "ComputeCount", &c.ComputeCount) + err = unpopulate(val, "ComputeCount", &a.ComputeCount) + delete(rawMsg, key) + case "computeModel": + err = unpopulate(val, "ComputeModel", &a.ComputeModel) + delete(rawMsg, key) + case "connectionStrings": + err = unpopulate(val, "ConnectionStrings", &a.ConnectionStrings) + delete(rawMsg, key) + case "connectionUrls": + err = unpopulate(val, "ConnectionUrls", &a.ConnectionUrls) delete(rawMsg, key) case "customerContacts": - err = unpopulate(val, "CustomerContacts", &c.CustomerContacts) + err = unpopulate(val, "CustomerContacts", &a.CustomerContacts) + delete(rawMsg, key) + case "dataBaseType": + err = unpopulate(val, "DataBaseType", &a.DataBaseType) + delete(rawMsg, key) + case "dataSafeStatus": + err = unpopulate(val, "DataSafeStatus", &a.DataSafeStatus) + delete(rawMsg, key) + case "dataStorageSizeInGbs": + err = unpopulate(val, "DataStorageSizeInGbs", &a.DataStorageSizeInGbs) delete(rawMsg, key) case "dataStorageSizeInTbs": - err = unpopulate(val, "DataStorageSizeInTbs", &c.DataStorageSizeInTbs) + err = unpopulate(val, "DataStorageSizeInTbs", &a.DataStorageSizeInTbs) delete(rawMsg, key) - case "dbNodeStorageSizeInGbs": - err = unpopulate(val, "DbNodeStorageSizeInGbs", &c.DbNodeStorageSizeInGbs) + case "databaseEdition": + err = unpopulate(val, "DatabaseEdition", &a.DatabaseEdition) delete(rawMsg, key) - case "dbServerVersion": - err = unpopulate(val, "DbServerVersion", &c.DbServerVersion) + case "dbVersion": + err = unpopulate(val, "DbVersion", &a.DbVersion) + delete(rawMsg, key) + case "dbWorkload": + err = unpopulate(val, "DbWorkload", &a.DbWorkload) delete(rawMsg, key) case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) + err = unpopulate(val, "DisplayName", &a.DisplayName) delete(rawMsg, key) - case "estimatedPatchingTime": - err = unpopulate(val, "EstimatedPatchingTime", &c.EstimatedPatchingTime) + case "failedDataRecoveryInSeconds": + err = unpopulate(val, "FailedDataRecoveryInSeconds", &a.FailedDataRecoveryInSeconds) delete(rawMsg, key) - case "lastMaintenanceRunId": - err = unpopulate(val, "LastMaintenanceRunID", &c.LastMaintenanceRunID) + case "inMemoryAreaInGbs": + err = unpopulate(val, "InMemoryAreaInGbs", &a.InMemoryAreaInGbs) + delete(rawMsg, key) + case "isAutoScalingEnabled": + err = unpopulate(val, "IsAutoScalingEnabled", &a.IsAutoScalingEnabled) + delete(rawMsg, key) + case "isAutoScalingForStorageEnabled": + err = unpopulate(val, "IsAutoScalingForStorageEnabled", &a.IsAutoScalingForStorageEnabled) + delete(rawMsg, key) + case "isLocalDataGuardEnabled": + err = unpopulate(val, "IsLocalDataGuardEnabled", &a.IsLocalDataGuardEnabled) + delete(rawMsg, key) + case "isMtlsConnectionRequired": + err = unpopulate(val, "IsMtlsConnectionRequired", &a.IsMtlsConnectionRequired) + delete(rawMsg, key) + case "isPreview": + err = unpopulate(val, "IsPreview", &a.IsPreview) + delete(rawMsg, key) + case "isPreviewVersionWithServiceTermsAccepted": + err = unpopulate(val, "IsPreviewVersionWithServiceTermsAccepted", &a.IsPreviewVersionWithServiceTermsAccepted) + delete(rawMsg, key) + case "isRemoteDataGuardEnabled": + err = unpopulate(val, "IsRemoteDataGuardEnabled", &a.IsRemoteDataGuardEnabled) + delete(rawMsg, key) + case "licenseModel": + err = unpopulate(val, "LicenseModel", &a.LicenseModel) delete(rawMsg, key) case "lifecycleDetails": - err = unpopulate(val, "LifecycleDetails", &c.LifecycleDetails) + err = unpopulate(val, "LifecycleDetails", &a.LifecycleDetails) delete(rawMsg, key) case "lifecycleState": - err = unpopulate(val, "LifecycleState", &c.LifecycleState) + err = unpopulate(val, "LifecycleState", &a.LifecycleState) delete(rawMsg, key) - case "maintenanceWindow": - err = unpopulate(val, "MaintenanceWindow", &c.MaintenanceWindow) + case "localAdgAutoFailoverMaxDataLossLimit": + err = unpopulate(val, "LocalAdgAutoFailoverMaxDataLossLimit", &a.LocalAdgAutoFailoverMaxDataLossLimit) delete(rawMsg, key) - case "maxCpuCount": - err = unpopulate(val, "MaxCPUCount", &c.MaxCPUCount) + case "localDisasterRecoveryType": + err = unpopulate(val, "LocalDisasterRecoveryType", &a.LocalDisasterRecoveryType) delete(rawMsg, key) - case "maxDataStorageInTbs": - err = unpopulate(val, "MaxDataStorageInTbs", &c.MaxDataStorageInTbs) + case "localStandbyDb": + err = unpopulate(val, "LocalStandbyDb", &a.LocalStandbyDb) delete(rawMsg, key) - case "maxDbNodeStorageSizeInGbs": - err = unpopulate(val, "MaxDbNodeStorageSizeInGbs", &c.MaxDbNodeStorageSizeInGbs) + case "longTermBackupSchedule": + err = unpopulate(val, "LongTermBackupSchedule", &a.LongTermBackupSchedule) delete(rawMsg, key) - case "maxMemoryInGbs": - err = unpopulate(val, "MaxMemoryInGbs", &c.MaxMemoryInGbs) + case "memoryPerOracleComputeUnitInGbs": + err = unpopulate(val, "MemoryPerOracleComputeUnitInGbs", &a.MemoryPerOracleComputeUnitInGbs) delete(rawMsg, key) - case "memorySizeInGbs": - err = unpopulate(val, "MemorySizeInGbs", &c.MemorySizeInGbs) + case "ncharacterSet": + err = unpopulate(val, "NcharacterSet", &a.NcharacterSet) delete(rawMsg, key) - case "monthlyDbServerVersion": - err = unpopulate(val, "MonthlyDbServerVersion", &c.MonthlyDbServerVersion) + case "nextLongTermBackupTimeStamp": + err = unpopulateDateTimeRFC3339(val, "NextLongTermBackupTimeStamp", &a.NextLongTermBackupTimeStamp) delete(rawMsg, key) - case "monthlyStorageServerVersion": - err = unpopulate(val, "MonthlyStorageServerVersion", &c.MonthlyStorageServerVersion) + case "ociUrl": + err = unpopulate(val, "OciURL", &a.OciURL) delete(rawMsg, key) - case "nextMaintenanceRunId": - err = unpopulate(val, "NextMaintenanceRunID", &c.NextMaintenanceRunID) + case "ocid": + err = unpopulate(val, "Ocid", &a.Ocid) + delete(rawMsg, key) + case "openMode": + err = unpopulate(val, "OpenMode", &a.OpenMode) + delete(rawMsg, key) + case "operationsInsightsStatus": + err = unpopulate(val, "OperationsInsightsStatus", &a.OperationsInsightsStatus) + delete(rawMsg, key) + case "peerDbId": + err = unpopulate(val, "PeerDbID", &a.PeerDbID) + delete(rawMsg, key) + case "peerDbIds": + err = unpopulate(val, "PeerDbIDs", &a.PeerDbIDs) + delete(rawMsg, key) + case "permissionLevel": + err = unpopulate(val, "PermissionLevel", &a.PermissionLevel) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &a.PrivateEndpoint) + delete(rawMsg, key) + case "privateEndpointIp": + err = unpopulate(val, "PrivateEndpointIP", &a.PrivateEndpointIP) + delete(rawMsg, key) + case "privateEndpointLabel": + err = unpopulate(val, "PrivateEndpointLabel", &a.PrivateEndpointLabel) + delete(rawMsg, key) + case "provisionableCpus": + err = unpopulate(val, "ProvisionableCpus", &a.ProvisionableCpus) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "remoteDisasterRecoveryConfiguration": + err = unpopulate(val, "RemoteDisasterRecoveryConfiguration", &a.RemoteDisasterRecoveryConfiguration) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &a.Role) + delete(rawMsg, key) + case "sqlWebDeveloperUrl": + err = unpopulate(val, "SQLWebDeveloperURL", &a.SQLWebDeveloperURL) + delete(rawMsg, key) + case "scheduledOperations": + err = unpopulate(val, "ScheduledOperations", &a.ScheduledOperations) + delete(rawMsg, key) + case "serviceConsoleUrl": + err = unpopulate(val, "ServiceConsoleURL", &a.ServiceConsoleURL) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &a.SubnetID) + delete(rawMsg, key) + case "supportedRegionsToCloneTo": + err = unpopulate(val, "SupportedRegionsToCloneTo", &a.SupportedRegionsToCloneTo) + delete(rawMsg, key) + case "timeCreated": + err = unpopulateDateTimeRFC3339(val, "TimeCreated", &a.TimeCreated) + delete(rawMsg, key) + case "timeDataGuardRoleChanged": + err = unpopulate(val, "TimeDataGuardRoleChanged", &a.TimeDataGuardRoleChanged) + delete(rawMsg, key) + case "timeDeletionOfFreeAutonomousDatabase": + err = unpopulate(val, "TimeDeletionOfFreeAutonomousDatabase", &a.TimeDeletionOfFreeAutonomousDatabase) + delete(rawMsg, key) + case "timeDisasterRecoveryRoleChanged": + err = unpopulateDateTimeRFC3339(val, "TimeDisasterRecoveryRoleChanged", &a.TimeDisasterRecoveryRoleChanged) + delete(rawMsg, key) + case "timeLocalDataGuardEnabled": + err = unpopulate(val, "TimeLocalDataGuardEnabled", &a.TimeLocalDataGuardEnabled) + delete(rawMsg, key) + case "timeMaintenanceBegin": + err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceBegin", &a.TimeMaintenanceBegin) + delete(rawMsg, key) + case "timeMaintenanceEnd": + err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceEnd", &a.TimeMaintenanceEnd) + delete(rawMsg, key) + case "timeOfLastFailover": + err = unpopulate(val, "TimeOfLastFailover", &a.TimeOfLastFailover) + delete(rawMsg, key) + case "timeOfLastRefresh": + err = unpopulate(val, "TimeOfLastRefresh", &a.TimeOfLastRefresh) + delete(rawMsg, key) + case "timeOfLastRefreshPoint": + err = unpopulate(val, "TimeOfLastRefreshPoint", &a.TimeOfLastRefreshPoint) + delete(rawMsg, key) + case "timeOfLastSwitchover": + err = unpopulate(val, "TimeOfLastSwitchover", &a.TimeOfLastSwitchover) + delete(rawMsg, key) + case "timeReclamationOfFreeAutonomousDatabase": + err = unpopulate(val, "TimeReclamationOfFreeAutonomousDatabase", &a.TimeReclamationOfFreeAutonomousDatabase) + delete(rawMsg, key) + case "usedDataStorageSizeInGbs": + err = unpopulate(val, "UsedDataStorageSizeInGbs", &a.UsedDataStorageSizeInGbs) + delete(rawMsg, key) + case "usedDataStorageSizeInTbs": + err = unpopulate(val, "UsedDataStorageSizeInTbs", &a.UsedDataStorageSizeInTbs) + delete(rawMsg, key) + case "vnetId": + err = unpopulate(val, "VnetID", &a.VnetID) + delete(rawMsg, key) + case "whitelistedIps": + err = unpopulate(val, "WhitelistedIPs", &a.WhitelistedIPs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseStandbySummary. +func (a AutonomousDatabaseStandbySummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "lagTimeInSeconds", a.LagTimeInSeconds) + populate(objectMap, "lifecycleDetails", a.LifecycleDetails) + populate(objectMap, "lifecycleState", a.LifecycleState) + populate(objectMap, "timeDataGuardRoleChanged", a.TimeDataGuardRoleChanged) + populate(objectMap, "timeDisasterRecoveryRoleChanged", a.TimeDisasterRecoveryRoleChanged) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseStandbySummary. +func (a *AutonomousDatabaseStandbySummary) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lagTimeInSeconds": + err = unpopulate(val, "LagTimeInSeconds", &a.LagTimeInSeconds) + delete(rawMsg, key) + case "lifecycleDetails": + err = unpopulate(val, "LifecycleDetails", &a.LifecycleDetails) + delete(rawMsg, key) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &a.LifecycleState) + delete(rawMsg, key) + case "timeDataGuardRoleChanged": + err = unpopulate(val, "TimeDataGuardRoleChanged", &a.TimeDataGuardRoleChanged) + delete(rawMsg, key) + case "timeDisasterRecoveryRoleChanged": + err = unpopulate(val, "TimeDisasterRecoveryRoleChanged", &a.TimeDisasterRecoveryRoleChanged) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseUpdate. +func (a AutonomousDatabaseUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseUpdate. +func (a *AutonomousDatabaseUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseUpdateProperties. +func (a AutonomousDatabaseUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "adminPassword", a.AdminPassword) + populate(objectMap, "autonomousMaintenanceScheduleType", a.AutonomousMaintenanceScheduleType) + populate(objectMap, "backupRetentionPeriodInDays", a.BackupRetentionPeriodInDays) + populate(objectMap, "cpuCoreCount", a.CPUCoreCount) + populate(objectMap, "computeCount", a.ComputeCount) + populate(objectMap, "customerContacts", a.CustomerContacts) + populate(objectMap, "dataStorageSizeInGbs", a.DataStorageSizeInGbs) + populate(objectMap, "dataStorageSizeInTbs", a.DataStorageSizeInTbs) + populate(objectMap, "databaseEdition", a.DatabaseEdition) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "isAutoScalingEnabled", a.IsAutoScalingEnabled) + populate(objectMap, "isAutoScalingForStorageEnabled", a.IsAutoScalingForStorageEnabled) + populate(objectMap, "isLocalDataGuardEnabled", a.IsLocalDataGuardEnabled) + populate(objectMap, "isMtlsConnectionRequired", a.IsMtlsConnectionRequired) + populate(objectMap, "licenseModel", a.LicenseModel) + populate(objectMap, "localAdgAutoFailoverMaxDataLossLimit", a.LocalAdgAutoFailoverMaxDataLossLimit) + populate(objectMap, "longTermBackupSchedule", a.LongTermBackupSchedule) + populate(objectMap, "openMode", a.OpenMode) + populate(objectMap, "peerDbId", a.PeerDbID) + populate(objectMap, "permissionLevel", a.PermissionLevel) + populate(objectMap, "role", a.Role) + populate(objectMap, "scheduledOperations", a.ScheduledOperations) + populate(objectMap, "whitelistedIps", a.WhitelistedIPs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseUpdateProperties. +func (a *AutonomousDatabaseUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "adminPassword": + err = unpopulate(val, "AdminPassword", &a.AdminPassword) + delete(rawMsg, key) + case "autonomousMaintenanceScheduleType": + err = unpopulate(val, "AutonomousMaintenanceScheduleType", &a.AutonomousMaintenanceScheduleType) + delete(rawMsg, key) + case "backupRetentionPeriodInDays": + err = unpopulate(val, "BackupRetentionPeriodInDays", &a.BackupRetentionPeriodInDays) + delete(rawMsg, key) + case "cpuCoreCount": + err = unpopulate(val, "CPUCoreCount", &a.CPUCoreCount) + delete(rawMsg, key) + case "computeCount": + err = unpopulate(val, "ComputeCount", &a.ComputeCount) + delete(rawMsg, key) + case "customerContacts": + err = unpopulate(val, "CustomerContacts", &a.CustomerContacts) + delete(rawMsg, key) + case "dataStorageSizeInGbs": + err = unpopulate(val, "DataStorageSizeInGbs", &a.DataStorageSizeInGbs) + delete(rawMsg, key) + case "dataStorageSizeInTbs": + err = unpopulate(val, "DataStorageSizeInTbs", &a.DataStorageSizeInTbs) + delete(rawMsg, key) + case "databaseEdition": + err = unpopulate(val, "DatabaseEdition", &a.DatabaseEdition) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "isAutoScalingEnabled": + err = unpopulate(val, "IsAutoScalingEnabled", &a.IsAutoScalingEnabled) + delete(rawMsg, key) + case "isAutoScalingForStorageEnabled": + err = unpopulate(val, "IsAutoScalingForStorageEnabled", &a.IsAutoScalingForStorageEnabled) + delete(rawMsg, key) + case "isLocalDataGuardEnabled": + err = unpopulate(val, "IsLocalDataGuardEnabled", &a.IsLocalDataGuardEnabled) + delete(rawMsg, key) + case "isMtlsConnectionRequired": + err = unpopulate(val, "IsMtlsConnectionRequired", &a.IsMtlsConnectionRequired) + delete(rawMsg, key) + case "licenseModel": + err = unpopulate(val, "LicenseModel", &a.LicenseModel) + delete(rawMsg, key) + case "localAdgAutoFailoverMaxDataLossLimit": + err = unpopulate(val, "LocalAdgAutoFailoverMaxDataLossLimit", &a.LocalAdgAutoFailoverMaxDataLossLimit) + delete(rawMsg, key) + case "longTermBackupSchedule": + err = unpopulate(val, "LongTermBackupSchedule", &a.LongTermBackupSchedule) + delete(rawMsg, key) + case "openMode": + err = unpopulate(val, "OpenMode", &a.OpenMode) + delete(rawMsg, key) + case "peerDbId": + err = unpopulate(val, "PeerDbID", &a.PeerDbID) + delete(rawMsg, key) + case "permissionLevel": + err = unpopulate(val, "PermissionLevel", &a.PermissionLevel) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &a.Role) + delete(rawMsg, key) + case "scheduledOperations": + err = unpopulate(val, "ScheduledOperations", &a.ScheduledOperations) + delete(rawMsg, key) + case "whitelistedIps": + err = unpopulate(val, "WhitelistedIPs", &a.WhitelistedIPs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutonomousDatabaseWalletFile. +func (a AutonomousDatabaseWalletFile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "walletFiles", a.WalletFiles) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDatabaseWalletFile. +func (a *AutonomousDatabaseWalletFile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "walletFiles": + err = unpopulate(val, "WalletFiles", &a.WalletFiles) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutonomousDbVersion. +func (a AutonomousDbVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDbVersion. +func (a *AutonomousDbVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutonomousDbVersionListResult. +func (a AutonomousDbVersionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDbVersionListResult. +func (a *AutonomousDbVersionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutonomousDbVersionProperties. +func (a AutonomousDbVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dbWorkload", a.DbWorkload) + populate(objectMap, "isDefaultForFree", a.IsDefaultForFree) + populate(objectMap, "isDefaultForPaid", a.IsDefaultForPaid) + populate(objectMap, "isFreeTierEnabled", a.IsFreeTierEnabled) + populate(objectMap, "isPaidEnabled", a.IsPaidEnabled) + populate(objectMap, "version", a.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutonomousDbVersionProperties. +func (a *AutonomousDbVersionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dbWorkload": + err = unpopulate(val, "DbWorkload", &a.DbWorkload) + delete(rawMsg, key) + case "isDefaultForFree": + err = unpopulate(val, "IsDefaultForFree", &a.IsDefaultForFree) + delete(rawMsg, key) + case "isDefaultForPaid": + err = unpopulate(val, "IsDefaultForPaid", &a.IsDefaultForPaid) + delete(rawMsg, key) + case "isFreeTierEnabled": + err = unpopulate(val, "IsFreeTierEnabled", &a.IsFreeTierEnabled) + delete(rawMsg, key) + case "isPaidEnabled": + err = unpopulate(val, "IsPaidEnabled", &a.IsPaidEnabled) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &a.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureSubscriptions. +func (a AzureSubscriptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureSubscriptionIds", a.AzureSubscriptionIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSubscriptions. +func (a *AzureSubscriptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureSubscriptionIds": + err = unpopulate(val, "AzureSubscriptionIDs", &a.AzureSubscriptionIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudAccountDetails. +func (c CloudAccountDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cloudAccountHomeRegion", c.CloudAccountHomeRegion) + populate(objectMap, "cloudAccountName", c.CloudAccountName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudAccountDetails. +func (c *CloudAccountDetails) 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 "cloudAccountHomeRegion": + err = unpopulate(val, "CloudAccountHomeRegion", &c.CloudAccountHomeRegion) + delete(rawMsg, key) + case "cloudAccountName": + err = unpopulate(val, "CloudAccountName", &c.CloudAccountName) + 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 CloudExadataInfrastructure. +func (c CloudExadataInfrastructure) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + populate(objectMap, "zones", c.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructure. +func (c *CloudExadataInfrastructure) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &c.Zones) + 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 CloudExadataInfrastructureListResult. +func (c CloudExadataInfrastructureListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructureListResult. +func (c *CloudExadataInfrastructureListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudExadataInfrastructureProperties. +func (c CloudExadataInfrastructureProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activatedStorageCount", c.ActivatedStorageCount) + populate(objectMap, "additionalStorageCount", c.AdditionalStorageCount) + populate(objectMap, "availableStorageSizeInGbs", c.AvailableStorageSizeInGbs) + populate(objectMap, "cpuCount", c.CPUCount) + populate(objectMap, "computeCount", c.ComputeCount) + populate(objectMap, "computeModel", c.ComputeModel) + populate(objectMap, "customerContacts", c.CustomerContacts) + populate(objectMap, "dataStorageSizeInTbs", c.DataStorageSizeInTbs) + populate(objectMap, "databaseServerType", c.DatabaseServerType) + populate(objectMap, "dbNodeStorageSizeInGbs", c.DbNodeStorageSizeInGbs) + populate(objectMap, "dbServerVersion", c.DbServerVersion) + populate(objectMap, "definedFileSystemConfiguration", c.DefinedFileSystemConfiguration) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "estimatedPatchingTime", c.EstimatedPatchingTime) + populate(objectMap, "lastMaintenanceRunId", c.LastMaintenanceRunID) + populate(objectMap, "lifecycleDetails", c.LifecycleDetails) + populate(objectMap, "lifecycleState", c.LifecycleState) + populate(objectMap, "maintenanceWindow", c.MaintenanceWindow) + populate(objectMap, "maxCpuCount", c.MaxCPUCount) + populate(objectMap, "maxDataStorageInTbs", c.MaxDataStorageInTbs) + populate(objectMap, "maxDbNodeStorageSizeInGbs", c.MaxDbNodeStorageSizeInGbs) + populate(objectMap, "maxMemoryInGbs", c.MaxMemoryInGbs) + populate(objectMap, "memorySizeInGbs", c.MemorySizeInGbs) + populate(objectMap, "monthlyDbServerVersion", c.MonthlyDbServerVersion) + populate(objectMap, "monthlyStorageServerVersion", c.MonthlyStorageServerVersion) + populate(objectMap, "nextMaintenanceRunId", c.NextMaintenanceRunID) + populate(objectMap, "ociUrl", c.OciURL) + populate(objectMap, "ocid", c.Ocid) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "shape", c.Shape) + populate(objectMap, "storageCount", c.StorageCount) + populate(objectMap, "storageServerType", c.StorageServerType) + populate(objectMap, "storageServerVersion", c.StorageServerVersion) + populate(objectMap, "timeCreated", c.TimeCreated) + populate(objectMap, "totalStorageSizeInGbs", c.TotalStorageSizeInGbs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructureProperties. +func (c *CloudExadataInfrastructureProperties) 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 "activatedStorageCount": + err = unpopulate(val, "ActivatedStorageCount", &c.ActivatedStorageCount) + delete(rawMsg, key) + case "additionalStorageCount": + err = unpopulate(val, "AdditionalStorageCount", &c.AdditionalStorageCount) + delete(rawMsg, key) + case "availableStorageSizeInGbs": + err = unpopulate(val, "AvailableStorageSizeInGbs", &c.AvailableStorageSizeInGbs) + delete(rawMsg, key) + case "cpuCount": + err = unpopulate(val, "CPUCount", &c.CPUCount) + delete(rawMsg, key) + case "computeCount": + err = unpopulate(val, "ComputeCount", &c.ComputeCount) + delete(rawMsg, key) + case "computeModel": + err = unpopulate(val, "ComputeModel", &c.ComputeModel) + delete(rawMsg, key) + case "customerContacts": + err = unpopulate(val, "CustomerContacts", &c.CustomerContacts) + delete(rawMsg, key) + case "dataStorageSizeInTbs": + err = unpopulate(val, "DataStorageSizeInTbs", &c.DataStorageSizeInTbs) + delete(rawMsg, key) + case "databaseServerType": + err = unpopulate(val, "DatabaseServerType", &c.DatabaseServerType) + delete(rawMsg, key) + case "dbNodeStorageSizeInGbs": + err = unpopulate(val, "DbNodeStorageSizeInGbs", &c.DbNodeStorageSizeInGbs) + delete(rawMsg, key) + case "dbServerVersion": + err = unpopulate(val, "DbServerVersion", &c.DbServerVersion) + delete(rawMsg, key) + case "definedFileSystemConfiguration": + err = unpopulate(val, "DefinedFileSystemConfiguration", &c.DefinedFileSystemConfiguration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "estimatedPatchingTime": + err = unpopulate(val, "EstimatedPatchingTime", &c.EstimatedPatchingTime) + delete(rawMsg, key) + case "lastMaintenanceRunId": + err = unpopulate(val, "LastMaintenanceRunID", &c.LastMaintenanceRunID) + delete(rawMsg, key) + case "lifecycleDetails": + err = unpopulate(val, "LifecycleDetails", &c.LifecycleDetails) + delete(rawMsg, key) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &c.LifecycleState) + delete(rawMsg, key) + case "maintenanceWindow": + err = unpopulate(val, "MaintenanceWindow", &c.MaintenanceWindow) + delete(rawMsg, key) + case "maxCpuCount": + err = unpopulate(val, "MaxCPUCount", &c.MaxCPUCount) + delete(rawMsg, key) + case "maxDataStorageInTbs": + err = unpopulate(val, "MaxDataStorageInTbs", &c.MaxDataStorageInTbs) + delete(rawMsg, key) + case "maxDbNodeStorageSizeInGbs": + err = unpopulate(val, "MaxDbNodeStorageSizeInGbs", &c.MaxDbNodeStorageSizeInGbs) + delete(rawMsg, key) + case "maxMemoryInGbs": + err = unpopulate(val, "MaxMemoryInGbs", &c.MaxMemoryInGbs) + delete(rawMsg, key) + case "memorySizeInGbs": + err = unpopulate(val, "MemorySizeInGbs", &c.MemorySizeInGbs) + delete(rawMsg, key) + case "monthlyDbServerVersion": + err = unpopulate(val, "MonthlyDbServerVersion", &c.MonthlyDbServerVersion) + delete(rawMsg, key) + case "monthlyStorageServerVersion": + err = unpopulate(val, "MonthlyStorageServerVersion", &c.MonthlyStorageServerVersion) + delete(rawMsg, key) + case "nextMaintenanceRunId": + err = unpopulate(val, "NextMaintenanceRunID", &c.NextMaintenanceRunID) + delete(rawMsg, key) + case "ociUrl": + err = unpopulate(val, "OciURL", &c.OciURL) + delete(rawMsg, key) + case "ocid": + err = unpopulate(val, "Ocid", &c.Ocid) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "shape": + err = unpopulate(val, "Shape", &c.Shape) + delete(rawMsg, key) + case "storageCount": + err = unpopulate(val, "StorageCount", &c.StorageCount) + delete(rawMsg, key) + case "storageServerType": + err = unpopulate(val, "StorageServerType", &c.StorageServerType) + delete(rawMsg, key) + case "storageServerVersion": + err = unpopulate(val, "StorageServerVersion", &c.StorageServerVersion) + delete(rawMsg, key) + case "timeCreated": + err = unpopulate(val, "TimeCreated", &c.TimeCreated) + delete(rawMsg, key) + case "totalStorageSizeInGbs": + err = unpopulate(val, "TotalStorageSizeInGbs", &c.TotalStorageSizeInGbs) + 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 CloudExadataInfrastructureUpdate. +func (c CloudExadataInfrastructureUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "zones", c.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructureUpdate. +func (c *CloudExadataInfrastructureUpdate) 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 "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &c.Zones) + 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 CloudExadataInfrastructureUpdateProperties. +func (c CloudExadataInfrastructureUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "computeCount", c.ComputeCount) + populate(objectMap, "customerContacts", c.CustomerContacts) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "maintenanceWindow", c.MaintenanceWindow) + populate(objectMap, "storageCount", c.StorageCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructureUpdateProperties. +func (c *CloudExadataInfrastructureUpdateProperties) 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 "computeCount": + err = unpopulate(val, "ComputeCount", &c.ComputeCount) + delete(rawMsg, key) + case "customerContacts": + err = unpopulate(val, "CustomerContacts", &c.CustomerContacts) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "maintenanceWindow": + err = unpopulate(val, "MaintenanceWindow", &c.MaintenanceWindow) + delete(rawMsg, key) + case "storageCount": + err = unpopulate(val, "StorageCount", &c.StorageCount) + 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 CloudVMCluster. +func (c CloudVMCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMCluster. +func (c *CloudVMCluster) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudVMClusterListResult. +func (c CloudVMClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMClusterListResult. +func (c *CloudVMClusterListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudVMClusterProperties. +func (c CloudVMClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupSubnetCidr", c.BackupSubnetCidr) + populate(objectMap, "cpuCoreCount", c.CPUCoreCount) + populate(objectMap, "cloudExadataInfrastructureId", c.CloudExadataInfrastructureID) + populate(objectMap, "clusterName", c.ClusterName) + populate(objectMap, "compartmentId", c.CompartmentID) + populate(objectMap, "computeModel", c.ComputeModel) + populate(objectMap, "computeNodes", c.ComputeNodes) + populate(objectMap, "dataCollectionOptions", c.DataCollectionOptions) + populate(objectMap, "dataStoragePercentage", c.DataStoragePercentage) + populate(objectMap, "dataStorageSizeInTbs", c.DataStorageSizeInTbs) + populate(objectMap, "dbNodeStorageSizeInGbs", c.DbNodeStorageSizeInGbs) + populate(objectMap, "dbServers", c.DbServers) + populate(objectMap, "diskRedundancy", c.DiskRedundancy) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "domain", c.Domain) + populate(objectMap, "fileSystemConfigurationDetails", c.FileSystemConfigurationDetails) + populate(objectMap, "giVersion", c.GiVersion) + populate(objectMap, "hostname", c.Hostname) + populate(objectMap, "iormConfigCache", c.IormConfigCache) + populate(objectMap, "isLocalBackupEnabled", c.IsLocalBackupEnabled) + populate(objectMap, "isSparseDiskgroupEnabled", c.IsSparseDiskgroupEnabled) + populate(objectMap, "lastUpdateHistoryEntryId", c.LastUpdateHistoryEntryID) + populate(objectMap, "licenseModel", c.LicenseModel) + populate(objectMap, "lifecycleDetails", c.LifecycleDetails) + populate(objectMap, "lifecycleState", c.LifecycleState) + populate(objectMap, "listenerPort", c.ListenerPort) + populate(objectMap, "memorySizeInGbs", c.MemorySizeInGbs) + populate(objectMap, "nodeCount", c.NodeCount) + populate(objectMap, "nsgCidrs", c.NsgCidrs) + populate(objectMap, "nsgUrl", c.NsgURL) + populate(objectMap, "ociUrl", c.OciURL) + populate(objectMap, "ocid", c.Ocid) + populate(objectMap, "ocpuCount", c.OcpuCount) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "sshPublicKeys", c.SSHPublicKeys) + populate(objectMap, "scanDnsName", c.ScanDNSName) + populate(objectMap, "scanDnsRecordId", c.ScanDNSRecordID) + populate(objectMap, "scanIpIds", c.ScanIPIDs) + populate(objectMap, "scanListenerPortTcp", c.ScanListenerPortTCP) + populate(objectMap, "scanListenerPortTcpSsl", c.ScanListenerPortTCPSSL) + populate(objectMap, "shape", c.Shape) + populate(objectMap, "storageSizeInGbs", c.StorageSizeInGbs) + populate(objectMap, "subnetId", c.SubnetID) + populate(objectMap, "subnetOcid", c.SubnetOcid) + populate(objectMap, "systemVersion", c.SystemVersion) + populateDateTimeRFC3339(objectMap, "timeCreated", c.TimeCreated) + populate(objectMap, "timeZone", c.TimeZone) + populate(objectMap, "vipIds", c.VipIDs) + populate(objectMap, "vnetId", c.VnetID) + populate(objectMap, "zoneId", c.ZoneID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMClusterProperties. +func (c *CloudVMClusterProperties) 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 "backupSubnetCidr": + err = unpopulate(val, "BackupSubnetCidr", &c.BackupSubnetCidr) + delete(rawMsg, key) + case "cpuCoreCount": + err = unpopulate(val, "CPUCoreCount", &c.CPUCoreCount) + delete(rawMsg, key) + case "cloudExadataInfrastructureId": + err = unpopulate(val, "CloudExadataInfrastructureID", &c.CloudExadataInfrastructureID) + delete(rawMsg, key) + case "clusterName": + err = unpopulate(val, "ClusterName", &c.ClusterName) + delete(rawMsg, key) + case "compartmentId": + err = unpopulate(val, "CompartmentID", &c.CompartmentID) + delete(rawMsg, key) + case "computeModel": + err = unpopulate(val, "ComputeModel", &c.ComputeModel) + delete(rawMsg, key) + case "computeNodes": + err = unpopulate(val, "ComputeNodes", &c.ComputeNodes) + delete(rawMsg, key) + case "dataCollectionOptions": + err = unpopulate(val, "DataCollectionOptions", &c.DataCollectionOptions) + delete(rawMsg, key) + case "dataStoragePercentage": + err = unpopulate(val, "DataStoragePercentage", &c.DataStoragePercentage) + delete(rawMsg, key) + case "dataStorageSizeInTbs": + err = unpopulate(val, "DataStorageSizeInTbs", &c.DataStorageSizeInTbs) + delete(rawMsg, key) + case "dbNodeStorageSizeInGbs": + err = unpopulate(val, "DbNodeStorageSizeInGbs", &c.DbNodeStorageSizeInGbs) + delete(rawMsg, key) + case "dbServers": + err = unpopulate(val, "DbServers", &c.DbServers) + delete(rawMsg, key) + case "diskRedundancy": + err = unpopulate(val, "DiskRedundancy", &c.DiskRedundancy) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "domain": + err = unpopulate(val, "Domain", &c.Domain) + delete(rawMsg, key) + case "fileSystemConfigurationDetails": + err = unpopulate(val, "FileSystemConfigurationDetails", &c.FileSystemConfigurationDetails) + delete(rawMsg, key) + case "giVersion": + err = unpopulate(val, "GiVersion", &c.GiVersion) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, "Hostname", &c.Hostname) + delete(rawMsg, key) + case "iormConfigCache": + err = unpopulate(val, "IormConfigCache", &c.IormConfigCache) + delete(rawMsg, key) + case "isLocalBackupEnabled": + err = unpopulate(val, "IsLocalBackupEnabled", &c.IsLocalBackupEnabled) + delete(rawMsg, key) + case "isSparseDiskgroupEnabled": + err = unpopulate(val, "IsSparseDiskgroupEnabled", &c.IsSparseDiskgroupEnabled) + delete(rawMsg, key) + case "lastUpdateHistoryEntryId": + err = unpopulate(val, "LastUpdateHistoryEntryID", &c.LastUpdateHistoryEntryID) + delete(rawMsg, key) + case "licenseModel": + err = unpopulate(val, "LicenseModel", &c.LicenseModel) + delete(rawMsg, key) + case "lifecycleDetails": + err = unpopulate(val, "LifecycleDetails", &c.LifecycleDetails) + delete(rawMsg, key) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &c.LifecycleState) + delete(rawMsg, key) + case "listenerPort": + err = unpopulate(val, "ListenerPort", &c.ListenerPort) + delete(rawMsg, key) + case "memorySizeInGbs": + err = unpopulate(val, "MemorySizeInGbs", &c.MemorySizeInGbs) + delete(rawMsg, key) + case "nodeCount": + err = unpopulate(val, "NodeCount", &c.NodeCount) + delete(rawMsg, key) + case "nsgCidrs": + err = unpopulate(val, "NsgCidrs", &c.NsgCidrs) + delete(rawMsg, key) + case "nsgUrl": + err = unpopulate(val, "NsgURL", &c.NsgURL) + delete(rawMsg, key) + case "ociUrl": + err = unpopulate(val, "OciURL", &c.OciURL) + delete(rawMsg, key) + case "ocid": + err = unpopulate(val, "Ocid", &c.Ocid) + delete(rawMsg, key) + case "ocpuCount": + err = unpopulate(val, "OcpuCount", &c.OcpuCount) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "sshPublicKeys": + err = unpopulate(val, "SSHPublicKeys", &c.SSHPublicKeys) + delete(rawMsg, key) + case "scanDnsName": + err = unpopulate(val, "ScanDNSName", &c.ScanDNSName) + delete(rawMsg, key) + case "scanDnsRecordId": + err = unpopulate(val, "ScanDNSRecordID", &c.ScanDNSRecordID) + delete(rawMsg, key) + case "scanIpIds": + err = unpopulate(val, "ScanIPIDs", &c.ScanIPIDs) + delete(rawMsg, key) + case "scanListenerPortTcp": + err = unpopulate(val, "ScanListenerPortTCP", &c.ScanListenerPortTCP) + delete(rawMsg, key) + case "scanListenerPortTcpSsl": + err = unpopulate(val, "ScanListenerPortTCPSSL", &c.ScanListenerPortTCPSSL) + delete(rawMsg, key) + case "shape": + err = unpopulate(val, "Shape", &c.Shape) + delete(rawMsg, key) + case "storageSizeInGbs": + err = unpopulate(val, "StorageSizeInGbs", &c.StorageSizeInGbs) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &c.SubnetID) + delete(rawMsg, key) + case "subnetOcid": + err = unpopulate(val, "SubnetOcid", &c.SubnetOcid) + delete(rawMsg, key) + case "systemVersion": + err = unpopulate(val, "SystemVersion", &c.SystemVersion) + delete(rawMsg, key) + case "timeCreated": + err = unpopulateDateTimeRFC3339(val, "TimeCreated", &c.TimeCreated) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &c.TimeZone) + delete(rawMsg, key) + case "vipIds": + err = unpopulate(val, "VipIDs", &c.VipIDs) + delete(rawMsg, key) + case "vnetId": + err = unpopulate(val, "VnetID", &c.VnetID) + delete(rawMsg, key) + case "zoneId": + err = unpopulate(val, "ZoneID", &c.ZoneID) + 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 CloudVMClusterUpdate. +func (c CloudVMClusterUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMClusterUpdate. +func (c *CloudVMClusterUpdate) 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 "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + 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 CloudVMClusterUpdateProperties. +func (c CloudVMClusterUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpuCoreCount", c.CPUCoreCount) + populate(objectMap, "computeNodes", c.ComputeNodes) + populate(objectMap, "dataCollectionOptions", c.DataCollectionOptions) + populate(objectMap, "dataStorageSizeInTbs", c.DataStorageSizeInTbs) + populate(objectMap, "dbNodeStorageSizeInGbs", c.DbNodeStorageSizeInGbs) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "fileSystemConfigurationDetails", c.FileSystemConfigurationDetails) + populate(objectMap, "licenseModel", c.LicenseModel) + populate(objectMap, "memorySizeInGbs", c.MemorySizeInGbs) + populate(objectMap, "ocpuCount", c.OcpuCount) + populate(objectMap, "sshPublicKeys", c.SSHPublicKeys) + populate(objectMap, "storageSizeInGbs", c.StorageSizeInGbs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMClusterUpdateProperties. +func (c *CloudVMClusterUpdateProperties) 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 "cpuCoreCount": + err = unpopulate(val, "CPUCoreCount", &c.CPUCoreCount) + delete(rawMsg, key) + case "computeNodes": + err = unpopulate(val, "ComputeNodes", &c.ComputeNodes) + delete(rawMsg, key) + case "dataCollectionOptions": + err = unpopulate(val, "DataCollectionOptions", &c.DataCollectionOptions) + delete(rawMsg, key) + case "dataStorageSizeInTbs": + err = unpopulate(val, "DataStorageSizeInTbs", &c.DataStorageSizeInTbs) + delete(rawMsg, key) + case "dbNodeStorageSizeInGbs": + err = unpopulate(val, "DbNodeStorageSizeInGbs", &c.DbNodeStorageSizeInGbs) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "fileSystemConfigurationDetails": + err = unpopulate(val, "FileSystemConfigurationDetails", &c.FileSystemConfigurationDetails) + delete(rawMsg, key) + case "licenseModel": + err = unpopulate(val, "LicenseModel", &c.LicenseModel) + delete(rawMsg, key) + case "memorySizeInGbs": + err = unpopulate(val, "MemorySizeInGbs", &c.MemorySizeInGbs) + delete(rawMsg, key) + case "ocpuCount": + err = unpopulate(val, "OcpuCount", &c.OcpuCount) + delete(rawMsg, key) + case "sshPublicKeys": + err = unpopulate(val, "SSHPublicKeys", &c.SSHPublicKeys) + delete(rawMsg, key) + case "storageSizeInGbs": + err = unpopulate(val, "StorageSizeInGbs", &c.StorageSizeInGbs) + 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 ConnectionStringType. +func (c ConnectionStringType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allConnectionStrings", c.AllConnectionStrings) + populate(objectMap, "dedicated", c.Dedicated) + populate(objectMap, "high", c.High) + populate(objectMap, "low", c.Low) + populate(objectMap, "medium", c.Medium) + populate(objectMap, "profiles", c.Profiles) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionStringType. +func (c *ConnectionStringType) 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 "allConnectionStrings": + err = unpopulate(val, "AllConnectionStrings", &c.AllConnectionStrings) + delete(rawMsg, key) + case "dedicated": + err = unpopulate(val, "Dedicated", &c.Dedicated) + delete(rawMsg, key) + case "high": + err = unpopulate(val, "High", &c.High) + delete(rawMsg, key) + case "low": + err = unpopulate(val, "Low", &c.Low) + delete(rawMsg, key) + case "medium": + err = unpopulate(val, "Medium", &c.Medium) + delete(rawMsg, key) + case "profiles": + err = unpopulate(val, "Profiles", &c.Profiles) + 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 ConnectionURLType. +func (c ConnectionURLType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apexUrl", c.ApexURL) + populate(objectMap, "databaseTransformsUrl", c.DatabaseTransformsURL) + populate(objectMap, "graphStudioUrl", c.GraphStudioURL) + populate(objectMap, "machineLearningNotebookUrl", c.MachineLearningNotebookURL) + populate(objectMap, "mongoDbUrl", c.MongoDbURL) + populate(objectMap, "ordsUrl", c.OrdsURL) + populate(objectMap, "sqlDevWebUrl", c.SQLDevWebURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionURLType. +func (c *ConnectionURLType) 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 "apexUrl": + err = unpopulate(val, "ApexURL", &c.ApexURL) + delete(rawMsg, key) + case "databaseTransformsUrl": + err = unpopulate(val, "DatabaseTransformsURL", &c.DatabaseTransformsURL) + delete(rawMsg, key) + case "graphStudioUrl": + err = unpopulate(val, "GraphStudioURL", &c.GraphStudioURL) + delete(rawMsg, key) + case "machineLearningNotebookUrl": + err = unpopulate(val, "MachineLearningNotebookURL", &c.MachineLearningNotebookURL) + delete(rawMsg, key) + case "mongoDbUrl": + err = unpopulate(val, "MongoDbURL", &c.MongoDbURL) + delete(rawMsg, key) + case "ordsUrl": + err = unpopulate(val, "OrdsURL", &c.OrdsURL) + delete(rawMsg, key) + case "sqlDevWebUrl": + err = unpopulate(val, "SQLDevWebURL", &c.SQLDevWebURL) + 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 CustomerContact. +func (c CustomerContact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "email", c.Email) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomerContact. +func (c *CustomerContact) 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 "email": + err = unpopulate(val, "Email", &c.Email) + 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 DNSPrivateView. +func (d DNSPrivateView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateView. +func (d *DNSPrivateView) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSPrivateViewListResult. +func (d DNSPrivateViewListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateViewListResult. +func (d *DNSPrivateViewListResult) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSPrivateViewProperties. +func (d DNSPrivateViewProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "isProtected", d.IsProtected) + populate(objectMap, "lifecycleState", d.LifecycleState) + populate(objectMap, "ocid", d.Ocid) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "self", d.Self) + populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) + populateDateTimeRFC3339(objectMap, "timeUpdated", d.TimeUpdated) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateViewProperties. +func (d *DNSPrivateViewProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "isProtected": + err = unpopulate(val, "IsProtected", &d.IsProtected) + delete(rawMsg, key) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &d.LifecycleState) + delete(rawMsg, key) + case "ocid": + err = unpopulate(val, "Ocid", &d.Ocid) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "self": + err = unpopulate(val, "Self", &d.Self) + delete(rawMsg, key) + case "timeCreated": + err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) + delete(rawMsg, key) + case "timeUpdated": + err = unpopulateDateTimeRFC3339(val, "TimeUpdated", &d.TimeUpdated) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSPrivateZone. +func (d DNSPrivateZone) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateZone. +func (d *DNSPrivateZone) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSPrivateZoneListResult. +func (d DNSPrivateZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateZoneListResult. +func (d *DNSPrivateZoneListResult) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSPrivateZoneProperties. +func (d DNSPrivateZoneProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isProtected", d.IsProtected) + populate(objectMap, "lifecycleState", d.LifecycleState) + populate(objectMap, "ocid", d.Ocid) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "self", d.Self) + populate(objectMap, "serial", d.Serial) + populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) + populate(objectMap, "version", d.Version) + populate(objectMap, "viewId", d.ViewID) + populate(objectMap, "zoneType", d.ZoneType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateZoneProperties. +func (d *DNSPrivateZoneProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isProtected": + err = unpopulate(val, "IsProtected", &d.IsProtected) delete(rawMsg, key) - case "ociUrl": - err = unpopulate(val, "OciURL", &c.OciURL) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &d.LifecycleState) delete(rawMsg, key) case "ocid": - err = unpopulate(val, "Ocid", &c.Ocid) + err = unpopulate(val, "Ocid", &d.Ocid) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "shape": - err = unpopulate(val, "Shape", &c.Shape) + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) - case "storageCount": - err = unpopulate(val, "StorageCount", &c.StorageCount) + case "self": + err = unpopulate(val, "Self", &d.Self) delete(rawMsg, key) - case "storageServerVersion": - err = unpopulate(val, "StorageServerVersion", &c.StorageServerVersion) + case "serial": + err = unpopulate(val, "Serial", &d.Serial) delete(rawMsg, key) case "timeCreated": - err = unpopulate(val, "TimeCreated", &c.TimeCreated) + err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) delete(rawMsg, key) - case "totalStorageSizeInGbs": - err = unpopulate(val, "TotalStorageSizeInGbs", &c.TotalStorageSizeInGbs) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + case "viewId": + err = unpopulate(val, "ViewID", &d.ViewID) + delete(rawMsg, key) + case "zoneType": + err = unpopulate(val, "ZoneType", &d.ZoneType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudExadataInfrastructureUpdate. -func (c CloudExadataInfrastructureUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataCollectionOptions. +func (d DataCollectionOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "zones", c.Zones) + populate(objectMap, "isDiagnosticsEventsEnabled", d.IsDiagnosticsEventsEnabled) + populate(objectMap, "isHealthMonitoringEnabled", d.IsHealthMonitoringEnabled) + populate(objectMap, "isIncidentLogsEnabled", d.IsIncidentLogsEnabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructureUpdate. -func (c *CloudExadataInfrastructureUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionOptions. +func (d *DataCollectionOptions) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "isDiagnosticsEventsEnabled": + err = unpopulate(val, "IsDiagnosticsEventsEnabled", &d.IsDiagnosticsEventsEnabled) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "isHealthMonitoringEnabled": + err = unpopulate(val, "IsHealthMonitoringEnabled", &d.IsHealthMonitoringEnabled) delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) + case "isIncidentLogsEnabled": + err = unpopulate(val, "IsIncidentLogsEnabled", &d.IsIncidentLogsEnabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudExadataInfrastructureUpdateProperties. -func (c CloudExadataInfrastructureUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DayOfWeek. +func (d DayOfWeek) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "computeCount", c.ComputeCount) - populate(objectMap, "customerContacts", c.CustomerContacts) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "maintenanceWindow", c.MaintenanceWindow) - populate(objectMap, "storageCount", c.StorageCount) + populate(objectMap, "name", d.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudExadataInfrastructureUpdateProperties. -func (c *CloudExadataInfrastructureUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DayOfWeek. +func (d *DayOfWeek) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "computeCount": - err = unpopulate(val, "ComputeCount", &c.ComputeCount) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "customerContacts": - err = unpopulate(val, "CustomerContacts", &c.CustomerContacts) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DayOfWeekUpdate. +func (d DayOfWeekUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DayOfWeekUpdate. +func (d *DayOfWeekUpdate) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DbActionResponse. +func (d DbActionResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", d.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DbActionResponse. +func (d *DbActionResponse) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) - case "maintenanceWindow": - err = unpopulate(val, "MaintenanceWindow", &c.MaintenanceWindow) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DbIormConfig. +func (d DbIormConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dbName", d.DbName) + populate(objectMap, "flashCacheLimit", d.FlashCacheLimit) + populate(objectMap, "share", d.Share) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DbIormConfig. +func (d *DbIormConfig) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dbName": + err = unpopulate(val, "DbName", &d.DbName) delete(rawMsg, key) - case "storageCount": - err = unpopulate(val, "StorageCount", &c.StorageCount) + case "flashCacheLimit": + err = unpopulate(val, "FlashCacheLimit", &d.FlashCacheLimit) + delete(rawMsg, key) + case "share": + err = unpopulate(val, "Share", &d.Share) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudVMCluster. -func (c CloudVMCluster) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbNode. +func (d DbNode) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMCluster. -func (c *CloudVMCluster) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbNode. +func (d *DbNode) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &c.Name) + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &c.Properties) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &c.Type) + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DbNodeAction. +func (d DbNodeAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", d.Action) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DbNodeAction. +func (d *DbNodeAction) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &d.Action) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DbNodeDetails. +func (d DbNodeDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dbNodeId", d.DbNodeID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DbNodeDetails. +func (d *DbNodeDetails) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dbNodeId": + err = unpopulate(val, "DbNodeID", &d.DbNodeID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudVMClusterListResult. -func (c CloudVMClusterListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbNodeListResult. +func (d DbNodeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMClusterListResult. -func (c *CloudVMClusterListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbNodeListResult. +func (d *DbNodeListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &c.Value) + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudVMClusterProperties. -func (c CloudVMClusterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbNodeProperties. +func (d DbNodeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backupSubnetCidr", c.BackupSubnetCidr) - populate(objectMap, "cpuCoreCount", c.CPUCoreCount) - populate(objectMap, "cloudExadataInfrastructureId", c.CloudExadataInfrastructureID) - populate(objectMap, "clusterName", c.ClusterName) - populate(objectMap, "compartmentId", c.CompartmentID) - populate(objectMap, "computeNodes", c.ComputeNodes) - populate(objectMap, "dataCollectionOptions", c.DataCollectionOptions) - populate(objectMap, "dataStoragePercentage", c.DataStoragePercentage) - populate(objectMap, "dataStorageSizeInTbs", c.DataStorageSizeInTbs) - populate(objectMap, "dbNodeStorageSizeInGbs", c.DbNodeStorageSizeInGbs) - populate(objectMap, "dbServers", c.DbServers) - populate(objectMap, "diskRedundancy", c.DiskRedundancy) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "domain", c.Domain) - populate(objectMap, "giVersion", c.GiVersion) - populate(objectMap, "hostname", c.Hostname) - populate(objectMap, "iormConfigCache", c.IormConfigCache) - populate(objectMap, "isLocalBackupEnabled", c.IsLocalBackupEnabled) - populate(objectMap, "isSparseDiskgroupEnabled", c.IsSparseDiskgroupEnabled) - populate(objectMap, "lastUpdateHistoryEntryId", c.LastUpdateHistoryEntryID) - populate(objectMap, "licenseModel", c.LicenseModel) - populate(objectMap, "lifecycleDetails", c.LifecycleDetails) - populate(objectMap, "lifecycleState", c.LifecycleState) - populate(objectMap, "listenerPort", c.ListenerPort) - populate(objectMap, "memorySizeInGbs", c.MemorySizeInGbs) - populate(objectMap, "nodeCount", c.NodeCount) - populate(objectMap, "nsgCidrs", c.NsgCidrs) - populate(objectMap, "nsgUrl", c.NsgURL) - populate(objectMap, "ociUrl", c.OciURL) - populate(objectMap, "ocid", c.Ocid) - populate(objectMap, "ocpuCount", c.OcpuCount) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "sshPublicKeys", c.SSHPublicKeys) - populate(objectMap, "scanDnsName", c.ScanDNSName) - populate(objectMap, "scanDnsRecordId", c.ScanDNSRecordID) - populate(objectMap, "scanIpIds", c.ScanIPIDs) - populate(objectMap, "scanListenerPortTcp", c.ScanListenerPortTCP) - populate(objectMap, "scanListenerPortTcpSsl", c.ScanListenerPortTCPSSL) - populate(objectMap, "shape", c.Shape) - populate(objectMap, "storageSizeInGbs", c.StorageSizeInGbs) - populate(objectMap, "subnetId", c.SubnetID) - populate(objectMap, "subnetOcid", c.SubnetOcid) - populate(objectMap, "systemVersion", c.SystemVersion) - populateDateTimeRFC3339(objectMap, "timeCreated", c.TimeCreated) - populate(objectMap, "timeZone", c.TimeZone) - populate(objectMap, "vipIds", c.VipIDs) - populate(objectMap, "vnetId", c.VnetID) - populate(objectMap, "zoneId", c.ZoneID) + populate(objectMap, "additionalDetails", d.AdditionalDetails) + populate(objectMap, "backupIpId", d.BackupIPID) + populate(objectMap, "backupVnic2Id", d.BackupVnic2ID) + populate(objectMap, "backupVnicId", d.BackupVnicID) + populate(objectMap, "cpuCoreCount", d.CPUCoreCount) + populate(objectMap, "dbNodeStorageSizeInGbs", d.DbNodeStorageSizeInGbs) + populate(objectMap, "dbServerId", d.DbServerID) + populate(objectMap, "dbSystemId", d.DbSystemID) + populate(objectMap, "faultDomain", d.FaultDomain) + populate(objectMap, "hostIpId", d.HostIPID) + populate(objectMap, "hostname", d.Hostname) + populate(objectMap, "lifecycleDetails", d.LifecycleDetails) + populate(objectMap, "lifecycleState", d.LifecycleState) + populate(objectMap, "maintenanceType", d.MaintenanceType) + populate(objectMap, "memorySizeInGbs", d.MemorySizeInGbs) + populate(objectMap, "ocid", d.Ocid) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "softwareStorageSizeInGb", d.SoftwareStorageSizeInGb) + populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) + populateDateTimeRFC3339(objectMap, "timeMaintenanceWindowEnd", d.TimeMaintenanceWindowEnd) + populateDateTimeRFC3339(objectMap, "timeMaintenanceWindowStart", d.TimeMaintenanceWindowStart) + populate(objectMap, "vnic2Id", d.Vnic2ID) + populate(objectMap, "vnicId", d.VnicID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMClusterProperties. -func (c *CloudVMClusterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbNodeProperties. +func (d *DbNodeProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "backupSubnetCidr": - err = unpopulate(val, "BackupSubnetCidr", &c.BackupSubnetCidr) - delete(rawMsg, key) - case "cpuCoreCount": - err = unpopulate(val, "CPUCoreCount", &c.CPUCoreCount) - delete(rawMsg, key) - case "cloudExadataInfrastructureId": - err = unpopulate(val, "CloudExadataInfrastructureID", &c.CloudExadataInfrastructureID) - delete(rawMsg, key) - case "clusterName": - err = unpopulate(val, "ClusterName", &c.ClusterName) - delete(rawMsg, key) - case "compartmentId": - err = unpopulate(val, "CompartmentID", &c.CompartmentID) + case "additionalDetails": + err = unpopulate(val, "AdditionalDetails", &d.AdditionalDetails) delete(rawMsg, key) - case "computeNodes": - err = unpopulate(val, "ComputeNodes", &c.ComputeNodes) + case "backupIpId": + err = unpopulate(val, "BackupIPID", &d.BackupIPID) delete(rawMsg, key) - case "dataCollectionOptions": - err = unpopulate(val, "DataCollectionOptions", &c.DataCollectionOptions) + case "backupVnic2Id": + err = unpopulate(val, "BackupVnic2ID", &d.BackupVnic2ID) delete(rawMsg, key) - case "dataStoragePercentage": - err = unpopulate(val, "DataStoragePercentage", &c.DataStoragePercentage) + case "backupVnicId": + err = unpopulate(val, "BackupVnicID", &d.BackupVnicID) delete(rawMsg, key) - case "dataStorageSizeInTbs": - err = unpopulate(val, "DataStorageSizeInTbs", &c.DataStorageSizeInTbs) + case "cpuCoreCount": + err = unpopulate(val, "CPUCoreCount", &d.CPUCoreCount) delete(rawMsg, key) case "dbNodeStorageSizeInGbs": - err = unpopulate(val, "DbNodeStorageSizeInGbs", &c.DbNodeStorageSizeInGbs) - delete(rawMsg, key) - case "dbServers": - err = unpopulate(val, "DbServers", &c.DbServers) + err = unpopulate(val, "DbNodeStorageSizeInGbs", &d.DbNodeStorageSizeInGbs) delete(rawMsg, key) - case "diskRedundancy": - err = unpopulate(val, "DiskRedundancy", &c.DiskRedundancy) + case "dbServerId": + err = unpopulate(val, "DbServerID", &d.DbServerID) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) + case "dbSystemId": + err = unpopulate(val, "DbSystemID", &d.DbSystemID) delete(rawMsg, key) - case "domain": - err = unpopulate(val, "Domain", &c.Domain) + case "faultDomain": + err = unpopulate(val, "FaultDomain", &d.FaultDomain) delete(rawMsg, key) - case "giVersion": - err = unpopulate(val, "GiVersion", &c.GiVersion) + case "hostIpId": + err = unpopulate(val, "HostIPID", &d.HostIPID) delete(rawMsg, key) case "hostname": - err = unpopulate(val, "Hostname", &c.Hostname) - delete(rawMsg, key) - case "iormConfigCache": - err = unpopulate(val, "IormConfigCache", &c.IormConfigCache) - delete(rawMsg, key) - case "isLocalBackupEnabled": - err = unpopulate(val, "IsLocalBackupEnabled", &c.IsLocalBackupEnabled) - delete(rawMsg, key) - case "isSparseDiskgroupEnabled": - err = unpopulate(val, "IsSparseDiskgroupEnabled", &c.IsSparseDiskgroupEnabled) - delete(rawMsg, key) - case "lastUpdateHistoryEntryId": - err = unpopulate(val, "LastUpdateHistoryEntryID", &c.LastUpdateHistoryEntryID) - delete(rawMsg, key) - case "licenseModel": - err = unpopulate(val, "LicenseModel", &c.LicenseModel) + err = unpopulate(val, "Hostname", &d.Hostname) delete(rawMsg, key) case "lifecycleDetails": - err = unpopulate(val, "LifecycleDetails", &c.LifecycleDetails) + err = unpopulate(val, "LifecycleDetails", &d.LifecycleDetails) delete(rawMsg, key) case "lifecycleState": - err = unpopulate(val, "LifecycleState", &c.LifecycleState) + err = unpopulate(val, "LifecycleState", &d.LifecycleState) delete(rawMsg, key) - case "listenerPort": - err = unpopulate(val, "ListenerPort", &c.ListenerPort) + case "maintenanceType": + err = unpopulate(val, "MaintenanceType", &d.MaintenanceType) delete(rawMsg, key) case "memorySizeInGbs": - err = unpopulate(val, "MemorySizeInGbs", &c.MemorySizeInGbs) - delete(rawMsg, key) - case "nodeCount": - err = unpopulate(val, "NodeCount", &c.NodeCount) - delete(rawMsg, key) - case "nsgCidrs": - err = unpopulate(val, "NsgCidrs", &c.NsgCidrs) - delete(rawMsg, key) - case "nsgUrl": - err = unpopulate(val, "NsgURL", &c.NsgURL) - delete(rawMsg, key) - case "ociUrl": - err = unpopulate(val, "OciURL", &c.OciURL) + err = unpopulate(val, "MemorySizeInGbs", &d.MemorySizeInGbs) delete(rawMsg, key) case "ocid": - err = unpopulate(val, "Ocid", &c.Ocid) - delete(rawMsg, key) - case "ocpuCount": - err = unpopulate(val, "OcpuCount", &c.OcpuCount) + err = unpopulate(val, "Ocid", &d.Ocid) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "sshPublicKeys": - err = unpopulate(val, "SSHPublicKeys", &c.SSHPublicKeys) - delete(rawMsg, key) - case "scanDnsName": - err = unpopulate(val, "ScanDNSName", &c.ScanDNSName) - delete(rawMsg, key) - case "scanDnsRecordId": - err = unpopulate(val, "ScanDNSRecordID", &c.ScanDNSRecordID) - delete(rawMsg, key) - case "scanIpIds": - err = unpopulate(val, "ScanIPIDs", &c.ScanIPIDs) - delete(rawMsg, key) - case "scanListenerPortTcp": - err = unpopulate(val, "ScanListenerPortTCP", &c.ScanListenerPortTCP) - delete(rawMsg, key) - case "scanListenerPortTcpSsl": - err = unpopulate(val, "ScanListenerPortTCPSSL", &c.ScanListenerPortTCPSSL) - delete(rawMsg, key) - case "shape": - err = unpopulate(val, "Shape", &c.Shape) - delete(rawMsg, key) - case "storageSizeInGbs": - err = unpopulate(val, "StorageSizeInGbs", &c.StorageSizeInGbs) - delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &c.SubnetID) - delete(rawMsg, key) - case "subnetOcid": - err = unpopulate(val, "SubnetOcid", &c.SubnetOcid) + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) - case "systemVersion": - err = unpopulate(val, "SystemVersion", &c.SystemVersion) + case "softwareStorageSizeInGb": + err = unpopulate(val, "SoftwareStorageSizeInGb", &d.SoftwareStorageSizeInGb) delete(rawMsg, key) case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &c.TimeCreated) + err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &c.TimeZone) + case "timeMaintenanceWindowEnd": + err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceWindowEnd", &d.TimeMaintenanceWindowEnd) delete(rawMsg, key) - case "vipIds": - err = unpopulate(val, "VipIDs", &c.VipIDs) + case "timeMaintenanceWindowStart": + err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceWindowStart", &d.TimeMaintenanceWindowStart) delete(rawMsg, key) - case "vnetId": - err = unpopulate(val, "VnetID", &c.VnetID) + case "vnic2Id": + err = unpopulate(val, "Vnic2ID", &d.Vnic2ID) delete(rawMsg, key) - case "zoneId": - err = unpopulate(val, "ZoneID", &c.ZoneID) + case "vnicId": + err = unpopulate(val, "VnicID", &d.VnicID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudVMClusterUpdate. -func (c CloudVMClusterUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbServer. +func (d DbServer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMClusterUpdate. -func (c *CloudVMClusterUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbServer. +func (d *DbServer) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &c.Properties) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudVMClusterUpdateProperties. -func (c CloudVMClusterUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbServerListResult. +func (d DbServerListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpuCoreCount", c.CPUCoreCount) - populate(objectMap, "computeNodes", c.ComputeNodes) - populate(objectMap, "dataCollectionOptions", c.DataCollectionOptions) - populate(objectMap, "dataStorageSizeInTbs", c.DataStorageSizeInTbs) - populate(objectMap, "dbNodeStorageSizeInGbs", c.DbNodeStorageSizeInGbs) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "licenseModel", c.LicenseModel) - populate(objectMap, "memorySizeInGbs", c.MemorySizeInGbs) - populate(objectMap, "ocpuCount", c.OcpuCount) - populate(objectMap, "sshPublicKeys", c.SSHPublicKeys) - populate(objectMap, "storageSizeInGbs", c.StorageSizeInGbs) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudVMClusterUpdateProperties. -func (c *CloudVMClusterUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerListResult. +func (d *DbServerListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "cpuCoreCount": - err = unpopulate(val, "CPUCoreCount", &c.CPUCoreCount) - delete(rawMsg, key) - case "computeNodes": - err = unpopulate(val, "ComputeNodes", &c.ComputeNodes) - delete(rawMsg, key) - case "dataCollectionOptions": - err = unpopulate(val, "DataCollectionOptions", &c.DataCollectionOptions) - delete(rawMsg, key) - case "dataStorageSizeInTbs": - err = unpopulate(val, "DataStorageSizeInTbs", &c.DataStorageSizeInTbs) - delete(rawMsg, key) - case "dbNodeStorageSizeInGbs": - err = unpopulate(val, "DbNodeStorageSizeInGbs", &c.DbNodeStorageSizeInGbs) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) - delete(rawMsg, key) - case "licenseModel": - err = unpopulate(val, "LicenseModel", &c.LicenseModel) - delete(rawMsg, key) - case "memorySizeInGbs": - err = unpopulate(val, "MemorySizeInGbs", &c.MemorySizeInGbs) - delete(rawMsg, key) - case "ocpuCount": - err = unpopulate(val, "OcpuCount", &c.OcpuCount) - delete(rawMsg, key) - case "sshPublicKeys": - err = unpopulate(val, "SSHPublicKeys", &c.SSHPublicKeys) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "storageSizeInGbs": - err = unpopulate(val, "StorageSizeInGbs", &c.StorageSizeInGbs) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionStringType. -func (c ConnectionStringType) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbServerPatchingDetails. +func (d DbServerPatchingDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allConnectionStrings", c.AllConnectionStrings) - populate(objectMap, "dedicated", c.Dedicated) - populate(objectMap, "high", c.High) - populate(objectMap, "low", c.Low) - populate(objectMap, "medium", c.Medium) - populate(objectMap, "profiles", c.Profiles) + populate(objectMap, "estimatedPatchDuration", d.EstimatedPatchDuration) + populate(objectMap, "patchingStatus", d.PatchingStatus) + populateDateTimeRFC3339(objectMap, "timePatchingEnded", d.TimePatchingEnded) + populateDateTimeRFC3339(objectMap, "timePatchingStarted", d.TimePatchingStarted) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionStringType. -func (c *ConnectionStringType) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerPatchingDetails. +func (d *DbServerPatchingDetails) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "allConnectionStrings": - err = unpopulate(val, "AllConnectionStrings", &c.AllConnectionStrings) - delete(rawMsg, key) - case "dedicated": - err = unpopulate(val, "Dedicated", &c.Dedicated) - delete(rawMsg, key) - case "high": - err = unpopulate(val, "High", &c.High) + case "estimatedPatchDuration": + err = unpopulate(val, "EstimatedPatchDuration", &d.EstimatedPatchDuration) delete(rawMsg, key) - case "low": - err = unpopulate(val, "Low", &c.Low) + case "patchingStatus": + err = unpopulate(val, "PatchingStatus", &d.PatchingStatus) delete(rawMsg, key) - case "medium": - err = unpopulate(val, "Medium", &c.Medium) + case "timePatchingEnded": + err = unpopulateDateTimeRFC3339(val, "TimePatchingEnded", &d.TimePatchingEnded) delete(rawMsg, key) - case "profiles": - err = unpopulate(val, "Profiles", &c.Profiles) + case "timePatchingStarted": + err = unpopulateDateTimeRFC3339(val, "TimePatchingStarted", &d.TimePatchingStarted) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionURLType. -func (c ConnectionURLType) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbServerProperties. +func (d DbServerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apexUrl", c.ApexURL) - populate(objectMap, "databaseTransformsUrl", c.DatabaseTransformsURL) - populate(objectMap, "graphStudioUrl", c.GraphStudioURL) - populate(objectMap, "machineLearningNotebookUrl", c.MachineLearningNotebookURL) - populate(objectMap, "mongoDbUrl", c.MongoDbURL) - populate(objectMap, "ordsUrl", c.OrdsURL) - populate(objectMap, "sqlDevWebUrl", c.SQLDevWebURL) + populate(objectMap, "autonomousVmClusterIds", d.AutonomousVMClusterIDs) + populate(objectMap, "autonomousVirtualMachineIds", d.AutonomousVirtualMachineIDs) + populate(objectMap, "cpuCoreCount", d.CPUCoreCount) + populate(objectMap, "compartmentId", d.CompartmentID) + populate(objectMap, "computeModel", d.ComputeModel) + populate(objectMap, "dbNodeIds", d.DbNodeIDs) + populate(objectMap, "dbNodeStorageSizeInGbs", d.DbNodeStorageSizeInGbs) + populate(objectMap, "dbServerPatchingDetails", d.DbServerPatchingDetails) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "exadataInfrastructureId", d.ExadataInfrastructureID) + populate(objectMap, "lifecycleDetails", d.LifecycleDetails) + populate(objectMap, "lifecycleState", d.LifecycleState) + populate(objectMap, "maxCpuCount", d.MaxCPUCount) + populate(objectMap, "maxDbNodeStorageInGbs", d.MaxDbNodeStorageInGbs) + populate(objectMap, "maxMemoryInGbs", d.MaxMemoryInGbs) + populate(objectMap, "memorySizeInGbs", d.MemorySizeInGbs) + populate(objectMap, "ocid", d.Ocid) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "shape", d.Shape) + populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) + populate(objectMap, "vmClusterIds", d.VMClusterIDs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionURLType. -func (c *ConnectionURLType) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerProperties. +func (d *DbServerProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "apexUrl": - err = unpopulate(val, "ApexURL", &c.ApexURL) + case "autonomousVmClusterIds": + err = unpopulate(val, "AutonomousVMClusterIDs", &d.AutonomousVMClusterIDs) delete(rawMsg, key) - case "databaseTransformsUrl": - err = unpopulate(val, "DatabaseTransformsURL", &c.DatabaseTransformsURL) + case "autonomousVirtualMachineIds": + err = unpopulate(val, "AutonomousVirtualMachineIDs", &d.AutonomousVirtualMachineIDs) delete(rawMsg, key) - case "graphStudioUrl": - err = unpopulate(val, "GraphStudioURL", &c.GraphStudioURL) + case "cpuCoreCount": + err = unpopulate(val, "CPUCoreCount", &d.CPUCoreCount) delete(rawMsg, key) - case "machineLearningNotebookUrl": - err = unpopulate(val, "MachineLearningNotebookURL", &c.MachineLearningNotebookURL) + case "compartmentId": + err = unpopulate(val, "CompartmentID", &d.CompartmentID) delete(rawMsg, key) - case "mongoDbUrl": - err = unpopulate(val, "MongoDbURL", &c.MongoDbURL) + case "computeModel": + err = unpopulate(val, "ComputeModel", &d.ComputeModel) delete(rawMsg, key) - case "ordsUrl": - err = unpopulate(val, "OrdsURL", &c.OrdsURL) + case "dbNodeIds": + err = unpopulate(val, "DbNodeIDs", &d.DbNodeIDs) delete(rawMsg, key) - case "sqlDevWebUrl": - err = unpopulate(val, "SQLDevWebURL", &c.SQLDevWebURL) + case "dbNodeStorageSizeInGbs": + err = unpopulate(val, "DbNodeStorageSizeInGbs", &d.DbNodeStorageSizeInGbs) 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 CustomerContact. -func (c CustomerContact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "email", c.Email) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomerContact. -func (c *CustomerContact) 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 "email": - err = unpopulate(val, "Email", &c.Email) + case "dbServerPatchingDetails": + err = unpopulate(val, "DbServerPatchingDetails", &d.DbServerPatchingDetails) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "exadataInfrastructureId": + err = unpopulate(val, "ExadataInfrastructureID", &d.ExadataInfrastructureID) + delete(rawMsg, key) + case "lifecycleDetails": + err = unpopulate(val, "LifecycleDetails", &d.LifecycleDetails) + delete(rawMsg, key) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &d.LifecycleState) + delete(rawMsg, key) + case "maxCpuCount": + err = unpopulate(val, "MaxCPUCount", &d.MaxCPUCount) + delete(rawMsg, key) + case "maxDbNodeStorageInGbs": + err = unpopulate(val, "MaxDbNodeStorageInGbs", &d.MaxDbNodeStorageInGbs) + delete(rawMsg, key) + case "maxMemoryInGbs": + err = unpopulate(val, "MaxMemoryInGbs", &d.MaxMemoryInGbs) + delete(rawMsg, key) + case "memorySizeInGbs": + err = unpopulate(val, "MemorySizeInGbs", &d.MemorySizeInGbs) + delete(rawMsg, key) + case "ocid": + err = unpopulate(val, "Ocid", &d.Ocid) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "shape": + err = unpopulate(val, "Shape", &d.Shape) + delete(rawMsg, key) + case "timeCreated": + err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) + delete(rawMsg, key) + case "vmClusterIds": + err = unpopulate(val, "VMClusterIDs", &d.VMClusterIDs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DNSPrivateView. -func (d DNSPrivateView) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbSystemShape. +func (d DbSystemShape) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) @@ -2849,8 +4500,8 @@ func (d DNSPrivateView) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateView. -func (d *DNSPrivateView) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbSystemShape. +func (d *DbSystemShape) 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", d, err) @@ -2881,16 +4532,16 @@ func (d *DNSPrivateView) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DNSPrivateViewListResult. -func (d DNSPrivateViewListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbSystemShapeListResult. +func (d DbSystemShapeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateViewListResult. -func (d *DNSPrivateViewListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbSystemShapeListResult. +func (d *DbSystemShapeListResult) 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", d, err) @@ -2912,22 +4563,38 @@ func (d *DNSPrivateViewListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DNSPrivateViewProperties. -func (d DNSPrivateViewProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DbSystemShapeProperties. +func (d DbSystemShapeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "areServerTypesSupported", d.AreServerTypesSupported) + populate(objectMap, "availableCoreCount", d.AvailableCoreCount) + populate(objectMap, "availableCoreCountPerNode", d.AvailableCoreCountPerNode) + populate(objectMap, "availableDataStorageInTbs", d.AvailableDataStorageInTbs) + populate(objectMap, "availableDataStoragePerServerInTbs", d.AvailableDataStoragePerServerInTbs) + populate(objectMap, "availableDbNodePerNodeInGbs", d.AvailableDbNodePerNodeInGbs) + populate(objectMap, "availableDbNodeStorageInGbs", d.AvailableDbNodeStorageInGbs) + populate(objectMap, "availableMemoryInGbs", d.AvailableMemoryInGbs) + populate(objectMap, "availableMemoryPerNodeInGbs", d.AvailableMemoryPerNodeInGbs) + populate(objectMap, "computeModel", d.ComputeModel) + populate(objectMap, "coreCountIncrement", d.CoreCountIncrement) populate(objectMap, "displayName", d.DisplayName) - populate(objectMap, "isProtected", d.IsProtected) - populate(objectMap, "lifecycleState", d.LifecycleState) - populate(objectMap, "ocid", d.Ocid) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "self", d.Self) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populateDateTimeRFC3339(objectMap, "timeUpdated", d.TimeUpdated) + populate(objectMap, "maxStorageCount", d.MaxStorageCount) + populate(objectMap, "maximumNodeCount", d.MaximumNodeCount) + populate(objectMap, "minCoreCountPerNode", d.MinCoreCountPerNode) + populate(objectMap, "minDataStorageInTbs", d.MinDataStorageInTbs) + populate(objectMap, "minDbNodeStoragePerNodeInGbs", d.MinDbNodeStoragePerNodeInGbs) + populate(objectMap, "minMemoryPerNodeInGbs", d.MinMemoryPerNodeInGbs) + populate(objectMap, "minStorageCount", d.MinStorageCount) + populate(objectMap, "minimumCoreCount", d.MinimumCoreCount) + populate(objectMap, "minimumNodeCount", d.MinimumNodeCount) + populate(objectMap, "runtimeMinimumCoreCount", d.RuntimeMinimumCoreCount) + populate(objectMap, "shapeFamily", d.ShapeFamily) + populate(objectMap, "shapeName", d.ShapeName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateViewProperties. -func (d *DNSPrivateViewProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DbSystemShapeProperties. +func (d *DbSystemShapeProperties) 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", d, err) @@ -2935,29 +4602,77 @@ func (d *DNSPrivateViewProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "areServerTypesSupported": + err = unpopulate(val, "AreServerTypesSupported", &d.AreServerTypesSupported) + delete(rawMsg, key) + case "availableCoreCount": + err = unpopulate(val, "AvailableCoreCount", &d.AvailableCoreCount) + delete(rawMsg, key) + case "availableCoreCountPerNode": + err = unpopulate(val, "AvailableCoreCountPerNode", &d.AvailableCoreCountPerNode) + delete(rawMsg, key) + case "availableDataStorageInTbs": + err = unpopulate(val, "AvailableDataStorageInTbs", &d.AvailableDataStorageInTbs) + delete(rawMsg, key) + case "availableDataStoragePerServerInTbs": + err = unpopulate(val, "AvailableDataStoragePerServerInTbs", &d.AvailableDataStoragePerServerInTbs) + delete(rawMsg, key) + case "availableDbNodePerNodeInGbs": + err = unpopulate(val, "AvailableDbNodePerNodeInGbs", &d.AvailableDbNodePerNodeInGbs) + delete(rawMsg, key) + case "availableDbNodeStorageInGbs": + err = unpopulate(val, "AvailableDbNodeStorageInGbs", &d.AvailableDbNodeStorageInGbs) + delete(rawMsg, key) + case "availableMemoryInGbs": + err = unpopulate(val, "AvailableMemoryInGbs", &d.AvailableMemoryInGbs) + delete(rawMsg, key) + case "availableMemoryPerNodeInGbs": + err = unpopulate(val, "AvailableMemoryPerNodeInGbs", &d.AvailableMemoryPerNodeInGbs) + delete(rawMsg, key) + case "computeModel": + err = unpopulate(val, "ComputeModel", &d.ComputeModel) + delete(rawMsg, key) + case "coreCountIncrement": + err = unpopulate(val, "CoreCountIncrement", &d.CoreCountIncrement) + delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &d.DisplayName) delete(rawMsg, key) - case "isProtected": - err = unpopulate(val, "IsProtected", &d.IsProtected) + case "maxStorageCount": + err = unpopulate(val, "MaxStorageCount", &d.MaxStorageCount) delete(rawMsg, key) - case "lifecycleState": - err = unpopulate(val, "LifecycleState", &d.LifecycleState) + case "maximumNodeCount": + err = unpopulate(val, "MaximumNodeCount", &d.MaximumNodeCount) delete(rawMsg, key) - case "ocid": - err = unpopulate(val, "Ocid", &d.Ocid) + case "minCoreCountPerNode": + err = unpopulate(val, "MinCoreCountPerNode", &d.MinCoreCountPerNode) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + case "minDataStorageInTbs": + err = unpopulate(val, "MinDataStorageInTbs", &d.MinDataStorageInTbs) delete(rawMsg, key) - case "self": - err = unpopulate(val, "Self", &d.Self) + case "minDbNodeStoragePerNodeInGbs": + err = unpopulate(val, "MinDbNodeStoragePerNodeInGbs", &d.MinDbNodeStoragePerNodeInGbs) delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) + case "minMemoryPerNodeInGbs": + err = unpopulate(val, "MinMemoryPerNodeInGbs", &d.MinMemoryPerNodeInGbs) delete(rawMsg, key) - case "timeUpdated": - err = unpopulateDateTimeRFC3339(val, "TimeUpdated", &d.TimeUpdated) + case "minStorageCount": + err = unpopulate(val, "MinStorageCount", &d.MinStorageCount) + delete(rawMsg, key) + case "minimumCoreCount": + err = unpopulate(val, "MinimumCoreCount", &d.MinimumCoreCount) + delete(rawMsg, key) + case "minimumNodeCount": + err = unpopulate(val, "MinimumNodeCount", &d.MinimumNodeCount) + delete(rawMsg, key) + case "runtimeMinimumCoreCount": + err = unpopulate(val, "RuntimeMinimumCoreCount", &d.RuntimeMinimumCoreCount) + delete(rawMsg, key) + case "shapeFamily": + err = unpopulate(val, "ShapeFamily", &d.ShapeFamily) + delete(rawMsg, key) + case "shapeName": + err = unpopulate(val, "ShapeName", &d.ShapeName) delete(rawMsg, key) } if err != nil { @@ -2967,19 +4682,18 @@ func (d *DNSPrivateViewProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DNSPrivateZone. -func (d DNSPrivateZone) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefinedFileSystemConfiguration. +func (d DefinedFileSystemConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "isBackupPartition", d.IsBackupPartition) + populate(objectMap, "isResizable", d.IsResizable) + populate(objectMap, "minSizeGb", d.MinSizeGb) + populate(objectMap, "mountPoint", d.MountPoint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateZone. -func (d *DNSPrivateZone) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefinedFileSystemConfiguration. +func (d *DefinedFileSystemConfiguration) 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", d, err) @@ -2987,20 +4701,17 @@ func (d *DNSPrivateZone) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "isBackupPartition": + err = unpopulate(val, "IsBackupPartition", &d.IsBackupPartition) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "isResizable": + err = unpopulate(val, "IsResizable", &d.IsResizable) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "minSizeGb": + err = unpopulate(val, "MinSizeGb", &d.MinSizeGb) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "mountPoint": + err = unpopulate(val, "MountPoint", &d.MountPoint) delete(rawMsg, key) } if err != nil { @@ -3010,16 +4721,18 @@ func (d *DNSPrivateZone) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DNSPrivateZoneListResult. -func (d DNSPrivateZoneListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DisasterRecoveryConfigurationDetails. +func (d DisasterRecoveryConfigurationDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "disasterRecoveryType", d.DisasterRecoveryType) + populate(objectMap, "isReplicateAutomaticBackups", d.IsReplicateAutomaticBackups) + populate(objectMap, "isSnapshotStandby", d.IsSnapshotStandby) + populateDateTimeRFC3339(objectMap, "timeSnapshotStandbyEnabledTill", d.TimeSnapshotStandbyEnabledTill) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateZoneListResult. -func (d *DNSPrivateZoneListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DisasterRecoveryConfigurationDetails. +func (d *DisasterRecoveryConfigurationDetails) 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", d, err) @@ -3027,11 +4740,17 @@ func (d *DNSPrivateZoneListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "disasterRecoveryType": + err = unpopulate(val, "DisasterRecoveryType", &d.DisasterRecoveryType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "isReplicateAutomaticBackups": + err = unpopulate(val, "IsReplicateAutomaticBackups", &d.IsReplicateAutomaticBackups) + delete(rawMsg, key) + case "isSnapshotStandby": + err = unpopulate(val, "IsSnapshotStandby", &d.IsSnapshotStandby) + delete(rawMsg, key) + case "timeSnapshotStandbyEnabledTill": + err = unpopulateDateTimeRFC3339(val, "TimeSnapshotStandbyEnabledTill", &d.TimeSnapshotStandbyEnabledTill) delete(rawMsg, key) } if err != nil { @@ -3041,891 +4760,1101 @@ func (d *DNSPrivateZoneListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DNSPrivateZoneProperties. -func (d DNSPrivateZoneProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EstimatedPatchingTime. +func (e EstimatedPatchingTime) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isProtected", d.IsProtected) - populate(objectMap, "lifecycleState", d.LifecycleState) - populate(objectMap, "ocid", d.Ocid) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "self", d.Self) - populate(objectMap, "serial", d.Serial) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populate(objectMap, "version", d.Version) - populate(objectMap, "viewId", d.ViewID) - populate(objectMap, "zoneType", d.ZoneType) + populate(objectMap, "estimatedDbServerPatchingTime", e.EstimatedDbServerPatchingTime) + populate(objectMap, "estimatedNetworkSwitchesPatchingTime", e.EstimatedNetworkSwitchesPatchingTime) + populate(objectMap, "estimatedStorageServerPatchingTime", e.EstimatedStorageServerPatchingTime) + populate(objectMap, "totalEstimatedPatchingTime", e.TotalEstimatedPatchingTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSPrivateZoneProperties. -func (d *DNSPrivateZoneProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EstimatedPatchingTime. +func (e *EstimatedPatchingTime) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "isProtected": - err = unpopulate(val, "IsProtected", &d.IsProtected) - delete(rawMsg, key) - case "lifecycleState": - err = unpopulate(val, "LifecycleState", &d.LifecycleState) - delete(rawMsg, key) - case "ocid": - err = unpopulate(val, "Ocid", &d.Ocid) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + case "estimatedDbServerPatchingTime": + err = unpopulate(val, "EstimatedDbServerPatchingTime", &e.EstimatedDbServerPatchingTime) delete(rawMsg, key) - case "self": - err = unpopulate(val, "Self", &d.Self) + case "estimatedNetworkSwitchesPatchingTime": + err = unpopulate(val, "EstimatedNetworkSwitchesPatchingTime", &e.EstimatedNetworkSwitchesPatchingTime) delete(rawMsg, key) - case "serial": - err = unpopulate(val, "Serial", &d.Serial) + case "estimatedStorageServerPatchingTime": + err = unpopulate(val, "EstimatedStorageServerPatchingTime", &e.EstimatedStorageServerPatchingTime) delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) + case "totalEstimatedPatchingTime": + err = unpopulate(val, "TotalEstimatedPatchingTime", &e.TotalEstimatedPatchingTime) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExadataIormConfig. +func (e ExadataIormConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dbPlans", e.DbPlans) + populate(objectMap, "lifecycleDetails", e.LifecycleDetails) + populate(objectMap, "lifecycleState", e.LifecycleState) + populate(objectMap, "objective", e.Objective) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExadataIormConfig. +func (e *ExadataIormConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dbPlans": + err = unpopulate(val, "DbPlans", &e.DbPlans) delete(rawMsg, key) - case "viewId": - err = unpopulate(val, "ViewID", &d.ViewID) + case "lifecycleDetails": + err = unpopulate(val, "LifecycleDetails", &e.LifecycleDetails) delete(rawMsg, key) - case "zoneType": - err = unpopulate(val, "ZoneType", &d.ZoneType) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &e.LifecycleState) + delete(rawMsg, key) + case "objective": + err = unpopulate(val, "Objective", &e.Objective) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataCollectionOptions. -func (d DataCollectionOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExadbVMCluster. +func (e ExadbVMCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isDiagnosticsEventsEnabled", d.IsDiagnosticsEventsEnabled) - populate(objectMap, "isHealthMonitoringEnabled", d.IsHealthMonitoringEnabled) - populate(objectMap, "isIncidentLogsEnabled", d.IsIncidentLogsEnabled) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + populate(objectMap, "zones", e.Zones) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionOptions. -func (d *DataCollectionOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExadbVMCluster. +func (e *ExadbVMCluster) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "isDiagnosticsEventsEnabled": - err = unpopulate(val, "IsDiagnosticsEventsEnabled", &d.IsDiagnosticsEventsEnabled) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "isHealthMonitoringEnabled": - err = unpopulate(val, "IsHealthMonitoringEnabled", &d.IsHealthMonitoringEnabled) + case "location": + err = unpopulate(val, "Location", &e.Location) delete(rawMsg, key) - case "isIncidentLogsEnabled": - err = unpopulate(val, "IsIncidentLogsEnabled", &d.IsIncidentLogsEnabled) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &e.Zones) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DayOfWeek. -func (d DayOfWeek) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExadbVMClusterListResult. +func (e ExadbVMClusterListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DayOfWeek. -func (d *DayOfWeek) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExadbVMClusterListResult. +func (e *ExadbVMClusterListResult) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DayOfWeekUpdate. -func (d DayOfWeekUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExadbVMClusterProperties. +func (e ExadbVMClusterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) + populate(objectMap, "backupSubnetCidr", e.BackupSubnetCidr) + populate(objectMap, "backupSubnetOcid", e.BackupSubnetOcid) + populate(objectMap, "clusterName", e.ClusterName) + populate(objectMap, "dataCollectionOptions", e.DataCollectionOptions) + populate(objectMap, "displayName", e.DisplayName) + populate(objectMap, "domain", e.Domain) + populate(objectMap, "enabledEcpuCount", e.EnabledEcpuCount) + populate(objectMap, "exascaleDbStorageVaultId", e.ExascaleDbStorageVaultID) + populate(objectMap, "giVersion", e.GiVersion) + populate(objectMap, "gridImageOcid", e.GridImageOcid) + populate(objectMap, "gridImageType", e.GridImageType) + populate(objectMap, "hostname", e.Hostname) + populate(objectMap, "iormConfigCache", e.IormConfigCache) + populate(objectMap, "licenseModel", e.LicenseModel) + populate(objectMap, "lifecycleDetails", e.LifecycleDetails) + populate(objectMap, "lifecycleState", e.LifecycleState) + populate(objectMap, "listenerPort", e.ListenerPort) + populate(objectMap, "memorySizeInGbs", e.MemorySizeInGbs) + populate(objectMap, "nodeCount", e.NodeCount) + populate(objectMap, "nsgCidrs", e.NsgCidrs) + populate(objectMap, "nsgUrl", e.NsgURL) + populate(objectMap, "ociUrl", e.OciURL) + populate(objectMap, "ocid", e.Ocid) + populate(objectMap, "privateZoneOcid", e.PrivateZoneOcid) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "sshPublicKeys", e.SSHPublicKeys) + populate(objectMap, "scanDnsName", e.ScanDNSName) + populate(objectMap, "scanDnsRecordId", e.ScanDNSRecordID) + populate(objectMap, "scanIpIds", e.ScanIPIDs) + populate(objectMap, "scanListenerPortTcp", e.ScanListenerPortTCP) + populate(objectMap, "scanListenerPortTcpSsl", e.ScanListenerPortTCPSSL) + populate(objectMap, "shape", e.Shape) + populate(objectMap, "snapshotFileSystemStorage", e.SnapshotFileSystemStorage) + populate(objectMap, "subnetId", e.SubnetID) + populate(objectMap, "subnetOcid", e.SubnetOcid) + populate(objectMap, "systemVersion", e.SystemVersion) + populate(objectMap, "timeZone", e.TimeZone) + populate(objectMap, "totalEcpuCount", e.TotalEcpuCount) + populate(objectMap, "totalFileSystemStorage", e.TotalFileSystemStorage) + populate(objectMap, "vmFileSystemStorage", e.VMFileSystemStorage) + populate(objectMap, "vipIds", e.VipIDs) + populate(objectMap, "vnetId", e.VnetID) + populate(objectMap, "zoneOcid", e.ZoneOcid) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DayOfWeekUpdate. -func (d *DayOfWeekUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExadbVMClusterProperties. +func (e *ExadbVMClusterProperties) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) + case "backupSubnetCidr": + err = unpopulate(val, "BackupSubnetCidr", &e.BackupSubnetCidr) + delete(rawMsg, key) + case "backupSubnetOcid": + err = unpopulate(val, "BackupSubnetOcid", &e.BackupSubnetOcid) + delete(rawMsg, key) + case "clusterName": + err = unpopulate(val, "ClusterName", &e.ClusterName) + delete(rawMsg, key) + case "dataCollectionOptions": + err = unpopulate(val, "DataCollectionOptions", &e.DataCollectionOptions) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &e.DisplayName) + delete(rawMsg, key) + case "domain": + err = unpopulate(val, "Domain", &e.Domain) + delete(rawMsg, key) + case "enabledEcpuCount": + err = unpopulate(val, "EnabledEcpuCount", &e.EnabledEcpuCount) + delete(rawMsg, key) + case "exascaleDbStorageVaultId": + err = unpopulate(val, "ExascaleDbStorageVaultID", &e.ExascaleDbStorageVaultID) + delete(rawMsg, key) + case "giVersion": + err = unpopulate(val, "GiVersion", &e.GiVersion) + delete(rawMsg, key) + case "gridImageOcid": + err = unpopulate(val, "GridImageOcid", &e.GridImageOcid) + delete(rawMsg, key) + case "gridImageType": + err = unpopulate(val, "GridImageType", &e.GridImageType) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, "Hostname", &e.Hostname) + delete(rawMsg, key) + case "iormConfigCache": + err = unpopulate(val, "IormConfigCache", &e.IormConfigCache) + delete(rawMsg, key) + case "licenseModel": + err = unpopulate(val, "LicenseModel", &e.LicenseModel) + delete(rawMsg, key) + case "lifecycleDetails": + err = unpopulate(val, "LifecycleDetails", &e.LifecycleDetails) + delete(rawMsg, key) + case "lifecycleState": + err = unpopulate(val, "LifecycleState", &e.LifecycleState) + delete(rawMsg, key) + case "listenerPort": + err = unpopulate(val, "ListenerPort", &e.ListenerPort) + delete(rawMsg, key) + case "memorySizeInGbs": + err = unpopulate(val, "MemorySizeInGbs", &e.MemorySizeInGbs) + delete(rawMsg, key) + case "nodeCount": + err = unpopulate(val, "NodeCount", &e.NodeCount) + delete(rawMsg, key) + case "nsgCidrs": + err = unpopulate(val, "NsgCidrs", &e.NsgCidrs) + delete(rawMsg, key) + case "nsgUrl": + err = unpopulate(val, "NsgURL", &e.NsgURL) + delete(rawMsg, key) + case "ociUrl": + err = unpopulate(val, "OciURL", &e.OciURL) + delete(rawMsg, key) + case "ocid": + err = unpopulate(val, "Ocid", &e.Ocid) + delete(rawMsg, key) + case "privateZoneOcid": + err = unpopulate(val, "PrivateZoneOcid", &e.PrivateZoneOcid) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "sshPublicKeys": + err = unpopulate(val, "SSHPublicKeys", &e.SSHPublicKeys) + delete(rawMsg, key) + case "scanDnsName": + err = unpopulate(val, "ScanDNSName", &e.ScanDNSName) + delete(rawMsg, key) + case "scanDnsRecordId": + err = unpopulate(val, "ScanDNSRecordID", &e.ScanDNSRecordID) + delete(rawMsg, key) + case "scanIpIds": + err = unpopulate(val, "ScanIPIDs", &e.ScanIPIDs) + delete(rawMsg, key) + case "scanListenerPortTcp": + err = unpopulate(val, "ScanListenerPortTCP", &e.ScanListenerPortTCP) + delete(rawMsg, key) + case "scanListenerPortTcpSsl": + err = unpopulate(val, "ScanListenerPortTCPSSL", &e.ScanListenerPortTCPSSL) + delete(rawMsg, key) + case "shape": + err = unpopulate(val, "Shape", &e.Shape) + delete(rawMsg, key) + case "snapshotFileSystemStorage": + err = unpopulate(val, "SnapshotFileSystemStorage", &e.SnapshotFileSystemStorage) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &e.SubnetID) + delete(rawMsg, key) + case "subnetOcid": + err = unpopulate(val, "SubnetOcid", &e.SubnetOcid) + delete(rawMsg, key) + case "systemVersion": + err = unpopulate(val, "SystemVersion", &e.SystemVersion) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &e.TimeZone) + delete(rawMsg, key) + case "totalEcpuCount": + err = unpopulate(val, "TotalEcpuCount", &e.TotalEcpuCount) + delete(rawMsg, key) + case "totalFileSystemStorage": + err = unpopulate(val, "TotalFileSystemStorage", &e.TotalFileSystemStorage) + delete(rawMsg, key) + case "vmFileSystemStorage": + err = unpopulate(val, "VMFileSystemStorage", &e.VMFileSystemStorage) + delete(rawMsg, key) + case "vipIds": + err = unpopulate(val, "VipIDs", &e.VipIDs) + delete(rawMsg, key) + case "vnetId": + err = unpopulate(val, "VnetID", &e.VnetID) + delete(rawMsg, key) + case "zoneOcid": + err = unpopulate(val, "ZoneOcid", &e.ZoneOcid) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbIormConfig. -func (d DbIormConfig) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExadbVMClusterStorageDetails. +func (e ExadbVMClusterStorageDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dbName", d.DbName) - populate(objectMap, "flashCacheLimit", d.FlashCacheLimit) - populate(objectMap, "share", d.Share) + populate(objectMap, "totalSizeInGbs", e.TotalSizeInGbs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbIormConfig. -func (d *DbIormConfig) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExadbVMClusterStorageDetails. +func (e *ExadbVMClusterStorageDetails) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "dbName": - err = unpopulate(val, "DbName", &d.DbName) - delete(rawMsg, key) - case "flashCacheLimit": - err = unpopulate(val, "FlashCacheLimit", &d.FlashCacheLimit) - delete(rawMsg, key) - case "share": - err = unpopulate(val, "Share", &d.Share) + case "totalSizeInGbs": + err = unpopulate(val, "TotalSizeInGbs", &e.TotalSizeInGbs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbNode. -func (d DbNode) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExadbVMClusterUpdate. +func (e ExadbVMClusterUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "zones", e.Zones) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbNode. -func (d *DbNode) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExadbVMClusterUpdate. +func (e *ExadbVMClusterUpdate) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &d.Properties) + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "zones": + err = unpopulate(val, "Zones", &e.Zones) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbNodeAction. -func (d DbNodeAction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExadbVMClusterUpdateProperties. +func (e ExadbVMClusterUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", d.Action) + populate(objectMap, "nodeCount", e.NodeCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbNodeAction. -func (d *DbNodeAction) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExadbVMClusterUpdateProperties. +func (e *ExadbVMClusterUpdateProperties) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &d.Action) + case "nodeCount": + err = unpopulate(val, "NodeCount", &e.NodeCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbNodeListResult. -func (d DbNodeListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbNode. +func (e ExascaleDbNode) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbNodeListResult. -func (d *DbNodeListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbNode. +func (e *ExascaleDbNode) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbNodeProperties. -func (d DbNodeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbNodeListResult. +func (e ExascaleDbNodeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalDetails", d.AdditionalDetails) - populate(objectMap, "backupIpId", d.BackupIPID) - populate(objectMap, "backupVnic2Id", d.BackupVnic2ID) - populate(objectMap, "backupVnicId", d.BackupVnicID) - populate(objectMap, "cpuCoreCount", d.CPUCoreCount) - populate(objectMap, "dbNodeStorageSizeInGbs", d.DbNodeStorageSizeInGbs) - populate(objectMap, "dbServerId", d.DbServerID) - populate(objectMap, "dbSystemId", d.DbSystemID) - populate(objectMap, "faultDomain", d.FaultDomain) - populate(objectMap, "hostIpId", d.HostIPID) - populate(objectMap, "hostname", d.Hostname) - populate(objectMap, "lifecycleDetails", d.LifecycleDetails) - populate(objectMap, "lifecycleState", d.LifecycleState) - populate(objectMap, "maintenanceType", d.MaintenanceType) - populate(objectMap, "memorySizeInGbs", d.MemorySizeInGbs) - populate(objectMap, "ocid", d.Ocid) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "softwareStorageSizeInGb", d.SoftwareStorageSizeInGb) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populateDateTimeRFC3339(objectMap, "timeMaintenanceWindowEnd", d.TimeMaintenanceWindowEnd) - populateDateTimeRFC3339(objectMap, "timeMaintenanceWindowStart", d.TimeMaintenanceWindowStart) - populate(objectMap, "vnic2Id", d.Vnic2ID) - populate(objectMap, "vnicId", d.VnicID) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbNodeListResult. +func (e *ExascaleDbNodeListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbNodeProperties. +func (e ExascaleDbNodeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalDetails", e.AdditionalDetails) + populate(objectMap, "cpuCoreCount", e.CPUCoreCount) + populate(objectMap, "dbNodeStorageSizeInGbs", e.DbNodeStorageSizeInGbs) + populate(objectMap, "faultDomain", e.FaultDomain) + populate(objectMap, "hostname", e.Hostname) + populate(objectMap, "lifecycleState", e.LifecycleState) + populate(objectMap, "maintenanceType", e.MaintenanceType) + populate(objectMap, "memorySizeInGbs", e.MemorySizeInGbs) + populate(objectMap, "ocid", e.Ocid) + populate(objectMap, "softwareStorageSizeInGb", e.SoftwareStorageSizeInGb) + populateDateTimeRFC3339(objectMap, "timeMaintenanceWindowEnd", e.TimeMaintenanceWindowEnd) + populateDateTimeRFC3339(objectMap, "timeMaintenanceWindowStart", e.TimeMaintenanceWindowStart) + populate(objectMap, "totalCpuCoreCount", e.TotalCPUCoreCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbNodeProperties. -func (d *DbNodeProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbNodeProperties. +func (e *ExascaleDbNodeProperties) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "additionalDetails": - err = unpopulate(val, "AdditionalDetails", &d.AdditionalDetails) - delete(rawMsg, key) - case "backupIpId": - err = unpopulate(val, "BackupIPID", &d.BackupIPID) - delete(rawMsg, key) - case "backupVnic2Id": - err = unpopulate(val, "BackupVnic2ID", &d.BackupVnic2ID) - delete(rawMsg, key) - case "backupVnicId": - err = unpopulate(val, "BackupVnicID", &d.BackupVnicID) + err = unpopulate(val, "AdditionalDetails", &e.AdditionalDetails) delete(rawMsg, key) case "cpuCoreCount": - err = unpopulate(val, "CPUCoreCount", &d.CPUCoreCount) + err = unpopulate(val, "CPUCoreCount", &e.CPUCoreCount) delete(rawMsg, key) case "dbNodeStorageSizeInGbs": - err = unpopulate(val, "DbNodeStorageSizeInGbs", &d.DbNodeStorageSizeInGbs) - delete(rawMsg, key) - case "dbServerId": - err = unpopulate(val, "DbServerID", &d.DbServerID) - delete(rawMsg, key) - case "dbSystemId": - err = unpopulate(val, "DbSystemID", &d.DbSystemID) + err = unpopulate(val, "DbNodeStorageSizeInGbs", &e.DbNodeStorageSizeInGbs) delete(rawMsg, key) case "faultDomain": - err = unpopulate(val, "FaultDomain", &d.FaultDomain) - delete(rawMsg, key) - case "hostIpId": - err = unpopulate(val, "HostIPID", &d.HostIPID) + err = unpopulate(val, "FaultDomain", &e.FaultDomain) delete(rawMsg, key) case "hostname": - err = unpopulate(val, "Hostname", &d.Hostname) - delete(rawMsg, key) - case "lifecycleDetails": - err = unpopulate(val, "LifecycleDetails", &d.LifecycleDetails) + err = unpopulate(val, "Hostname", &e.Hostname) delete(rawMsg, key) case "lifecycleState": - err = unpopulate(val, "LifecycleState", &d.LifecycleState) + err = unpopulate(val, "LifecycleState", &e.LifecycleState) delete(rawMsg, key) case "maintenanceType": - err = unpopulate(val, "MaintenanceType", &d.MaintenanceType) + err = unpopulate(val, "MaintenanceType", &e.MaintenanceType) delete(rawMsg, key) case "memorySizeInGbs": - err = unpopulate(val, "MemorySizeInGbs", &d.MemorySizeInGbs) + err = unpopulate(val, "MemorySizeInGbs", &e.MemorySizeInGbs) delete(rawMsg, key) case "ocid": - err = unpopulate(val, "Ocid", &d.Ocid) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + err = unpopulate(val, "Ocid", &e.Ocid) delete(rawMsg, key) case "softwareStorageSizeInGb": - err = unpopulate(val, "SoftwareStorageSizeInGb", &d.SoftwareStorageSizeInGb) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) + err = unpopulate(val, "SoftwareStorageSizeInGb", &e.SoftwareStorageSizeInGb) delete(rawMsg, key) case "timeMaintenanceWindowEnd": - err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceWindowEnd", &d.TimeMaintenanceWindowEnd) + err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceWindowEnd", &e.TimeMaintenanceWindowEnd) delete(rawMsg, key) case "timeMaintenanceWindowStart": - err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceWindowStart", &d.TimeMaintenanceWindowStart) - delete(rawMsg, key) - case "vnic2Id": - err = unpopulate(val, "Vnic2ID", &d.Vnic2ID) + err = unpopulateDateTimeRFC3339(val, "TimeMaintenanceWindowStart", &e.TimeMaintenanceWindowStart) delete(rawMsg, key) - case "vnicId": - err = unpopulate(val, "VnicID", &d.VnicID) + case "totalCpuCoreCount": + err = unpopulate(val, "TotalCPUCoreCount", &e.TotalCPUCoreCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbServer. -func (d DbServer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbStorageDetails. +func (e ExascaleDbStorageDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "availableSizeInGbs", e.AvailableSizeInGbs) + populate(objectMap, "totalSizeInGbs", e.TotalSizeInGbs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbServer. -func (d *DbServer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbStorageDetails. +func (e *ExascaleDbStorageDetails) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "availableSizeInGbs": + err = unpopulate(val, "AvailableSizeInGbs", &e.AvailableSizeInGbs) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "totalSizeInGbs": + err = unpopulate(val, "TotalSizeInGbs", &e.TotalSizeInGbs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbServerListResult. -func (d DbServerListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbStorageInputDetails. +func (e ExascaleDbStorageInputDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "totalSizeInGbs", e.TotalSizeInGbs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerListResult. -func (d *DbServerListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbStorageInputDetails. +func (e *ExascaleDbStorageInputDetails) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "totalSizeInGbs": + err = unpopulate(val, "TotalSizeInGbs", &e.TotalSizeInGbs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbServerPatchingDetails. -func (d DbServerPatchingDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbStorageVault. +func (e ExascaleDbStorageVault) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "estimatedPatchDuration", d.EstimatedPatchDuration) - populate(objectMap, "patchingStatus", d.PatchingStatus) - populateDateTimeRFC3339(objectMap, "timePatchingEnded", d.TimePatchingEnded) - populateDateTimeRFC3339(objectMap, "timePatchingStarted", d.TimePatchingStarted) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + populate(objectMap, "zones", e.Zones) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerPatchingDetails. -func (d *DbServerPatchingDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbStorageVault. +func (e *ExascaleDbStorageVault) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "estimatedPatchDuration": - err = unpopulate(val, "EstimatedPatchDuration", &d.EstimatedPatchDuration) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "patchingStatus": - err = unpopulate(val, "PatchingStatus", &d.PatchingStatus) + case "location": + err = unpopulate(val, "Location", &e.Location) delete(rawMsg, key) - case "timePatchingEnded": - err = unpopulateDateTimeRFC3339(val, "TimePatchingEnded", &d.TimePatchingEnded) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "timePatchingStarted": - err = unpopulateDateTimeRFC3339(val, "TimePatchingStarted", &d.TimePatchingStarted) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &e.Zones) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbServerProperties. -func (d DbServerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbStorageVaultListResult. +func (e ExascaleDbStorageVaultListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autonomousVmClusterIds", d.AutonomousVMClusterIDs) - populate(objectMap, "autonomousVirtualMachineIds", d.AutonomousVirtualMachineIDs) - populate(objectMap, "cpuCoreCount", d.CPUCoreCount) - populate(objectMap, "compartmentId", d.CompartmentID) - populate(objectMap, "dbNodeIds", d.DbNodeIDs) - populate(objectMap, "dbNodeStorageSizeInGbs", d.DbNodeStorageSizeInGbs) - populate(objectMap, "dbServerPatchingDetails", d.DbServerPatchingDetails) - populate(objectMap, "displayName", d.DisplayName) - populate(objectMap, "exadataInfrastructureId", d.ExadataInfrastructureID) - populate(objectMap, "lifecycleDetails", d.LifecycleDetails) - populate(objectMap, "lifecycleState", d.LifecycleState) - populate(objectMap, "maxCpuCount", d.MaxCPUCount) - populate(objectMap, "maxDbNodeStorageInGbs", d.MaxDbNodeStorageInGbs) - populate(objectMap, "maxMemoryInGbs", d.MaxMemoryInGbs) - populate(objectMap, "memorySizeInGbs", d.MemorySizeInGbs) - populate(objectMap, "ocid", d.Ocid) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "shape", d.Shape) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populate(objectMap, "vmClusterIds", d.VMClusterIDs) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbServerProperties. -func (d *DbServerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbStorageVaultListResult. +func (e *ExascaleDbStorageVaultListResult) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "autonomousVmClusterIds": - err = unpopulate(val, "AutonomousVMClusterIDs", &d.AutonomousVMClusterIDs) - delete(rawMsg, key) - case "autonomousVirtualMachineIds": - err = unpopulate(val, "AutonomousVirtualMachineIDs", &d.AutonomousVirtualMachineIDs) - delete(rawMsg, key) - case "cpuCoreCount": - err = unpopulate(val, "CPUCoreCount", &d.CPUCoreCount) - delete(rawMsg, key) - case "compartmentId": - err = unpopulate(val, "CompartmentID", &d.CompartmentID) + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) delete(rawMsg, key) - case "dbNodeIds": - err = unpopulate(val, "DbNodeIDs", &d.DbNodeIDs) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) - case "dbNodeStorageSizeInGbs": - err = unpopulate(val, "DbNodeStorageSizeInGbs", &d.DbNodeStorageSizeInGbs) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbStorageVaultProperties. +func (e ExascaleDbStorageVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalFlashCacheInPercent", e.AdditionalFlashCacheInPercent) + populate(objectMap, "description", e.Description) + populate(objectMap, "displayName", e.DisplayName) + populate(objectMap, "highCapacityDatabaseStorage", e.HighCapacityDatabaseStorage) + populate(objectMap, "highCapacityDatabaseStorageInput", e.HighCapacityDatabaseStorageInput) + populate(objectMap, "lifecycleDetails", e.LifecycleDetails) + populate(objectMap, "lifecycleState", e.LifecycleState) + populate(objectMap, "ociUrl", e.OciURL) + populate(objectMap, "ocid", e.Ocid) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "timeZone", e.TimeZone) + populate(objectMap, "vmClusterCount", e.VMClusterCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbStorageVaultProperties. +func (e *ExascaleDbStorageVaultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalFlashCacheInPercent": + err = unpopulate(val, "AdditionalFlashCacheInPercent", &e.AdditionalFlashCacheInPercent) delete(rawMsg, key) - case "dbServerPatchingDetails": - err = unpopulate(val, "DbServerPatchingDetails", &d.DbServerPatchingDetails) + case "description": + err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) case "displayName": - err = unpopulate(val, "DisplayName", &d.DisplayName) + err = unpopulate(val, "DisplayName", &e.DisplayName) delete(rawMsg, key) - case "exadataInfrastructureId": - err = unpopulate(val, "ExadataInfrastructureID", &d.ExadataInfrastructureID) + case "highCapacityDatabaseStorage": + err = unpopulate(val, "HighCapacityDatabaseStorage", &e.HighCapacityDatabaseStorage) + delete(rawMsg, key) + case "highCapacityDatabaseStorageInput": + err = unpopulate(val, "HighCapacityDatabaseStorageInput", &e.HighCapacityDatabaseStorageInput) delete(rawMsg, key) case "lifecycleDetails": - err = unpopulate(val, "LifecycleDetails", &d.LifecycleDetails) + err = unpopulate(val, "LifecycleDetails", &e.LifecycleDetails) delete(rawMsg, key) case "lifecycleState": - err = unpopulate(val, "LifecycleState", &d.LifecycleState) - delete(rawMsg, key) - case "maxCpuCount": - err = unpopulate(val, "MaxCPUCount", &d.MaxCPUCount) - delete(rawMsg, key) - case "maxDbNodeStorageInGbs": - err = unpopulate(val, "MaxDbNodeStorageInGbs", &d.MaxDbNodeStorageInGbs) - delete(rawMsg, key) - case "maxMemoryInGbs": - err = unpopulate(val, "MaxMemoryInGbs", &d.MaxMemoryInGbs) + err = unpopulate(val, "LifecycleState", &e.LifecycleState) delete(rawMsg, key) - case "memorySizeInGbs": - err = unpopulate(val, "MemorySizeInGbs", &d.MemorySizeInGbs) + case "ociUrl": + err = unpopulate(val, "OciURL", &e.OciURL) delete(rawMsg, key) case "ocid": - err = unpopulate(val, "Ocid", &d.Ocid) + err = unpopulate(val, "Ocid", &e.Ocid) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) delete(rawMsg, key) - case "shape": - err = unpopulate(val, "Shape", &d.Shape) + case "timeZone": + err = unpopulate(val, "TimeZone", &e.TimeZone) delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) + case "vmClusterCount": + err = unpopulate(val, "VMClusterCount", &e.VMClusterCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExascaleDbStorageVaultTagsUpdate. +func (e ExascaleDbStorageVaultTagsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", e.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExascaleDbStorageVaultTagsUpdate. +func (e *ExascaleDbStorageVaultTagsUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileSystemConfigurationDetails. +func (f FileSystemConfigurationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fileSystemSizeGb", f.FileSystemSizeGb) + populate(objectMap, "mountPoint", f.MountPoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileSystemConfigurationDetails. +func (f *FileSystemConfigurationDetails) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fileSystemSizeGb": + err = unpopulate(val, "FileSystemSizeGb", &f.FileSystemSizeGb) delete(rawMsg, key) - case "vmClusterIds": - err = unpopulate(val, "VMClusterIDs", &d.VMClusterIDs) + case "mountPoint": + err = unpopulate(val, "MountPoint", &f.MountPoint) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbSystemShape. -func (d DbSystemShape) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FlexComponent. +func (f FlexComponent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbSystemShape. -func (d *DbSystemShape) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FlexComponent. +func (f *FlexComponent) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &d.ID) + err = unpopulate(val, "ID", &f.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &d.Name) + err = unpopulate(val, "Name", &f.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &d.Properties) + err = unpopulate(val, "Properties", &f.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + err = unpopulate(val, "SystemData", &f.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &d.Type) + err = unpopulate(val, "Type", &f.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbSystemShapeListResult. -func (d DbSystemShapeListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FlexComponentListResult. +func (f FlexComponentListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbSystemShapeListResult. -func (d *DbSystemShapeListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FlexComponentListResult. +func (f *FlexComponentListResult) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + err = unpopulate(val, "NextLink", &f.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &d.Value) + err = unpopulate(val, "Value", &f.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DbSystemShapeProperties. -func (d DbSystemShapeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FlexComponentProperties. +func (f FlexComponentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "availableCoreCount", d.AvailableCoreCount) - populate(objectMap, "availableCoreCountPerNode", d.AvailableCoreCountPerNode) - populate(objectMap, "availableDataStorageInTbs", d.AvailableDataStorageInTbs) - populate(objectMap, "availableDataStoragePerServerInTbs", d.AvailableDataStoragePerServerInTbs) - populate(objectMap, "availableDbNodePerNodeInGbs", d.AvailableDbNodePerNodeInGbs) - populate(objectMap, "availableDbNodeStorageInGbs", d.AvailableDbNodeStorageInGbs) - populate(objectMap, "availableMemoryInGbs", d.AvailableMemoryInGbs) - populate(objectMap, "availableMemoryPerNodeInGbs", d.AvailableMemoryPerNodeInGbs) - populate(objectMap, "coreCountIncrement", d.CoreCountIncrement) - populate(objectMap, "maxStorageCount", d.MaxStorageCount) - populate(objectMap, "maximumNodeCount", d.MaximumNodeCount) - populate(objectMap, "minCoreCountPerNode", d.MinCoreCountPerNode) - populate(objectMap, "minDataStorageInTbs", d.MinDataStorageInTbs) - populate(objectMap, "minDbNodeStoragePerNodeInGbs", d.MinDbNodeStoragePerNodeInGbs) - populate(objectMap, "minMemoryPerNodeInGbs", d.MinMemoryPerNodeInGbs) - populate(objectMap, "minStorageCount", d.MinStorageCount) - populate(objectMap, "minimumCoreCount", d.MinimumCoreCount) - populate(objectMap, "minimumNodeCount", d.MinimumNodeCount) - populate(objectMap, "runtimeMinimumCoreCount", d.RuntimeMinimumCoreCount) - populate(objectMap, "shapeFamily", d.ShapeFamily) + populate(objectMap, "availableCoreCount", f.AvailableCoreCount) + populate(objectMap, "availableDbStorageInGbs", f.AvailableDbStorageInGbs) + populate(objectMap, "availableLocalStorageInGbs", f.AvailableLocalStorageInGbs) + populate(objectMap, "availableMemoryInGbs", f.AvailableMemoryInGbs) + populate(objectMap, "computeModel", f.ComputeModel) + populate(objectMap, "descriptionSummary", f.DescriptionSummary) + populate(objectMap, "hardwareType", f.HardwareType) + populate(objectMap, "minimumCoreCount", f.MinimumCoreCount) + populate(objectMap, "runtimeMinimumCoreCount", f.RuntimeMinimumCoreCount) + populate(objectMap, "shape", f.Shape) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DbSystemShapeProperties. -func (d *DbSystemShapeProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FlexComponentProperties. +func (f *FlexComponentProperties) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { case "availableCoreCount": - err = unpopulate(val, "AvailableCoreCount", &d.AvailableCoreCount) - delete(rawMsg, key) - case "availableCoreCountPerNode": - err = unpopulate(val, "AvailableCoreCountPerNode", &d.AvailableCoreCountPerNode) - delete(rawMsg, key) - case "availableDataStorageInTbs": - err = unpopulate(val, "AvailableDataStorageInTbs", &d.AvailableDataStorageInTbs) - delete(rawMsg, key) - case "availableDataStoragePerServerInTbs": - err = unpopulate(val, "AvailableDataStoragePerServerInTbs", &d.AvailableDataStoragePerServerInTbs) + err = unpopulate(val, "AvailableCoreCount", &f.AvailableCoreCount) delete(rawMsg, key) - case "availableDbNodePerNodeInGbs": - err = unpopulate(val, "AvailableDbNodePerNodeInGbs", &d.AvailableDbNodePerNodeInGbs) + case "availableDbStorageInGbs": + err = unpopulate(val, "AvailableDbStorageInGbs", &f.AvailableDbStorageInGbs) delete(rawMsg, key) - case "availableDbNodeStorageInGbs": - err = unpopulate(val, "AvailableDbNodeStorageInGbs", &d.AvailableDbNodeStorageInGbs) + case "availableLocalStorageInGbs": + err = unpopulate(val, "AvailableLocalStorageInGbs", &f.AvailableLocalStorageInGbs) delete(rawMsg, key) case "availableMemoryInGbs": - err = unpopulate(val, "AvailableMemoryInGbs", &d.AvailableMemoryInGbs) - delete(rawMsg, key) - case "availableMemoryPerNodeInGbs": - err = unpopulate(val, "AvailableMemoryPerNodeInGbs", &d.AvailableMemoryPerNodeInGbs) - delete(rawMsg, key) - case "coreCountIncrement": - err = unpopulate(val, "CoreCountIncrement", &d.CoreCountIncrement) - delete(rawMsg, key) - case "maxStorageCount": - err = unpopulate(val, "MaxStorageCount", &d.MaxStorageCount) - delete(rawMsg, key) - case "maximumNodeCount": - err = unpopulate(val, "MaximumNodeCount", &d.MaximumNodeCount) - delete(rawMsg, key) - case "minCoreCountPerNode": - err = unpopulate(val, "MinCoreCountPerNode", &d.MinCoreCountPerNode) + err = unpopulate(val, "AvailableMemoryInGbs", &f.AvailableMemoryInGbs) delete(rawMsg, key) - case "minDataStorageInTbs": - err = unpopulate(val, "MinDataStorageInTbs", &d.MinDataStorageInTbs) - delete(rawMsg, key) - case "minDbNodeStoragePerNodeInGbs": - err = unpopulate(val, "MinDbNodeStoragePerNodeInGbs", &d.MinDbNodeStoragePerNodeInGbs) + case "computeModel": + err = unpopulate(val, "ComputeModel", &f.ComputeModel) delete(rawMsg, key) - case "minMemoryPerNodeInGbs": - err = unpopulate(val, "MinMemoryPerNodeInGbs", &d.MinMemoryPerNodeInGbs) + case "descriptionSummary": + err = unpopulate(val, "DescriptionSummary", &f.DescriptionSummary) delete(rawMsg, key) - case "minStorageCount": - err = unpopulate(val, "MinStorageCount", &d.MinStorageCount) + case "hardwareType": + err = unpopulate(val, "HardwareType", &f.HardwareType) delete(rawMsg, key) case "minimumCoreCount": - err = unpopulate(val, "MinimumCoreCount", &d.MinimumCoreCount) - delete(rawMsg, key) - case "minimumNodeCount": - err = unpopulate(val, "MinimumNodeCount", &d.MinimumNodeCount) + err = unpopulate(val, "MinimumCoreCount", &f.MinimumCoreCount) delete(rawMsg, key) case "runtimeMinimumCoreCount": - err = unpopulate(val, "RuntimeMinimumCoreCount", &d.RuntimeMinimumCoreCount) + err = unpopulate(val, "RuntimeMinimumCoreCount", &f.RuntimeMinimumCoreCount) delete(rawMsg, key) - case "shapeFamily": - err = unpopulate(val, "ShapeFamily", &d.ShapeFamily) + case "shape": + err = unpopulate(val, "Shape", &f.Shape) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EstimatedPatchingTime. -func (e EstimatedPatchingTime) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GenerateAutonomousDatabaseWalletDetails. +func (g GenerateAutonomousDatabaseWalletDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "estimatedDbServerPatchingTime", e.EstimatedDbServerPatchingTime) - populate(objectMap, "estimatedNetworkSwitchesPatchingTime", e.EstimatedNetworkSwitchesPatchingTime) - populate(objectMap, "estimatedStorageServerPatchingTime", e.EstimatedStorageServerPatchingTime) - populate(objectMap, "totalEstimatedPatchingTime", e.TotalEstimatedPatchingTime) + populate(objectMap, "generateType", g.GenerateType) + populate(objectMap, "isRegional", g.IsRegional) + populate(objectMap, "password", g.Password) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EstimatedPatchingTime. -func (e *EstimatedPatchingTime) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateAutonomousDatabaseWalletDetails. +func (g *GenerateAutonomousDatabaseWalletDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "estimatedDbServerPatchingTime": - err = unpopulate(val, "EstimatedDbServerPatchingTime", &e.EstimatedDbServerPatchingTime) - delete(rawMsg, key) - case "estimatedNetworkSwitchesPatchingTime": - err = unpopulate(val, "EstimatedNetworkSwitchesPatchingTime", &e.EstimatedNetworkSwitchesPatchingTime) + case "generateType": + err = unpopulate(val, "GenerateType", &g.GenerateType) delete(rawMsg, key) - case "estimatedStorageServerPatchingTime": - err = unpopulate(val, "EstimatedStorageServerPatchingTime", &e.EstimatedStorageServerPatchingTime) + case "isRegional": + err = unpopulate(val, "IsRegional", &g.IsRegional) delete(rawMsg, key) - case "totalEstimatedPatchingTime": - err = unpopulate(val, "TotalEstimatedPatchingTime", &e.TotalEstimatedPatchingTime) + case "password": + err = unpopulate(val, "Password", &g.Password) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExadataIormConfig. -func (e ExadataIormConfig) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GiMinorVersion. +func (g GiMinorVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dbPlans", e.DbPlans) - populate(objectMap, "lifecycleDetails", e.LifecycleDetails) - populate(objectMap, "lifecycleState", e.LifecycleState) - populate(objectMap, "objective", e.Objective) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExadataIormConfig. -func (e *ExadataIormConfig) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GiMinorVersion. +func (g *GiMinorVersion) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "dbPlans": - err = unpopulate(val, "DbPlans", &e.DbPlans) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "lifecycleDetails": - err = unpopulate(val, "LifecycleDetails", &e.LifecycleDetails) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "lifecycleState": - err = unpopulate(val, "LifecycleState", &e.LifecycleState) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "objective": - err = unpopulate(val, "Objective", &e.Objective) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenerateAutonomousDatabaseWalletDetails. -func (g GenerateAutonomousDatabaseWalletDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GiMinorVersionListResult. +func (g GiMinorVersionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "generateType", g.GenerateType) - populate(objectMap, "isRegional", g.IsRegional) - populate(objectMap, "password", g.Password) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateAutonomousDatabaseWalletDetails. -func (g *GenerateAutonomousDatabaseWalletDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GiMinorVersionListResult. +func (g *GiMinorVersionListResult) 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", g, err) @@ -3933,14 +5862,42 @@ func (g *GenerateAutonomousDatabaseWalletDetails) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "generateType": - err = unpopulate(val, "GenerateType", &g.GenerateType) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) - case "isRegional": - err = unpopulate(val, "IsRegional", &g.IsRegional) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &g.Password) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GiMinorVersionProperties. +func (g GiMinorVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gridImageOcid", g.GridImageOcid) + populate(objectMap, "version", g.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GiMinorVersionProperties. +func (g *GiMinorVersionProperties) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gridImageOcid": + err = unpopulate(val, "GridImageOcid", &g.GridImageOcid) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &g.Version) delete(rawMsg, key) } if err != nil { @@ -4405,9 +6362,12 @@ func (o *OracleSubscriptionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OracleSubscriptionProperties. func (o OracleSubscriptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "addSubscriptionOperationState", o.AddSubscriptionOperationState) + populate(objectMap, "azureSubscriptionIds", o.AzureSubscriptionIDs) populate(objectMap, "cloudAccountId", o.CloudAccountID) populate(objectMap, "cloudAccountState", o.CloudAccountState) populate(objectMap, "intent", o.Intent) + populate(objectMap, "lastOperationStatusDetail", o.LastOperationStatusDetail) populate(objectMap, "productCode", o.ProductCode) populate(objectMap, "provisioningState", o.ProvisioningState) populate(objectMap, "saasSubscriptionId", o.SaasSubscriptionID) @@ -4424,6 +6384,12 @@ func (o *OracleSubscriptionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "addSubscriptionOperationState": + err = unpopulate(val, "AddSubscriptionOperationState", &o.AddSubscriptionOperationState) + delete(rawMsg, key) + case "azureSubscriptionIds": + err = unpopulate(val, "AzureSubscriptionIDs", &o.AzureSubscriptionIDs) + delete(rawMsg, key) case "cloudAccountId": err = unpopulate(val, "CloudAccountID", &o.CloudAccountID) delete(rawMsg, key) @@ -4433,6 +6399,9 @@ func (o *OracleSubscriptionProperties) UnmarshalJSON(data []byte) error { case "intent": err = unpopulate(val, "Intent", &o.Intent) delete(rawMsg, key) + case "lastOperationStatusDetail": + err = unpopulate(val, "LastOperationStatusDetail", &o.LastOperationStatusDetail) + delete(rawMsg, key) case "productCode": err = unpopulate(val, "ProductCode", &o.ProductCode) delete(rawMsg, key) @@ -4519,6 +6488,8 @@ func (o *OracleSubscriptionUpdateProperties) UnmarshalJSON(data []byte) error { func (p PeerDbDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "peerDbId", p.PeerDbID) + populate(objectMap, "peerDbLocation", p.PeerDbLocation) + populate(objectMap, "peerDbOcid", p.PeerDbOcid) return json.Marshal(objectMap) } @@ -4534,6 +6505,12 @@ func (p *PeerDbDetails) UnmarshalJSON(data []byte) error { case "peerDbId": err = unpopulate(val, "PeerDbID", &p.PeerDbID) delete(rawMsg, key) + case "peerDbLocation": + err = unpopulate(val, "PeerDbLocation", &p.PeerDbLocation) + delete(rawMsg, key) + case "peerDbOcid": + err = unpopulate(val, "PeerDbOcid", &p.PeerDbOcid) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -4792,6 +6769,33 @@ func (p *ProfileType) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RemoveVirtualMachineFromExadbVMClusterDetails. +func (r RemoveVirtualMachineFromExadbVMClusterDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dbNodes", r.DbNodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RemoveVirtualMachineFromExadbVMClusterDetails. +func (r *RemoveVirtualMachineFromExadbVMClusterDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dbNodes": + err = unpopulate(val, "DbNodes", &r.DbNodes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RestoreAutonomousDatabaseDetails. func (r RestoreAutonomousDatabaseDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client.go index 3afa79d96e07..dd71a20be737 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -65,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Oracle.Database/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client_example_test.go deleted file mode 100644 index fc5cc5ef79a8..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/operations_client_example_test.go +++ /dev/null @@ -1,56 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/operations_list.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armoracledatabase.OperationListResult{ - // Value: []*armoracledatabase.Operation{ - // { - // Name: to.Ptr("Oracle.Database/cloudExadataInfrastructures/Read"), - // Display: &armoracledatabase.OperationDisplay{ - // Description: to.Ptr("Reads Exadata Infrastructure"), - // Operation: to.Ptr("Get/list Exadata Infrastructure resources"), - // Provider: to.Ptr("Oracle.Database"), - // Resource: to.Ptr("cloudExadataInfrastructures"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/options.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/options.go index 3ff90a3ca86e..95ed36bbefc9 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/options.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/options.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -11,21 +8,21 @@ package armoracledatabase // AutonomousDatabaseBackupsClientBeginCreateOrUpdateOptions contains the optional parameters for the AutonomousDatabaseBackupsClient.BeginCreateOrUpdate // method. type AutonomousDatabaseBackupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AutonomousDatabaseBackupsClientBeginDeleteOptions contains the optional parameters for the AutonomousDatabaseBackupsClient.BeginDelete // method. type AutonomousDatabaseBackupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AutonomousDatabaseBackupsClientBeginUpdateOptions contains the optional parameters for the AutonomousDatabaseBackupsClient.BeginUpdate // method. type AutonomousDatabaseBackupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -35,9 +32,9 @@ type AutonomousDatabaseBackupsClientGetOptions struct { // placeholder for future optional parameters } -// AutonomousDatabaseBackupsClientListByAutonomousDatabaseOptions contains the optional parameters for the AutonomousDatabaseBackupsClient.NewListByAutonomousDatabasePager +// AutonomousDatabaseBackupsClientListByParentOptions contains the optional parameters for the AutonomousDatabaseBackupsClient.NewListByParentPager // method. -type AutonomousDatabaseBackupsClientListByAutonomousDatabaseOptions struct { +type AutonomousDatabaseBackupsClientListByParentOptions struct { // placeholder for future optional parameters } @@ -77,52 +74,59 @@ type AutonomousDatabaseVersionsClientListByLocationOptions struct { // placeholder for future optional parameters } +// AutonomousDatabasesClientBeginChangeDisasterRecoveryConfigurationOptions contains the optional parameters for the AutonomousDatabasesClient.BeginChangeDisasterRecoveryConfiguration +// method. +type AutonomousDatabasesClientBeginChangeDisasterRecoveryConfigurationOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // AutonomousDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the AutonomousDatabasesClient.BeginCreateOrUpdate // method. type AutonomousDatabasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AutonomousDatabasesClientBeginDeleteOptions contains the optional parameters for the AutonomousDatabasesClient.BeginDelete // method. type AutonomousDatabasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AutonomousDatabasesClientBeginFailoverOptions contains the optional parameters for the AutonomousDatabasesClient.BeginFailover // method. type AutonomousDatabasesClientBeginFailoverOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AutonomousDatabasesClientBeginRestoreOptions contains the optional parameters for the AutonomousDatabasesClient.BeginRestore // method. type AutonomousDatabasesClientBeginRestoreOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AutonomousDatabasesClientBeginShrinkOptions contains the optional parameters for the AutonomousDatabasesClient.BeginShrink // method. type AutonomousDatabasesClientBeginShrinkOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AutonomousDatabasesClientBeginSwitchoverOptions contains the optional parameters for the AutonomousDatabasesClient.BeginSwitchover // method. type AutonomousDatabasesClientBeginSwitchoverOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AutonomousDatabasesClientBeginUpdateOptions contains the optional parameters for the AutonomousDatabasesClient.BeginUpdate // method. type AutonomousDatabasesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -152,28 +156,28 @@ type AutonomousDatabasesClientListBySubscriptionOptions struct { // CloudExadataInfrastructuresClientBeginAddStorageCapacityOptions contains the optional parameters for the CloudExadataInfrastructuresClient.BeginAddStorageCapacity // method. type CloudExadataInfrastructuresClientBeginAddStorageCapacityOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CloudExadataInfrastructuresClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudExadataInfrastructuresClient.BeginCreateOrUpdate // method. type CloudExadataInfrastructuresClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CloudExadataInfrastructuresClientBeginDeleteOptions contains the optional parameters for the CloudExadataInfrastructuresClient.BeginDelete // method. type CloudExadataInfrastructuresClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CloudExadataInfrastructuresClientBeginUpdateOptions contains the optional parameters for the CloudExadataInfrastructuresClient.BeginUpdate // method. type CloudExadataInfrastructuresClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -197,33 +201,33 @@ type CloudExadataInfrastructuresClientListBySubscriptionOptions struct { // CloudVMClustersClientBeginAddVMsOptions contains the optional parameters for the CloudVMClustersClient.BeginAddVMs method. type CloudVMClustersClientBeginAddVMsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CloudVMClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudVMClustersClient.BeginCreateOrUpdate // method. type CloudVMClustersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CloudVMClustersClientBeginDeleteOptions contains the optional parameters for the CloudVMClustersClient.BeginDelete method. type CloudVMClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CloudVMClustersClientBeginRemoveVMsOptions contains the optional parameters for the CloudVMClustersClient.BeginRemoveVMs // method. type CloudVMClustersClientBeginRemoveVMsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CloudVMClustersClientBeginUpdateOptions contains the optional parameters for the CloudVMClustersClient.BeginUpdate method. type CloudVMClustersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -274,7 +278,7 @@ type DNSPrivateZonesClientListByLocationOptions struct { // DbNodesClientBeginActionOptions contains the optional parameters for the DbNodesClient.BeginAction method. type DbNodesClientBeginActionOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -283,9 +287,8 @@ type DbNodesClientGetOptions struct { // placeholder for future optional parameters } -// DbNodesClientListByCloudVMClusterOptions contains the optional parameters for the DbNodesClient.NewListByCloudVMClusterPager -// method. -type DbNodesClientListByCloudVMClusterOptions struct { +// DbNodesClientListByParentOptions contains the optional parameters for the DbNodesClient.NewListByParentPager method. +type DbNodesClientListByParentOptions struct { // placeholder for future optional parameters } @@ -294,9 +297,8 @@ type DbServersClientGetOptions struct { // placeholder for future optional parameters } -// DbServersClientListByCloudExadataInfrastructureOptions contains the optional parameters for the DbServersClient.NewListByCloudExadataInfrastructurePager -// method. -type DbServersClientListByCloudExadataInfrastructureOptions struct { +// DbServersClientListByParentOptions contains the optional parameters for the DbServersClient.NewListByParentPager method. +type DbServersClientListByParentOptions struct { // placeholder for future optional parameters } @@ -308,9 +310,135 @@ type DbSystemShapesClientGetOptions struct { // DbSystemShapesClientListByLocationOptions contains the optional parameters for the DbSystemShapesClient.NewListByLocationPager // method. type DbSystemShapesClientListByLocationOptions struct { + // Filters the result for the given Azure Availability Zone + Zone *string +} + +// ExadbVMClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ExadbVMClustersClient.BeginCreateOrUpdate +// method. +type ExadbVMClustersClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExadbVMClustersClientBeginDeleteOptions contains the optional parameters for the ExadbVMClustersClient.BeginDelete method. +type ExadbVMClustersClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExadbVMClustersClientBeginRemoveVMsOptions contains the optional parameters for the ExadbVMClustersClient.BeginRemoveVMs +// method. +type ExadbVMClustersClientBeginRemoveVMsOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExadbVMClustersClientBeginUpdateOptions contains the optional parameters for the ExadbVMClustersClient.BeginUpdate method. +type ExadbVMClustersClientBeginUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExadbVMClustersClientGetOptions contains the optional parameters for the ExadbVMClustersClient.Get method. +type ExadbVMClustersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExadbVMClustersClientListByResourceGroupOptions contains the optional parameters for the ExadbVMClustersClient.NewListByResourceGroupPager +// method. +type ExadbVMClustersClientListByResourceGroupOptions struct { // placeholder for future optional parameters } +// ExadbVMClustersClientListBySubscriptionOptions contains the optional parameters for the ExadbVMClustersClient.NewListBySubscriptionPager +// method. +type ExadbVMClustersClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ExascaleDbNodesClientBeginActionOptions contains the optional parameters for the ExascaleDbNodesClient.BeginAction method. +type ExascaleDbNodesClientBeginActionOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExascaleDbNodesClientGetOptions contains the optional parameters for the ExascaleDbNodesClient.Get method. +type ExascaleDbNodesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExascaleDbNodesClientListByParentOptions contains the optional parameters for the ExascaleDbNodesClient.NewListByParentPager +// method. +type ExascaleDbNodesClientListByParentOptions struct { + // placeholder for future optional parameters +} + +// ExascaleDbStorageVaultsClientBeginCreateOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.BeginCreate +// method. +type ExascaleDbStorageVaultsClientBeginCreateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExascaleDbStorageVaultsClientBeginDeleteOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.BeginDelete +// method. +type ExascaleDbStorageVaultsClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExascaleDbStorageVaultsClientBeginUpdateOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.BeginUpdate +// method. +type ExascaleDbStorageVaultsClientBeginUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ExascaleDbStorageVaultsClientGetOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.Get method. +type ExascaleDbStorageVaultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExascaleDbStorageVaultsClientListByResourceGroupOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.NewListByResourceGroupPager +// method. +type ExascaleDbStorageVaultsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ExascaleDbStorageVaultsClientListBySubscriptionOptions contains the optional parameters for the ExascaleDbStorageVaultsClient.NewListBySubscriptionPager +// method. +type ExascaleDbStorageVaultsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// FlexComponentsClientGetOptions contains the optional parameters for the FlexComponentsClient.Get method. +type FlexComponentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FlexComponentsClientListByParentOptions contains the optional parameters for the FlexComponentsClient.NewListByParentPager +// method. +type FlexComponentsClientListByParentOptions struct { + // If provided, filters the results for the given shape + Shape *SystemShapes +} + +// GiMinorVersionsClientGetOptions contains the optional parameters for the GiMinorVersionsClient.Get method. +type GiMinorVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GiMinorVersionsClientListByParentOptions contains the optional parameters for the GiMinorVersionsClient.NewListByParentPager +// method. +type GiMinorVersionsClientListByParentOptions struct { + // If provided, filters the results to the set of database versions which are supported for the given shape family. + ShapeFamily *ShapeFamily + + // Filters the result for the given Azure Availability Zone + Zone *string +} + // GiVersionsClientGetOptions contains the optional parameters for the GiVersionsClient.Get method. type GiVersionsClientGetOptions struct { // placeholder for future optional parameters @@ -319,7 +447,11 @@ type GiVersionsClientGetOptions struct { // GiVersionsClientListByLocationOptions contains the optional parameters for the GiVersionsClient.NewListByLocationPager // method. type GiVersionsClientListByLocationOptions struct { - // placeholder for future optional parameters + // If provided, filters the results for the given shape + Shape *SystemShapes + + // Filters the result for the given Azure Availability Zone + Zone *string } // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. @@ -327,45 +459,52 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } +// OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginAddAzureSubscriptions +// method. +type OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // OracleSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the OracleSubscriptionsClient.BeginCreateOrUpdate // method. type OracleSubscriptionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OracleSubscriptionsClientBeginDeleteOptions contains the optional parameters for the OracleSubscriptionsClient.BeginDelete // method. type OracleSubscriptionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OracleSubscriptionsClientBeginListActivationLinksOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListActivationLinks // method. type OracleSubscriptionsClientBeginListActivationLinksOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OracleSubscriptionsClientBeginListCloudAccountDetailsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListCloudAccountDetails // method. type OracleSubscriptionsClientBeginListCloudAccountDetailsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListSaasSubscriptionDetails // method. type OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OracleSubscriptionsClientBeginUpdateOptions contains the optional parameters for the OracleSubscriptionsClient.BeginUpdate // method. type OracleSubscriptionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -394,14 +533,14 @@ type SystemVersionsClientListByLocationOptions struct { // VirtualNetworkAddressesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkAddressesClient.BeginCreateOrUpdate // method. type VirtualNetworkAddressesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkAddressesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkAddressesClient.BeginDelete // method. type VirtualNetworkAddressesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -410,8 +549,8 @@ type VirtualNetworkAddressesClientGetOptions struct { // placeholder for future optional parameters } -// VirtualNetworkAddressesClientListByCloudVMClusterOptions contains the optional parameters for the VirtualNetworkAddressesClient.NewListByCloudVMClusterPager +// VirtualNetworkAddressesClientListByParentOptions contains the optional parameters for the VirtualNetworkAddressesClient.NewListByParentPager // method. -type VirtualNetworkAddressesClientListByCloudVMClusterOptions struct { +type VirtualNetworkAddressesClientListByParentOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client.go index 9b251202d11f..df3c6f2a68b7 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -43,10 +40,81 @@ func NewOracleSubscriptionsClient(subscriptionID string, credential azcore.Token return client, nil } +// BeginAddAzureSubscriptions - Add Azure Subscriptions +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +// - body - The content of the action request +// - options - OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginAddAzureSubscriptions +// method. +func (client *OracleSubscriptionsClient) BeginAddAzureSubscriptions(ctx context.Context, body AzureSubscriptions, options *OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (*runtime.Poller[OracleSubscriptionsClientAddAzureSubscriptionsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.addAzureSubscriptions(ctx, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OracleSubscriptionsClientAddAzureSubscriptionsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OracleSubscriptionsClientAddAzureSubscriptionsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// AddAzureSubscriptions - Add Azure Subscriptions +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01 +func (client *OracleSubscriptionsClient) addAzureSubscriptions(ctx context.Context, body AzureSubscriptions, options *OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (*http.Response, error) { + var err error + const operationName = "OracleSubscriptionsClient.BeginAddAzureSubscriptions" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.addAzureSubscriptionsCreateRequest(ctx, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// addAzureSubscriptionsCreateRequest creates the AddAzureSubscriptions request. +func (client *OracleSubscriptionsClient) addAzureSubscriptionsCreateRequest(ctx context.Context, body AzureSubscriptions, _ *OracleSubscriptionsClientBeginAddAzureSubscriptionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + // BeginCreateOrUpdate - Create a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resource - Resource create parameters. // - options - OracleSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the OracleSubscriptionsClient.BeginCreateOrUpdate // method. @@ -71,7 +139,7 @@ func (client *OracleSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *OracleSubscriptionsClient) createOrUpdate(ctx context.Context, resource OracleSubscription, options *OracleSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginCreateOrUpdate" @@ -94,7 +162,7 @@ func (client *OracleSubscriptionsClient) createOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *OracleSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resource OracleSubscription, options *OracleSubscriptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *OracleSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resource OracleSubscription, _ *OracleSubscriptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -105,7 +173,7 @@ func (client *OracleSubscriptionsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -117,7 +185,7 @@ func (client *OracleSubscriptionsClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - OracleSubscriptionsClientBeginDeleteOptions contains the optional parameters for the OracleSubscriptionsClient.BeginDelete // method. func (client *OracleSubscriptionsClient) BeginDelete(ctx context.Context, options *OracleSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[OracleSubscriptionsClientDeleteResponse], error) { @@ -141,7 +209,7 @@ func (client *OracleSubscriptionsClient) BeginDelete(ctx context.Context, option // Delete - Delete a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *OracleSubscriptionsClient) deleteOperation(ctx context.Context, options *OracleSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginDelete" @@ -164,7 +232,7 @@ func (client *OracleSubscriptionsClient) deleteOperation(ctx context.Context, op } // deleteCreateRequest creates the Delete request. -func (client *OracleSubscriptionsClient) deleteCreateRequest(ctx context.Context, options *OracleSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *OracleSubscriptionsClient) deleteCreateRequest(ctx context.Context, _ *OracleSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -175,7 +243,7 @@ func (client *OracleSubscriptionsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +252,7 @@ func (client *OracleSubscriptionsClient) deleteCreateRequest(ctx context.Context // Get - Get a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - OracleSubscriptionsClientGetOptions contains the optional parameters for the OracleSubscriptionsClient.Get method. func (client *OracleSubscriptionsClient) Get(ctx context.Context, options *OracleSubscriptionsClientGetOptions) (OracleSubscriptionsClientGetResponse, error) { var err error @@ -209,7 +277,7 @@ func (client *OracleSubscriptionsClient) Get(ctx context.Context, options *Oracl } // getCreateRequest creates the Get request. -func (client *OracleSubscriptionsClient) getCreateRequest(ctx context.Context, options *OracleSubscriptionsClientGetOptions) (*policy.Request, error) { +func (client *OracleSubscriptionsClient) getCreateRequest(ctx context.Context, _ *OracleSubscriptionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -220,7 +288,7 @@ func (client *OracleSubscriptionsClient) getCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +306,7 @@ func (client *OracleSubscriptionsClient) getHandleResponse(resp *http.Response) // BeginListActivationLinks - List Activation Links // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - OracleSubscriptionsClientBeginListActivationLinksOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListActivationLinks // method. func (client *OracleSubscriptionsClient) BeginListActivationLinks(ctx context.Context, options *OracleSubscriptionsClientBeginListActivationLinksOptions) (*runtime.Poller[OracleSubscriptionsClientListActivationLinksResponse], error) { @@ -262,7 +330,7 @@ func (client *OracleSubscriptionsClient) BeginListActivationLinks(ctx context.Co // ListActivationLinks - List Activation Links // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *OracleSubscriptionsClient) listActivationLinks(ctx context.Context, options *OracleSubscriptionsClientBeginListActivationLinksOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginListActivationLinks" @@ -285,7 +353,7 @@ func (client *OracleSubscriptionsClient) listActivationLinks(ctx context.Context } // listActivationLinksCreateRequest creates the ListActivationLinks request. -func (client *OracleSubscriptionsClient) listActivationLinksCreateRequest(ctx context.Context, options *OracleSubscriptionsClientBeginListActivationLinksOptions) (*policy.Request, error) { +func (client *OracleSubscriptionsClient) listActivationLinksCreateRequest(ctx context.Context, _ *OracleSubscriptionsClientBeginListActivationLinksOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listActivationLinks" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -296,7 +364,7 @@ func (client *OracleSubscriptionsClient) listActivationLinksCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +372,7 @@ func (client *OracleSubscriptionsClient) listActivationLinksCreateRequest(ctx co // NewListBySubscriptionPager - List OracleSubscription resources by subscription ID // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - OracleSubscriptionsClientListBySubscriptionOptions contains the optional parameters for the OracleSubscriptionsClient.NewListBySubscriptionPager // method. func (client *OracleSubscriptionsClient) NewListBySubscriptionPager(options *OracleSubscriptionsClientListBySubscriptionOptions) *runtime.Pager[OracleSubscriptionsClientListBySubscriptionResponse] { @@ -331,7 +399,7 @@ func (client *OracleSubscriptionsClient) NewListBySubscriptionPager(options *Ora } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *OracleSubscriptionsClient) listBySubscriptionCreateRequest(ctx context.Context, options *OracleSubscriptionsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *OracleSubscriptionsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *OracleSubscriptionsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -342,7 +410,7 @@ func (client *OracleSubscriptionsClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,7 +428,7 @@ func (client *OracleSubscriptionsClient) listBySubscriptionHandleResponse(resp * // BeginListCloudAccountDetails - List Cloud Account Details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - OracleSubscriptionsClientBeginListCloudAccountDetailsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListCloudAccountDetails // method. func (client *OracleSubscriptionsClient) BeginListCloudAccountDetails(ctx context.Context, options *OracleSubscriptionsClientBeginListCloudAccountDetailsOptions) (*runtime.Poller[OracleSubscriptionsClientListCloudAccountDetailsResponse], error) { @@ -384,7 +452,7 @@ func (client *OracleSubscriptionsClient) BeginListCloudAccountDetails(ctx contex // ListCloudAccountDetails - List Cloud Account Details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *OracleSubscriptionsClient) listCloudAccountDetails(ctx context.Context, options *OracleSubscriptionsClientBeginListCloudAccountDetailsOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginListCloudAccountDetails" @@ -407,7 +475,7 @@ func (client *OracleSubscriptionsClient) listCloudAccountDetails(ctx context.Con } // listCloudAccountDetailsCreateRequest creates the ListCloudAccountDetails request. -func (client *OracleSubscriptionsClient) listCloudAccountDetailsCreateRequest(ctx context.Context, options *OracleSubscriptionsClientBeginListCloudAccountDetailsOptions) (*policy.Request, error) { +func (client *OracleSubscriptionsClient) listCloudAccountDetailsCreateRequest(ctx context.Context, _ *OracleSubscriptionsClientBeginListCloudAccountDetailsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -418,7 +486,7 @@ func (client *OracleSubscriptionsClient) listCloudAccountDetailsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,7 +495,7 @@ func (client *OracleSubscriptionsClient) listCloudAccountDetailsCreateRequest(ct // BeginListSaasSubscriptionDetails - List Saas Subscription Details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - options - OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions contains the optional parameters for the OracleSubscriptionsClient.BeginListSaasSubscriptionDetails // method. func (client *OracleSubscriptionsClient) BeginListSaasSubscriptionDetails(ctx context.Context, options *OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions) (*runtime.Poller[OracleSubscriptionsClientListSaasSubscriptionDetailsResponse], error) { @@ -451,7 +519,7 @@ func (client *OracleSubscriptionsClient) BeginListSaasSubscriptionDetails(ctx co // ListSaasSubscriptionDetails - List Saas Subscription Details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *OracleSubscriptionsClient) listSaasSubscriptionDetails(ctx context.Context, options *OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginListSaasSubscriptionDetails" @@ -474,7 +542,7 @@ func (client *OracleSubscriptionsClient) listSaasSubscriptionDetails(ctx context } // listSaasSubscriptionDetailsCreateRequest creates the ListSaasSubscriptionDetails request. -func (client *OracleSubscriptionsClient) listSaasSubscriptionDetailsCreateRequest(ctx context.Context, options *OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions) (*policy.Request, error) { +func (client *OracleSubscriptionsClient) listSaasSubscriptionDetailsCreateRequest(ctx context.Context, _ *OracleSubscriptionsClientBeginListSaasSubscriptionDetailsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -485,7 +553,7 @@ func (client *OracleSubscriptionsClient) listSaasSubscriptionDetailsCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -494,7 +562,7 @@ func (client *OracleSubscriptionsClient) listSaasSubscriptionDetailsCreateReques // BeginUpdate - Update a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - properties - The resource properties to be updated. // - options - OracleSubscriptionsClientBeginUpdateOptions contains the optional parameters for the OracleSubscriptionsClient.BeginUpdate // method. @@ -519,7 +587,7 @@ func (client *OracleSubscriptionsClient) BeginUpdate(ctx context.Context, proper // Update - Update a OracleSubscription // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *OracleSubscriptionsClient) update(ctx context.Context, properties OracleSubscriptionUpdate, options *OracleSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "OracleSubscriptionsClient.BeginUpdate" @@ -542,7 +610,7 @@ func (client *OracleSubscriptionsClient) update(ctx context.Context, properties } // updateCreateRequest creates the Update request. -func (client *OracleSubscriptionsClient) updateCreateRequest(ctx context.Context, properties OracleSubscriptionUpdate, options *OracleSubscriptionsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *OracleSubscriptionsClient) updateCreateRequest(ctx context.Context, properties OracleSubscriptionUpdate, _ *OracleSubscriptionsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -553,7 +621,7 @@ func (client *OracleSubscriptionsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client_example_test.go deleted file mode 100644 index 4c37f167fdbc..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/oraclesubscriptions_client_example_test.go +++ /dev/null @@ -1,307 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_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/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listBySubscription.json -func ExampleOracleSubscriptionsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOracleSubscriptionsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OracleSubscriptionListResult = armoracledatabase.OracleSubscriptionListResult{ - // Value: []*armoracledatabase.OracleSubscription{ - // { - // Type: to.Ptr("Oracle.Database/oracleSubscriptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/oracleSubscriptions/default"), - // Plan: &armoracledatabase.Plan{ - // Name: to.Ptr("plan1"), - // Product: to.Ptr("product1"), - // PromotionCode: to.Ptr("none"), - // Publisher: to.Ptr("publisher1"), - // Version: to.Ptr("alpha"), - // }, - // Properties: &armoracledatabase.OracleSubscriptionProperties{ - // CloudAccountID: to.Ptr("ocid1..aaaaaa"), - // CloudAccountState: to.Ptr(armoracledatabase.CloudAccountProvisioningStatePending), - // ProvisioningState: to.Ptr(armoracledatabase.OracleSubscriptionProvisioningStateSucceeded), - // SaasSubscriptionID: to.Ptr("saas1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_get.json -func ExampleOracleSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOracleSubscriptionsClient().Get(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OracleSubscription = armoracledatabase.OracleSubscription{ - // Type: to.Ptr("Oracle.Database/oracleSubscriptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/oracleSubscriptions/default"), - // Plan: &armoracledatabase.Plan{ - // Name: to.Ptr("plan1"), - // Product: to.Ptr("product1"), - // PromotionCode: to.Ptr("none"), - // Publisher: to.Ptr("publisher1"), - // Version: to.Ptr("alpha"), - // }, - // Properties: &armoracledatabase.OracleSubscriptionProperties{ - // CloudAccountID: to.Ptr("ocid1..aaaaaa"), - // CloudAccountState: to.Ptr(armoracledatabase.CloudAccountProvisioningStatePending), - // ProvisioningState: to.Ptr(armoracledatabase.OracleSubscriptionProvisioningStateSucceeded), - // SaasSubscriptionID: to.Ptr("saas1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_create.json -func ExampleOracleSubscriptionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginCreateOrUpdate(ctx, armoracledatabase.OracleSubscription{ - Plan: &armoracledatabase.Plan{ - Name: to.Ptr("plan1"), - Product: to.Ptr("product1"), - PromotionCode: to.Ptr("none"), - Publisher: to.Ptr("publisher1"), - Version: to.Ptr("alpha"), - }, - Properties: &armoracledatabase.OracleSubscriptionProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OracleSubscription = armoracledatabase.OracleSubscription{ - // Type: to.Ptr("Oracle.Database/oracleSubscriptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/oracleSubscriptions/default"), - // Plan: &armoracledatabase.Plan{ - // Name: to.Ptr("plan1"), - // Product: to.Ptr("product1"), - // PromotionCode: to.Ptr("none"), - // Publisher: to.Ptr("publisher1"), - // Version: to.Ptr("alpha"), - // }, - // Properties: &armoracledatabase.OracleSubscriptionProperties{ - // CloudAccountID: to.Ptr("ocid1..aaaaaa"), - // CloudAccountState: to.Ptr(armoracledatabase.CloudAccountProvisioningStatePending), - // ProvisioningState: to.Ptr(armoracledatabase.OracleSubscriptionProvisioningStateSucceeded), - // SaasSubscriptionID: to.Ptr("saas1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_patch.json -func ExampleOracleSubscriptionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginUpdate(ctx, armoracledatabase.OracleSubscriptionUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OracleSubscription = armoracledatabase.OracleSubscription{ - // Type: to.Ptr("Oracle.Database/oracleSubscriptions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/oracleSubscriptions/default"), - // Plan: &armoracledatabase.Plan{ - // Name: to.Ptr("plan1"), - // Product: to.Ptr("product1"), - // PromotionCode: to.Ptr("none"), - // Publisher: to.Ptr("publisher1"), - // Version: to.Ptr("alpha"), - // }, - // Properties: &armoracledatabase.OracleSubscriptionProperties{ - // CloudAccountID: to.Ptr("ocid1..aaaaaa"), - // CloudAccountState: to.Ptr(armoracledatabase.CloudAccountProvisioningStatePending), - // ProvisioningState: to.Ptr(armoracledatabase.OracleSubscriptionProvisioningStateSucceeded), - // SaasSubscriptionID: to.Ptr("saas1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_delete.json -func ExampleOracleSubscriptionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginDelete(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listActivationLinks.json -func ExampleOracleSubscriptionsClient_BeginListActivationLinks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginListActivationLinks(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ActivationLinks = armoracledatabase.ActivationLinks{ - // ExistingCloudAccountActivationLink: to.Ptr("https://existing-tenancy-activation-link"), - // NewCloudAccountActivationLink: to.Ptr("https://new-tenancy-activation-link"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listCloudAccountDetails.json -func ExampleOracleSubscriptionsClient_BeginListCloudAccountDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginListCloudAccountDetails(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudAccountDetails = armoracledatabase.CloudAccountDetails{ - // CloudAccountHomeRegion: to.Ptr("East US"), - // CloudAccountName: to.Ptr("Cloud Account"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listSaasSubscriptionDetails.json -func ExampleOracleSubscriptionsClient_BeginListSaasSubscriptionDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOracleSubscriptionsClient().BeginListSaasSubscriptionDetails(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SaasSubscriptionDetails = armoracledatabase.SaasSubscriptionDetails{ - // ID: to.Ptr("1234567890"), - // IsAutoRenew: to.Ptr(true), - // IsFreeTrial: to.Ptr(false), - // OfferID: to.Ptr("offer1"), - // PlanID: to.Ptr("silver"), - // PublisherID: to.Ptr("Oracle"), - // PurchaserEmailID: to.Ptr("test@test.com"), - // PurchaserTenantID: to.Ptr("1234567890"), - // SaasSubscriptionStatus: to.Ptr("PendingFulfillmentStart"), - // SubscriptionName: to.Ptr("Oracle"), - // TermUnit: to.Ptr("P1M"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-07T00:00:00.000Z"); return t}()), - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/polymorphic_helpers.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/polymorphic_helpers.go index 63ffe40ed9bf..bf96f1b965cc 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/polymorphic_helpers.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -22,6 +19,10 @@ func unmarshalAutonomousDatabaseBasePropertiesClassification(rawMsg json.RawMess switch m["dataBaseType"] { case string(DataBaseTypeClone): b = &AutonomousDatabaseCloneProperties{} + case string(DataBaseTypeCloneFromBackupTimestamp): + b = &AutonomousDatabaseFromBackupTimestampProperties{} + case string(DataBaseTypeCrossRegionDisasterRecovery): + b = &AutonomousDatabaseCrossRegionDisasterRecoveryProperties{} case string(DataBaseTypeRegular): b = &AutonomousDatabaseProperties{} default: diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/responses.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/responses.go index f34e50a6e231..c5bdee6833d0 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/responses.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/responses.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -25,8 +22,8 @@ type AutonomousDatabaseBackupsClientGetResponse struct { AutonomousDatabaseBackup } -// AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse contains the response from method AutonomousDatabaseBackupsClient.NewListByAutonomousDatabasePager. -type AutonomousDatabaseBackupsClientListByAutonomousDatabaseResponse struct { +// AutonomousDatabaseBackupsClientListByParentResponse contains the response from method AutonomousDatabaseBackupsClient.NewListByParentPager. +type AutonomousDatabaseBackupsClientListByParentResponse struct { // The response of a AutonomousDatabaseBackup list operation. AutonomousDatabaseBackupListResult } @@ -73,6 +70,12 @@ type AutonomousDatabaseVersionsClientListByLocationResponse struct { AutonomousDbVersionListResult } +// AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse contains the response from method AutonomousDatabasesClient.BeginChangeDisasterRecoveryConfiguration. +type AutonomousDatabasesClientChangeDisasterRecoveryConfigurationResponse struct { + // Autonomous Database resource model. + AutonomousDatabase +} + // AutonomousDatabasesClientCreateOrUpdateResponse contains the response from method AutonomousDatabasesClient.BeginCreateOrUpdate. type AutonomousDatabasesClientCreateOrUpdateResponse struct { // Autonomous Database resource model. @@ -268,8 +271,8 @@ type DbNodesClientGetResponse struct { DbNode } -// DbNodesClientListByCloudVMClusterResponse contains the response from method DbNodesClient.NewListByCloudVMClusterPager. -type DbNodesClientListByCloudVMClusterResponse struct { +// DbNodesClientListByParentResponse contains the response from method DbNodesClient.NewListByParentPager. +type DbNodesClientListByParentResponse struct { // The response of a DbNode list operation. DbNodeListResult } @@ -280,8 +283,8 @@ type DbServersClientGetResponse struct { DbServer } -// DbServersClientListByCloudExadataInfrastructureResponse contains the response from method DbServersClient.NewListByCloudExadataInfrastructurePager. -type DbServersClientListByCloudExadataInfrastructureResponse struct { +// DbServersClientListByParentResponse contains the response from method DbServersClient.NewListByParentPager. +type DbServersClientListByParentResponse struct { // The response of a DbServer list operation. DbServerListResult } @@ -298,6 +301,124 @@ type DbSystemShapesClientListByLocationResponse struct { DbSystemShapeListResult } +// ExadbVMClustersClientCreateOrUpdateResponse contains the response from method ExadbVMClustersClient.BeginCreateOrUpdate. +type ExadbVMClustersClientCreateOrUpdateResponse struct { + // ExadbVmCluster resource definition + ExadbVMCluster +} + +// ExadbVMClustersClientDeleteResponse contains the response from method ExadbVMClustersClient.BeginDelete. +type ExadbVMClustersClientDeleteResponse struct { + // placeholder for future response values +} + +// ExadbVMClustersClientGetResponse contains the response from method ExadbVMClustersClient.Get. +type ExadbVMClustersClientGetResponse struct { + // ExadbVmCluster resource definition + ExadbVMCluster +} + +// ExadbVMClustersClientListByResourceGroupResponse contains the response from method ExadbVMClustersClient.NewListByResourceGroupPager. +type ExadbVMClustersClientListByResourceGroupResponse struct { + // The response of a ExadbVmCluster list operation. + ExadbVMClusterListResult +} + +// ExadbVMClustersClientListBySubscriptionResponse contains the response from method ExadbVMClustersClient.NewListBySubscriptionPager. +type ExadbVMClustersClientListBySubscriptionResponse struct { + // The response of a ExadbVmCluster list operation. + ExadbVMClusterListResult +} + +// ExadbVMClustersClientRemoveVMsResponse contains the response from method ExadbVMClustersClient.BeginRemoveVMs. +type ExadbVMClustersClientRemoveVMsResponse struct { + // ExadbVmCluster resource definition + ExadbVMCluster +} + +// ExadbVMClustersClientUpdateResponse contains the response from method ExadbVMClustersClient.BeginUpdate. +type ExadbVMClustersClientUpdateResponse struct { + // ExadbVmCluster resource definition + ExadbVMCluster +} + +// ExascaleDbNodesClientActionResponse contains the response from method ExascaleDbNodesClient.BeginAction. +type ExascaleDbNodesClientActionResponse struct { + // ExascaleDbNode action response + DbActionResponse +} + +// ExascaleDbNodesClientGetResponse contains the response from method ExascaleDbNodesClient.Get. +type ExascaleDbNodesClientGetResponse struct { + // The DbNode resource belonging to ExadbVmCluster + ExascaleDbNode +} + +// ExascaleDbNodesClientListByParentResponse contains the response from method ExascaleDbNodesClient.NewListByParentPager. +type ExascaleDbNodesClientListByParentResponse struct { + // The response of a ExascaleDbNode list operation. + ExascaleDbNodeListResult +} + +// ExascaleDbStorageVaultsClientCreateResponse contains the response from method ExascaleDbStorageVaultsClient.BeginCreate. +type ExascaleDbStorageVaultsClientCreateResponse struct { + // ExascaleDbStorageVault resource definition + ExascaleDbStorageVault +} + +// ExascaleDbStorageVaultsClientDeleteResponse contains the response from method ExascaleDbStorageVaultsClient.BeginDelete. +type ExascaleDbStorageVaultsClientDeleteResponse struct { + // placeholder for future response values +} + +// ExascaleDbStorageVaultsClientGetResponse contains the response from method ExascaleDbStorageVaultsClient.Get. +type ExascaleDbStorageVaultsClientGetResponse struct { + // ExascaleDbStorageVault resource definition + ExascaleDbStorageVault +} + +// ExascaleDbStorageVaultsClientListByResourceGroupResponse contains the response from method ExascaleDbStorageVaultsClient.NewListByResourceGroupPager. +type ExascaleDbStorageVaultsClientListByResourceGroupResponse struct { + // The response of a ExascaleDbStorageVault list operation. + ExascaleDbStorageVaultListResult +} + +// ExascaleDbStorageVaultsClientListBySubscriptionResponse contains the response from method ExascaleDbStorageVaultsClient.NewListBySubscriptionPager. +type ExascaleDbStorageVaultsClientListBySubscriptionResponse struct { + // The response of a ExascaleDbStorageVault list operation. + ExascaleDbStorageVaultListResult +} + +// ExascaleDbStorageVaultsClientUpdateResponse contains the response from method ExascaleDbStorageVaultsClient.BeginUpdate. +type ExascaleDbStorageVaultsClientUpdateResponse struct { + // ExascaleDbStorageVault resource definition + ExascaleDbStorageVault +} + +// FlexComponentsClientGetResponse contains the response from method FlexComponentsClient.Get. +type FlexComponentsClientGetResponse struct { + // FlexComponent Resource Definition + FlexComponent +} + +// FlexComponentsClientListByParentResponse contains the response from method FlexComponentsClient.NewListByParentPager. +type FlexComponentsClientListByParentResponse struct { + // The response of a FlexComponent list operation. + FlexComponentListResult +} + +// GiMinorVersionsClientGetResponse contains the response from method GiMinorVersionsClient.Get. +type GiMinorVersionsClientGetResponse struct { + // The Oracle Grid Infrastructure (GI) minor version resource definition. + GiMinorVersion +} + +// GiMinorVersionsClientListByParentResponse contains the response from method GiMinorVersionsClient.NewListByParentPager. +type GiMinorVersionsClientListByParentResponse struct { + // The response of a GiMinorVersion list operation. + GiMinorVersionListResult +} + // GiVersionsClientGetResponse contains the response from method GiVersionsClient.Get. type GiVersionsClientGetResponse struct { // GiVersion resource definition @@ -316,6 +437,11 @@ type OperationsClientListResponse struct { OperationListResult } +// OracleSubscriptionsClientAddAzureSubscriptionsResponse contains the response from method OracleSubscriptionsClient.BeginAddAzureSubscriptions. +type OracleSubscriptionsClientAddAzureSubscriptionsResponse struct { + // placeholder for future response values +} + // OracleSubscriptionsClientCreateOrUpdateResponse contains the response from method OracleSubscriptionsClient.BeginCreateOrUpdate. type OracleSubscriptionsClientCreateOrUpdateResponse struct { // OracleSubscription resource definition @@ -392,8 +518,8 @@ type VirtualNetworkAddressesClientGetResponse struct { VirtualNetworkAddress } -// VirtualNetworkAddressesClientListByCloudVMClusterResponse contains the response from method VirtualNetworkAddressesClient.NewListByCloudVMClusterPager. -type VirtualNetworkAddressesClientListByCloudVMClusterResponse struct { +// VirtualNetworkAddressesClientListByParentResponse contains the response from method VirtualNetworkAddressesClient.NewListByParentPager. +type VirtualNetworkAddressesClientListByParentResponse struct { // The response of a VirtualNetworkAddress list operation. VirtualNetworkAddressListResult } diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client.go index 9cd4a0226b2e..379376c4bb3e 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewSystemVersionsClient(subscriptionID string, credential azcore.TokenCrede // Get - Get a SystemVersion // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - systemversionname - SystemVersion name // - options - SystemVersionsClientGetOptions contains the optional parameters for the SystemVersionsClient.Get method. @@ -73,7 +70,7 @@ func (client *SystemVersionsClient) Get(ctx context.Context, location string, sy } // getCreateRequest creates the Get request. -func (client *SystemVersionsClient) getCreateRequest(ctx context.Context, location string, systemversionname string, options *SystemVersionsClientGetOptions) (*policy.Request, error) { +func (client *SystemVersionsClient) getCreateRequest(ctx context.Context, location string, systemversionname string, _ *SystemVersionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +89,7 @@ func (client *SystemVersionsClient) getCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,9 +104,9 @@ func (client *SystemVersionsClient) getHandleResponse(resp *http.Response) (Syst return result, nil } -// NewListByLocationPager - List SystemVersion resources by Location +// NewListByLocationPager - List SystemVersion resources by SubscriptionLocationResource // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - location - The name of the Azure region. // - options - SystemVersionsClientListByLocationOptions contains the optional parameters for the SystemVersionsClient.NewListByLocationPager // method. @@ -137,7 +134,7 @@ func (client *SystemVersionsClient) NewListByLocationPager(location string, opti } // listByLocationCreateRequest creates the ListByLocation request. -func (client *SystemVersionsClient) listByLocationCreateRequest(ctx context.Context, location string, options *SystemVersionsClientListByLocationOptions) (*policy.Request, error) { +func (client *SystemVersionsClient) listByLocationCreateRequest(ctx context.Context, location string, _ *SystemVersionsClientListByLocationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -152,7 +149,7 @@ func (client *SystemVersionsClient) listByLocationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client_example_test.go deleted file mode 100644 index 5a6d1aa80dad..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/systemversions_client_example_test.go +++ /dev/null @@ -1,78 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_listByLocation.json -func ExampleSystemVersionsClient_NewListByLocationPager_listExadataSystemVersionsByTheProvidedFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSystemVersionsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SystemVersionListResult = armoracledatabase.SystemVersionListResult{ - // Value: []*armoracledatabase.SystemVersion{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/systemVersion/22.1.7.0.0.230113"), - // Properties: &armoracledatabase.SystemVersionProperties{ - // SystemVersion: to.Ptr("22.1.7.0.0.230113"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json -func ExampleSystemVersionsClient_Get_getExadataSystemVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSystemVersionsClient().Get(ctx, "eastus", "22.x", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SystemVersion = armoracledatabase.SystemVersion{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/locations/eastus/systemVersion/22.1.7.0.0.230113"), - // Properties: &armoracledatabase.SystemVersionProperties{ - // SystemVersion: to.Ptr("22.1.7.0.0.230113"), - // }, - // } -} diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/time_rfc3339.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/time_rfc3339.go index fa76bf4dd2e3..b76504b21aa2 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/time_rfc3339.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/time_rfc3339.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client.go index a807d9ae6281..ba8713eeeb58 100644 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client.go +++ b/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewVirtualNetworkAddressesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Create a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - virtualnetworkaddressname - Virtual IP address hostname. @@ -74,7 +71,7 @@ func (client *VirtualNetworkAddressesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *VirtualNetworkAddressesClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, resource VirtualNetworkAddress, options *VirtualNetworkAddressesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkAddressesClient.BeginCreateOrUpdate" @@ -97,7 +94,7 @@ func (client *VirtualNetworkAddressesClient) createOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkAddressesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, resource VirtualNetworkAddress, options *VirtualNetworkAddressesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualNetworkAddressesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, resource VirtualNetworkAddress, _ *VirtualNetworkAddressesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -120,7 +117,7 @@ func (client *VirtualNetworkAddressesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -132,7 +129,7 @@ func (client *VirtualNetworkAddressesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Delete a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - virtualnetworkaddressname - Virtual IP address hostname. @@ -159,7 +156,7 @@ func (client *VirtualNetworkAddressesClient) BeginDelete(ctx context.Context, re // Delete - Delete a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 func (client *VirtualNetworkAddressesClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, options *VirtualNetworkAddressesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkAddressesClient.BeginDelete" @@ -182,7 +179,7 @@ func (client *VirtualNetworkAddressesClient) deleteOperation(ctx context.Context } // deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkAddressesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, options *VirtualNetworkAddressesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualNetworkAddressesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, _ *VirtualNetworkAddressesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -205,7 +202,7 @@ func (client *VirtualNetworkAddressesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *VirtualNetworkAddressesClient) deleteCreateRequest(ctx context.Con // Get - Get a VirtualNetworkAddress // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name // - virtualnetworkaddressname - Virtual IP address hostname. @@ -243,7 +240,7 @@ func (client *VirtualNetworkAddressesClient) Get(ctx context.Context, resourceGr } // getCreateRequest creates the Get request. -func (client *VirtualNetworkAddressesClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, options *VirtualNetworkAddressesClientGetOptions) (*policy.Request, error) { +func (client *VirtualNetworkAddressesClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, virtualnetworkaddressname string, _ *VirtualNetworkAddressesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -266,7 +263,7 @@ func (client *VirtualNetworkAddressesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,38 +278,38 @@ func (client *VirtualNetworkAddressesClient) getHandleResponse(resp *http.Respon return result, nil } -// NewListByCloudVMClusterPager - List VirtualNetworkAddress resources by CloudVmCluster +// NewListByParentPager - List VirtualNetworkAddress resources by CloudVmCluster // -// Generated from API version 2023-09-01 +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudvmclustername - CloudVmCluster name -// - options - VirtualNetworkAddressesClientListByCloudVMClusterOptions contains the optional parameters for the VirtualNetworkAddressesClient.NewListByCloudVMClusterPager +// - options - VirtualNetworkAddressesClientListByParentOptions contains the optional parameters for the VirtualNetworkAddressesClient.NewListByParentPager // method. -func (client *VirtualNetworkAddressesClient) NewListByCloudVMClusterPager(resourceGroupName string, cloudvmclustername string, options *VirtualNetworkAddressesClientListByCloudVMClusterOptions) *runtime.Pager[VirtualNetworkAddressesClientListByCloudVMClusterResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualNetworkAddressesClientListByCloudVMClusterResponse]{ - More: func(page VirtualNetworkAddressesClientListByCloudVMClusterResponse) bool { +func (client *VirtualNetworkAddressesClient) NewListByParentPager(resourceGroupName string, cloudvmclustername string, options *VirtualNetworkAddressesClientListByParentOptions) *runtime.Pager[VirtualNetworkAddressesClientListByParentResponse] { + return runtime.NewPager(runtime.PagingHandler[VirtualNetworkAddressesClientListByParentResponse]{ + More: func(page VirtualNetworkAddressesClientListByParentResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *VirtualNetworkAddressesClientListByCloudVMClusterResponse) (VirtualNetworkAddressesClientListByCloudVMClusterResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualNetworkAddressesClient.NewListByCloudVMClusterPager") + Fetcher: func(ctx context.Context, page *VirtualNetworkAddressesClientListByParentResponse) (VirtualNetworkAddressesClientListByParentResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualNetworkAddressesClient.NewListByParentPager") nextLink := "" if page != nil { nextLink = *page.NextLink } resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByCloudVMClusterCreateRequest(ctx, resourceGroupName, cloudvmclustername, options) + return client.listByParentCreateRequest(ctx, resourceGroupName, cloudvmclustername, options) }, nil) if err != nil { - return VirtualNetworkAddressesClientListByCloudVMClusterResponse{}, err + return VirtualNetworkAddressesClientListByParentResponse{}, err } - return client.listByCloudVMClusterHandleResponse(resp) + return client.listByParentHandleResponse(resp) }, Tracer: client.internal.Tracer(), }) } -// listByCloudVMClusterCreateRequest creates the ListByCloudVMCluster request. -func (client *VirtualNetworkAddressesClient) listByCloudVMClusterCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, options *VirtualNetworkAddressesClientListByCloudVMClusterOptions) (*policy.Request, error) { +// listByParentCreateRequest creates the ListByParent request. +func (client *VirtualNetworkAddressesClient) listByParentCreateRequest(ctx context.Context, resourceGroupName string, cloudvmclustername string, _ *VirtualNetworkAddressesClientListByParentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -331,17 +328,17 @@ func (client *VirtualNetworkAddressesClient) listByCloudVMClusterCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByCloudVMClusterHandleResponse handles the ListByCloudVMCluster response. -func (client *VirtualNetworkAddressesClient) listByCloudVMClusterHandleResponse(resp *http.Response) (VirtualNetworkAddressesClientListByCloudVMClusterResponse, error) { - result := VirtualNetworkAddressesClientListByCloudVMClusterResponse{} +// listByParentHandleResponse handles the ListByParent response. +func (client *VirtualNetworkAddressesClient) listByParentHandleResponse(resp *http.Response) (VirtualNetworkAddressesClientListByParentResponse, error) { + result := VirtualNetworkAddressesClientListByParentResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.VirtualNetworkAddressListResult); err != nil { - return VirtualNetworkAddressesClientListByCloudVMClusterResponse{}, err + return VirtualNetworkAddressesClientListByParentResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client_example_test.go b/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client_example_test.go deleted file mode 100644 index 890f38a5f662..000000000000 --- a/sdk/resourcemanager/oracledatabase/armoracledatabase/virtualnetworkaddresses_client_example_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoracledatabase_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/oracledatabase/armoracledatabase" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_listByParent.json -func ExampleVirtualNetworkAddressesClient_NewListByCloudVMClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkAddressesClient().NewListByCloudVMClusterPager("rg000", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkAddressListResult = armoracledatabase.VirtualNetworkAddressListResult{ - // Value: []*armoracledatabase.VirtualNetworkAddress{ - // { - // Type: to.Ptr("Oracle.Database/cloudVmClusters/virtualNetworkAddresses"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/virtualNetworkAddresses/hostname1"), - // Properties: &armoracledatabase.VirtualNetworkAddressProperties{ - // Domain: to.Ptr("domain1"), - // IPAddress: to.Ptr("192.168.0.1"), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.VirtualNetworkAddressLifecycleStateAvailable), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // TimeAssigned: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T00:27:02.119Z"); return t}()), - // VMOcid: to.Ptr("ocid1..aaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_get.json -func ExampleVirtualNetworkAddressesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkAddressesClient().Get(ctx, "rg000", "cluster1", "hostname1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkAddress = armoracledatabase.VirtualNetworkAddress{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/virtualNetworkAddresses"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/virtualNetworkAddresses/hostname1"), - // Properties: &armoracledatabase.VirtualNetworkAddressProperties{ - // Domain: to.Ptr("domain1"), - // IPAddress: to.Ptr("192.168.0.1"), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.VirtualNetworkAddressLifecycleStateAvailable), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // TimeAssigned: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T00:27:02.119Z"); return t}()), - // VMOcid: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_create.json -func ExampleVirtualNetworkAddressesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkAddressesClient().BeginCreateOrUpdate(ctx, "rg000", "cluster1", "hostname1", armoracledatabase.VirtualNetworkAddress{ - Properties: &armoracledatabase.VirtualNetworkAddressProperties{ - IPAddress: to.Ptr("192.168.0.1"), - VMOcid: to.Ptr("ocid1..aaaa"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetworkAddress = armoracledatabase.VirtualNetworkAddress{ - // Type: to.Ptr("Oracle.Database/cloudVmClusters/virtualNetworkAddresses"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudVmClusters/cluster1/virtualNetworkAddresses/hostname1"), - // Properties: &armoracledatabase.VirtualNetworkAddressProperties{ - // Domain: to.Ptr("domain1"), - // IPAddress: to.Ptr("192.168.0.1"), - // LifecycleDetails: to.Ptr("success"), - // LifecycleState: to.Ptr(armoracledatabase.VirtualNetworkAddressLifecycleStateAvailable), - // Ocid: to.Ptr("ocid1..aaaaaa"), - // ProvisioningState: to.Ptr(armoracledatabase.AzureResourceProvisioningStateSucceeded), - // TimeAssigned: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-22T00:27:02.119Z"); return t}()), - // VMOcid: to.Ptr("ocid1..aaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1c63635d66ae38cff18045ab416a6572d3e15f6e/specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_delete.json -func ExampleVirtualNetworkAddressesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoracledatabase.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkAddressesClient().BeginDelete(ctx, "rg000", "cluster1", "hostname1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/CHANGELOG.md b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/CHANGELOG.md index 39ee7bb5ffd0..d5638c33a856 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/CHANGELOG.md +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/CHANGELOG.md @@ -1,5 +1,51 @@ # Release History +## 0.4.0 (2025-05-13) +### Breaking Changes + +- Type of `ManagedClusterVersionDetails.SupportExpiryUTC` has been changed from `*string` to `*time.Time` +- Type of `SystemData.CreatedByType` has been changed from `*string` to `*CreatedByType` +- Type of `SystemData.LastModifiedByType` has been changed from `*string` to `*CreatedByType` +- Type of `VMSSExtensionProperties.ProtectedSettings` has been changed from `any` to `*VMSSExtensionPropertiesProtectedSettings` +- Type of `VMSSExtensionProperties.Settings` has been changed from `any` to `*VMSSExtensionPropertiesSettings` +- Operation `*OperationResultsClient.Get` has been changed to LRO, use `*OperationResultsClient.BeginGet` instead. + +### Features Added + +- New value `DiskTypePremiumV2LRS`, `DiskTypePremiumZRS`, `DiskTypeStandardSSDZRS` added to enum type `DiskType` +- New value `SecurityTypeConfidentialVM` added to enum type `SecurityType` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `FaultKind` with values `FaultKindZone` +- New enum type `FaultSimulationStatus` with values `FaultSimulationStatusActive`, `FaultSimulationStatusDone`, `FaultSimulationStatusStartFailed`, `FaultSimulationStatusStarting`, `FaultSimulationStatusStopFailed`, `FaultSimulationStatusStopping` +- New enum type `SecurityEncryptionType` with values `SecurityEncryptionTypeDiskWithVMGuestState`, `SecurityEncryptionTypeVMGuestStateOnly` +- New enum type `SfmcOperationStatus` with values `SfmcOperationStatusAborted`, `SfmcOperationStatusCanceled`, `SfmcOperationStatusCreated`, `SfmcOperationStatusFailed`, `SfmcOperationStatusStarted`, `SfmcOperationStatusSucceeded` +- New function `*FaultSimulationContent.GetFaultSimulationContent() *FaultSimulationContent` +- New function `*ManagedClustersClient.GetFaultSimulation(context.Context, string, string, FaultSimulationIDContent, *ManagedClustersClientGetFaultSimulationOptions) (ManagedClustersClientGetFaultSimulationResponse, error)` +- New function `*ManagedClustersClient.NewListFaultSimulationPager(string, string, *ManagedClustersClientListFaultSimulationOptions) *runtime.Pager[ManagedClustersClientListFaultSimulationResponse]` +- New function `*ManagedClustersClient.BeginStartFaultSimulation(context.Context, string, string, FaultSimulationContentWrapper, *ManagedClustersClientBeginStartFaultSimulationOptions) (*runtime.Poller[ManagedClustersClientStartFaultSimulationResponse], error)` +- New function `*ManagedClustersClient.BeginStopFaultSimulation(context.Context, string, string, FaultSimulationIDContent, *ManagedClustersClientBeginStopFaultSimulationOptions) (*runtime.Poller[ManagedClustersClientStopFaultSimulationResponse], error)` +- New function `*ZoneFaultSimulationContent.GetFaultSimulationContent() *FaultSimulationContent` +- New function `*NodeTypesClient.BeginDeallocate(context.Context, string, string, string, NodeTypeActionParameters, *NodeTypesClientBeginDeallocateOptions) (*runtime.Poller[NodeTypesClientDeallocateResponse], error)` +- New function `*NodeTypesClient.GetFaultSimulation(context.Context, string, string, string, FaultSimulationIDContent, *NodeTypesClientGetFaultSimulationOptions) (NodeTypesClientGetFaultSimulationResponse, error)` +- New function `*NodeTypesClient.NewListFaultSimulationPager(string, string, string, *NodeTypesClientListFaultSimulationOptions) *runtime.Pager[NodeTypesClientListFaultSimulationResponse]` +- New function `*NodeTypesClient.BeginRedeploy(context.Context, string, string, string, NodeTypeActionParameters, *NodeTypesClientBeginRedeployOptions) (*runtime.Poller[NodeTypesClientRedeployResponse], error)` +- New function `*NodeTypesClient.BeginStart(context.Context, string, string, string, NodeTypeActionParameters, *NodeTypesClientBeginStartOptions) (*runtime.Poller[NodeTypesClientStartResponse], error)` +- New function `*NodeTypesClient.BeginStartFaultSimulation(context.Context, string, string, string, FaultSimulationContentWrapper, *NodeTypesClientBeginStartFaultSimulationOptions) (*runtime.Poller[NodeTypesClientStartFaultSimulationResponse], error)` +- New function `*NodeTypesClient.BeginStopFaultSimulation(context.Context, string, string, string, FaultSimulationIDContent, *NodeTypesClientBeginStopFaultSimulationOptions) (*runtime.Poller[NodeTypesClientStopFaultSimulationResponse], error)` +- New struct `FaultSimulation` +- New struct `FaultSimulationConstraints` +- New struct `FaultSimulationContentWrapper` +- New struct `FaultSimulationDetails` +- New struct `FaultSimulationIDContent` +- New struct `FaultSimulationListResult` +- New struct `NodeTypeFaultSimulation` +- New struct `VMSSExtensionPropertiesProtectedSettings` +- New struct `VMSSExtensionPropertiesSettings` +- New struct `ZoneFaultSimulationContent` +- New field `VMImage` in struct `ManagedClusterProperties` +- New field `SecurityEncryptionType`, `ZoneBalance` in struct `NodeTypeProperties` + + ## 0.3.0 (2024-12-27) ### Breaking Changes diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applications_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applications_client.go index 930d8c7a32da..3fb3014f5dda 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applications_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applications_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ApplicationsClient struct { } // NewApplicationsClient creates a new instance of ApplicationsClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error) { @@ -46,8 +42,8 @@ func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create or update a Service Fabric managed application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - parameters - The application resource. @@ -60,8 +56,7 @@ func (client *ApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -74,7 +69,7 @@ func (client *ApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or update a Service Fabric managed application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource, options *ApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ApplicationsClient.BeginCreateOrUpdate" @@ -97,8 +92,8 @@ func (client *ApplicationsClient) createOrUpdate(ctx context.Context, resourceGr } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource, options *ApplicationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}" +func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource, _ *ApplicationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -120,9 +115,10 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -132,8 +128,8 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete a Service Fabric managed application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - options - ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete @@ -145,8 +141,7 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -159,7 +154,7 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete a Service Fabric managed application resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationsClient.BeginDelete" @@ -174,7 +169,7 @@ func (client *ApplicationsClient) deleteOperation(ctx context.Context, resourceG if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -182,8 +177,8 @@ func (client *ApplicationsClient) deleteOperation(ctx context.Context, resourceG } // deleteCreateRequest creates the Delete request. -func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}" +func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, _ *ApplicationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -205,7 +200,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,8 +210,8 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou // cluster resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - options - ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. @@ -243,8 +238,8 @@ func (client *ApplicationsClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}" +func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, _ *ApplicationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -266,7 +261,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,8 +279,8 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // NewListPager - Gets all managed application resources created or in the process of being created in the Service Fabric // cluster resource. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. func (client *ApplicationsClient) NewListPager(resourceGroupName string, clusterName string, options *ApplicationsClientListOptions) *runtime.Pager[ApplicationsClientListResponse] { @@ -312,8 +307,8 @@ func (client *ApplicationsClient) NewListPager(resourceGroupName string, cluster } // listCreateRequest creates the List request. -func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ApplicationsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications" +func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ApplicationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -331,7 +326,7 @@ func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,8 +345,8 @@ func (client *ApplicationsClient) listHandleResponse(resp *http.Response) (Appli // latest application upgrade. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - options - ApplicationsClientBeginReadUpgradeOptions contains the optional parameters for the ApplicationsClient.BeginReadUpgrade @@ -363,8 +358,7 @@ func (client *ApplicationsClient) BeginReadUpgrade(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientReadUpgradeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -378,7 +372,7 @@ func (client *ApplicationsClient) BeginReadUpgrade(ctx context.Context, resource // application upgrade. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ApplicationsClient) readUpgrade(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginReadUpgradeOptions) (*http.Response, error) { var err error const operationName = "ApplicationsClient.BeginReadUpgrade" @@ -401,7 +395,7 @@ func (client *ApplicationsClient) readUpgrade(ctx context.Context, resourceGroup } // readUpgradeCreateRequest creates the ReadUpgrade request. -func (client *ApplicationsClient) readUpgradeCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginReadUpgradeOptions) (*policy.Request, error) { +func (client *ApplicationsClient) readUpgradeCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, _ *ApplicationsClientBeginReadUpgradeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/fetchUpgradeStatus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -424,7 +418,7 @@ func (client *ApplicationsClient) readUpgradeCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,8 +428,8 @@ func (client *ApplicationsClient) readUpgradeCreateRequest(ctx context.Context, // from where it was paused. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - parameters - The parameters for resuming an application upgrade. @@ -448,8 +442,7 @@ func (client *ApplicationsClient) BeginResumeUpgrade(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientResumeUpgradeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -463,7 +456,7 @@ func (client *ApplicationsClient) BeginResumeUpgrade(ctx context.Context, resour // where it was paused. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ApplicationsClient) resumeUpgrade(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters RuntimeResumeApplicationUpgradeParameters, options *ApplicationsClientBeginResumeUpgradeOptions) (*http.Response, error) { var err error const operationName = "ApplicationsClient.BeginResumeUpgrade" @@ -486,7 +479,7 @@ func (client *ApplicationsClient) resumeUpgrade(ctx context.Context, resourceGro } // resumeUpgradeCreateRequest creates the ResumeUpgrade request. -func (client *ApplicationsClient) resumeUpgradeCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters RuntimeResumeApplicationUpgradeParameters, options *ApplicationsClientBeginResumeUpgradeOptions) (*policy.Request, error) { +func (client *ApplicationsClient) resumeUpgradeCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters RuntimeResumeApplicationUpgradeParameters, _ *ApplicationsClientBeginResumeUpgradeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/resumeUpgrade" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -509,9 +502,10 @@ func (client *ApplicationsClient) resumeUpgradeCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -522,8 +516,8 @@ func (client *ApplicationsClient) resumeUpgradeCreateRequest(ctx context.Context // the application to the previous version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - options - ApplicationsClientBeginStartRollbackOptions contains the optional parameters for the ApplicationsClient.BeginStartRollback @@ -535,8 +529,7 @@ func (client *ApplicationsClient) BeginStartRollback(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientStartRollbackResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -550,7 +543,7 @@ func (client *ApplicationsClient) BeginStartRollback(ctx context.Context, resour // application to the previous version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ApplicationsClient) startRollback(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginStartRollbackOptions) (*http.Response, error) { var err error const operationName = "ApplicationsClient.BeginStartRollback" @@ -573,7 +566,7 @@ func (client *ApplicationsClient) startRollback(ctx context.Context, resourceGro } // startRollbackCreateRequest creates the StartRollback request. -func (client *ApplicationsClient) startRollbackCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginStartRollbackOptions) (*policy.Request, error) { +func (client *ApplicationsClient) startRollbackCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, _ *ApplicationsClientBeginStartRollbackOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/startRollback" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -596,7 +589,7 @@ func (client *ApplicationsClient) startRollbackCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -605,8 +598,8 @@ func (client *ApplicationsClient) startRollbackCreateRequest(ctx context.Context // Update - Updates the tags of an application resource of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - parameters - The application resource updated tags. @@ -634,8 +627,8 @@ func (client *ApplicationsClient) Update(ctx context.Context, resourceGroupName } // updateCreateRequest creates the Update request. -func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationUpdateParameters, options *ApplicationsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}" +func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationUpdateParameters, _ *ApplicationsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -657,9 +650,10 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applications_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applications_client_example_test.go index 275090378157..cae9f117a1bf 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applications_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applications_client_example_test.go @@ -1,170 +1,30 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationActionGetUpgrade_example.json -func ExampleApplicationsClient_BeginReadUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginReadUpgrade(ctx, "resRg", "myCluster", "myApp", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationActionStartRollback_example.json -func ExampleApplicationsClient_BeginStartRollback() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginStartRollback(ctx, "resRg", "myCluster", "myApp", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationActionResumeUpgrade_example.json -func ExampleApplicationsClient_BeginResumeUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginResumeUpgrade(ctx, "resRg", "myCluster", "myApp", armservicefabricmanagedclusters.RuntimeResumeApplicationUpgradeParameters{ - UpgradeDomainName: to.Ptr("UD1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationGetOperation_example.json -func ExampleApplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Get(ctx, "resRg", "myCluster", "myApp", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationResource = armservicefabricmanagedclusters.ApplicationResource{ - // Name: to.Ptr("myApp"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ - // Parameters: map[string]*string{ - // "param1": to.Ptr("value1"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // UpgradePolicy: &armservicefabricmanagedclusters.ApplicationUpgradePolicy{ - // ApplicationHealthPolicy: &armservicefabricmanagedclusters.ApplicationHealthPolicy{ - // ConsiderWarningAsError: to.Ptr(true), - // DefaultServiceTypeHealthPolicy: &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), - // ServiceTypeHealthPolicyMap: map[string]*armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // "service1": &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](30), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](30), - // MaxPercentUnhealthyServices: to.Ptr[int32](30), - // }, - // }, - // }, - // ForceRestart: to.Ptr(false), - // InstanceCloseDelayDuration: to.Ptr[int64](600), - // RecreateApplication: to.Ptr(false), - // RollingUpgradeMonitoringPolicy: &armservicefabricmanagedclusters.RollingUpgradeMonitoringPolicy{ - // FailureAction: to.Ptr(armservicefabricmanagedclusters.FailureActionRollback), - // HealthCheckRetryTimeout: to.Ptr("00:10:00"), - // HealthCheckStableDuration: to.Ptr("00:05:00"), - // HealthCheckWaitDuration: to.Ptr("00:02:00"), - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabricmanagedclusters.RollingUpgradeModeUnmonitoredAuto), - // UpgradeReplicaSetCheckTimeout: to.Ptr[int64](3600), - // }, - // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationPutOperation_example_max.json +// Generated from example definition: 2025-03-01-preview/ApplicationPutOperation_example_max.json func ExampleApplicationsClient_BeginCreateOrUpdate_putAnApplicationWithMaximumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewApplicationsClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myApp", armservicefabricmanagedclusters.ApplicationResource{ Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ Parameters: map[string]*string{ "param1": to.Ptr("value1"), @@ -202,6 +62,9 @@ func ExampleApplicationsClient_BeginCreateOrUpdate_putAnApplicationWithMaximumPa }, Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), }, + Tags: map[string]*string{ + "a": to.Ptr("b"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -213,63 +76,65 @@ func ExampleApplicationsClient_BeginCreateOrUpdate_putAnApplicationWithMaximumPa // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationResource = armservicefabricmanagedclusters.ApplicationResource{ - // Name: to.Ptr("myApp"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ - // Parameters: map[string]*string{ - // "param1": to.Ptr("value1"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // UpgradePolicy: &armservicefabricmanagedclusters.ApplicationUpgradePolicy{ - // ApplicationHealthPolicy: &armservicefabricmanagedclusters.ApplicationHealthPolicy{ - // ConsiderWarningAsError: to.Ptr(true), - // DefaultServiceTypeHealthPolicy: &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), - // ServiceTypeHealthPolicyMap: map[string]*armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // "service1": &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](30), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](30), - // MaxPercentUnhealthyServices: to.Ptr[int32](30), + // res = armservicefabricmanagedclusters.ApplicationsClientCreateOrUpdateResponse{ + // ApplicationResource: &armservicefabricmanagedclusters.ApplicationResource{ + // Name: to.Ptr("myApp"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ + // Parameters: map[string]*string{ + // "param1": to.Ptr("value1"), + // }, + // ProvisioningState: to.Ptr("Creating"), + // UpgradePolicy: &armservicefabricmanagedclusters.ApplicationUpgradePolicy{ + // ApplicationHealthPolicy: &armservicefabricmanagedclusters.ApplicationHealthPolicy{ + // ConsiderWarningAsError: to.Ptr(true), + // DefaultServiceTypeHealthPolicy: &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), + // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), + // MaxPercentUnhealthyServices: to.Ptr[int32](0), + // }, + // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), + // ServiceTypeHealthPolicyMap: map[string]*armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // "service1": &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](30), + // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](30), + // MaxPercentUnhealthyServices: to.Ptr[int32](30), + // }, // }, // }, + // ForceRestart: to.Ptr(false), + // InstanceCloseDelayDuration: to.Ptr[int64](600), + // RecreateApplication: to.Ptr(false), + // RollingUpgradeMonitoringPolicy: &armservicefabricmanagedclusters.RollingUpgradeMonitoringPolicy{ + // FailureAction: to.Ptr(armservicefabricmanagedclusters.FailureActionRollback), + // HealthCheckRetryTimeout: to.Ptr("00:10:00"), + // HealthCheckStableDuration: to.Ptr("00:05:00"), + // HealthCheckWaitDuration: to.Ptr("00:02:00"), + // UpgradeDomainTimeout: to.Ptr("00:15:00"), + // UpgradeTimeout: to.Ptr("01:00:00"), + // }, + // UpgradeMode: to.Ptr(armservicefabricmanagedclusters.RollingUpgradeModeUnmonitoredAuto), + // UpgradeReplicaSetCheckTimeout: to.Ptr[int64](3600), // }, - // ForceRestart: to.Ptr(false), - // InstanceCloseDelayDuration: to.Ptr[int64](600), - // RecreateApplication: to.Ptr(false), - // RollingUpgradeMonitoringPolicy: &armservicefabricmanagedclusters.RollingUpgradeMonitoringPolicy{ - // FailureAction: to.Ptr(armservicefabricmanagedclusters.FailureActionRollback), - // HealthCheckRetryTimeout: to.Ptr("00:10:00"), - // HealthCheckStableDuration: to.Ptr("00:05:00"), - // HealthCheckWaitDuration: to.Ptr("00:02:00"), - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabricmanagedclusters.RollingUpgradeModeUnmonitoredAuto), - // UpgradeReplicaSetCheckTimeout: to.Ptr[int64](3600), + // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // }, + // Tags: map[string]*string{ + // "a": to.Ptr("b"), // }, - // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationPutOperation_example_min.json +// Generated from example definition: 2025-03-01-preview/ApplicationPutOperation_example_min.json func ExampleApplicationsClient_BeginCreateOrUpdate_putAnApplicationWithMinimumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -289,152 +154,151 @@ func ExampleApplicationsClient_BeginCreateOrUpdate_putAnApplicationWithMinimumPa // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationResource = armservicefabricmanagedclusters.ApplicationResource{ - // Name: to.Ptr("myApp"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), - // Location: to.Ptr("eastus"), - // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ - // Parameters: map[string]*string{ - // "param1": to.Ptr("value1"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // UpgradePolicy: &armservicefabricmanagedclusters.ApplicationUpgradePolicy{ - // ApplicationHealthPolicy: &armservicefabricmanagedclusters.ApplicationHealthPolicy{ - // ConsiderWarningAsError: to.Ptr(true), - // DefaultServiceTypeHealthPolicy: &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), - // ServiceTypeHealthPolicyMap: map[string]*armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // "service1": &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](30), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](30), - // MaxPercentUnhealthyServices: to.Ptr[int32](30), + // res = armservicefabricmanagedclusters.ApplicationsClientCreateOrUpdateResponse{ + // ApplicationResource: &armservicefabricmanagedclusters.ApplicationResource{ + // Name: to.Ptr("myApp"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ + // Parameters: map[string]*string{ + // "param1": to.Ptr("value1"), + // }, + // ProvisioningState: to.Ptr("Updating"), + // UpgradePolicy: &armservicefabricmanagedclusters.ApplicationUpgradePolicy{ + // ApplicationHealthPolicy: &armservicefabricmanagedclusters.ApplicationHealthPolicy{ + // ConsiderWarningAsError: to.Ptr(true), + // DefaultServiceTypeHealthPolicy: &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), + // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), + // MaxPercentUnhealthyServices: to.Ptr[int32](0), + // }, + // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), + // ServiceTypeHealthPolicyMap: map[string]*armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // "service1": &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](30), + // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](30), + // MaxPercentUnhealthyServices: to.Ptr[int32](30), + // }, // }, // }, + // ForceRestart: to.Ptr(false), + // InstanceCloseDelayDuration: to.Ptr[int64](600), + // RecreateApplication: to.Ptr(false), + // RollingUpgradeMonitoringPolicy: &armservicefabricmanagedclusters.RollingUpgradeMonitoringPolicy{ + // FailureAction: to.Ptr(armservicefabricmanagedclusters.FailureActionRollback), + // HealthCheckRetryTimeout: to.Ptr("00:10:00"), + // HealthCheckStableDuration: to.Ptr("00:05:00"), + // HealthCheckWaitDuration: to.Ptr("00:02:00"), + // UpgradeDomainTimeout: to.Ptr("00:15:00"), + // UpgradeTimeout: to.Ptr("01:00:00"), + // }, + // UpgradeMode: to.Ptr(armservicefabricmanagedclusters.RollingUpgradeModeUnmonitoredAuto), + // UpgradeReplicaSetCheckTimeout: to.Ptr[int64](3600), // }, - // ForceRestart: to.Ptr(false), - // InstanceCloseDelayDuration: to.Ptr[int64](600), - // RecreateApplication: to.Ptr(false), - // RollingUpgradeMonitoringPolicy: &armservicefabricmanagedclusters.RollingUpgradeMonitoringPolicy{ - // FailureAction: to.Ptr(armservicefabricmanagedclusters.FailureActionRollback), - // HealthCheckRetryTimeout: to.Ptr("00:10:00"), - // HealthCheckStableDuration: to.Ptr("00:05:00"), - // HealthCheckWaitDuration: to.Ptr("00:02:00"), - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabricmanagedclusters.RollingUpgradeModeUnmonitoredAuto), - // UpgradeReplicaSetCheckTimeout: to.Ptr[int64](3600), + // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), // }, - // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationPatchOperation_example.json -func ExampleApplicationsClient_Update() { +// Generated from example definition: 2025-03-01-preview/ApplicationDeleteOperation_example.json +func ExampleApplicationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewApplicationsClient().Update(ctx, "resRg", "myCluster", "myApp", armservicefabricmanagedclusters.ApplicationUpdateParameters{ - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - }, nil) + poller, err := clientFactory.NewApplicationsClient().BeginDelete(ctx, "resRg", "myCluster", "myApp", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationResource = armservicefabricmanagedclusters.ApplicationResource{ - // Name: to.Ptr("myApp"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ - // Parameters: map[string]*string{ - // "param1": to.Ptr("value1"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // UpgradePolicy: &armservicefabricmanagedclusters.ApplicationUpgradePolicy{ - // ApplicationHealthPolicy: &armservicefabricmanagedclusters.ApplicationHealthPolicy{ - // ConsiderWarningAsError: to.Ptr(true), - // DefaultServiceTypeHealthPolicy: &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), - // ServiceTypeHealthPolicyMap: map[string]*armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // "service1": &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](30), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](30), - // MaxPercentUnhealthyServices: to.Ptr[int32](30), - // }, - // }, - // }, - // ForceRestart: to.Ptr(false), - // InstanceCloseDelayDuration: to.Ptr[int64](600), - // RecreateApplication: to.Ptr(false), - // RollingUpgradeMonitoringPolicy: &armservicefabricmanagedclusters.RollingUpgradeMonitoringPolicy{ - // FailureAction: to.Ptr(armservicefabricmanagedclusters.FailureActionRollback), - // HealthCheckRetryTimeout: to.Ptr("00:10:00"), - // HealthCheckStableDuration: to.Ptr("00:05:00"), - // HealthCheckWaitDuration: to.Ptr("00:02:00"), - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabricmanagedclusters.RollingUpgradeModeUnmonitoredAuto), - // UpgradeReplicaSetCheckTimeout: to.Ptr[int64](3600), - // }, - // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationDeleteOperation_example.json -func ExampleApplicationsClient_BeginDelete() { +// Generated from example definition: 2025-03-01-preview/ApplicationGetOperation_example.json +func ExampleApplicationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewApplicationsClient().BeginDelete(ctx, "resRg", "myCluster", "myApp", nil) + res, err := clientFactory.NewApplicationsClient().Get(ctx, "resRg", "myCluster", "myApp", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ApplicationsClientGetResponse{ + // ApplicationResource: &armservicefabricmanagedclusters.ApplicationResource{ + // Name: to.Ptr("myApp"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ + // Parameters: map[string]*string{ + // "param1": to.Ptr("value1"), + // }, + // ProvisioningState: to.Ptr("Updating"), + // UpgradePolicy: &armservicefabricmanagedclusters.ApplicationUpgradePolicy{ + // ApplicationHealthPolicy: &armservicefabricmanagedclusters.ApplicationHealthPolicy{ + // ConsiderWarningAsError: to.Ptr(true), + // DefaultServiceTypeHealthPolicy: &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), + // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), + // MaxPercentUnhealthyServices: to.Ptr[int32](0), + // }, + // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), + // ServiceTypeHealthPolicyMap: map[string]*armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // "service1": &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](30), + // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](30), + // MaxPercentUnhealthyServices: to.Ptr[int32](30), + // }, + // }, + // }, + // ForceRestart: to.Ptr(false), + // InstanceCloseDelayDuration: to.Ptr[int64](600), + // RecreateApplication: to.Ptr(false), + // RollingUpgradeMonitoringPolicy: &armservicefabricmanagedclusters.RollingUpgradeMonitoringPolicy{ + // FailureAction: to.Ptr(armservicefabricmanagedclusters.FailureActionRollback), + // HealthCheckRetryTimeout: to.Ptr("00:10:00"), + // HealthCheckStableDuration: to.Ptr("00:05:00"), + // HealthCheckWaitDuration: to.Ptr("00:02:00"), + // UpgradeDomainTimeout: to.Ptr("00:15:00"), + // UpgradeTimeout: to.Ptr("01:00:00"), + // }, + // UpgradeMode: to.Ptr(armservicefabricmanagedclusters.RollingUpgradeModeUnmonitoredAuto), + // UpgradeReplicaSetCheckTimeout: to.Ptr[int64](3600), + // }, + // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationListOperation_example.json +// Generated from example definition: 2025-03-01-preview/ApplicationListOperation_example.json func ExampleApplicationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -449,17 +313,159 @@ func ExampleApplicationsClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationResourceList = armservicefabricmanagedclusters.ApplicationResourceList{ - // Value: []*armservicefabricmanagedclusters.ApplicationResource{ - // { - // Name: to.Ptr("myApp"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), - // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // page = armservicefabricmanagedclusters.ApplicationsClientListResponse{ + // ApplicationResourceList: armservicefabricmanagedclusters.ApplicationResourceList{ + // NextLink: to.Ptr("http://examplelink.com"), + // Value: []*armservicefabricmanagedclusters.ApplicationResource{ + // { + // Name: to.Ptr("myApp"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), + // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ + // ProvisioningState: to.Ptr("Updating"), + // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-03-01-preview/ApplicationActionGetUpgrade_example.json +func ExampleApplicationsClient_BeginReadUpgrade() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewApplicationsClient().BeginReadUpgrade(ctx, "resRg", "myCluster", "myApp", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-03-01-preview/ApplicationActionResumeUpgrade_example.json +func ExampleApplicationsClient_BeginResumeUpgrade() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewApplicationsClient().BeginResumeUpgrade(ctx, "resRg", "myCluster", "myApp", armservicefabricmanagedclusters.RuntimeResumeApplicationUpgradeParameters{ + UpgradeDomainName: to.Ptr("UD1"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-03-01-preview/ApplicationActionStartRollback_example.json +func ExampleApplicationsClient_BeginStartRollback() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewApplicationsClient().BeginStartRollback(ctx, "resRg", "myCluster", "myApp", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-03-01-preview/ApplicationPatchOperation_example.json +func ExampleApplicationsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewApplicationsClient().Update(ctx, "resRg", "myCluster", "myApp", armservicefabricmanagedclusters.ApplicationUpdateParameters{ + Tags: map[string]*string{ + "a": to.Ptr("b"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ApplicationsClientUpdateResponse{ + // ApplicationResource: &armservicefabricmanagedclusters.ApplicationResource{ + // Name: to.Ptr("myApp"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ApplicationResourceProperties{ + // Parameters: map[string]*string{ + // "param1": to.Ptr("value1"), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // UpgradePolicy: &armservicefabricmanagedclusters.ApplicationUpgradePolicy{ + // ApplicationHealthPolicy: &armservicefabricmanagedclusters.ApplicationHealthPolicy{ + // ConsiderWarningAsError: to.Ptr(true), + // DefaultServiceTypeHealthPolicy: &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), + // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), + // MaxPercentUnhealthyServices: to.Ptr[int32](0), + // }, + // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), + // ServiceTypeHealthPolicyMap: map[string]*armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // "service1": &armservicefabricmanagedclusters.ServiceTypeHealthPolicy{ + // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](30), + // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](30), + // MaxPercentUnhealthyServices: to.Ptr[int32](30), + // }, + // }, + // }, + // ForceRestart: to.Ptr(false), + // InstanceCloseDelayDuration: to.Ptr[int64](600), + // RecreateApplication: to.Ptr(false), + // RollingUpgradeMonitoringPolicy: &armservicefabricmanagedclusters.RollingUpgradeMonitoringPolicy{ + // FailureAction: to.Ptr(armservicefabricmanagedclusters.FailureActionRollback), + // HealthCheckRetryTimeout: to.Ptr("00:10:00"), + // HealthCheckStableDuration: to.Ptr("00:05:00"), + // HealthCheckWaitDuration: to.Ptr("00:02:00"), + // UpgradeDomainTimeout: to.Ptr("00:15:00"), + // UpgradeTimeout: to.Ptr("01:00:00"), + // }, + // UpgradeMode: to.Ptr(armservicefabricmanagedclusters.RollingUpgradeModeUnmonitoredAuto), + // UpgradeReplicaSetCheckTimeout: to.Ptr[int64](3600), + // }, + // Version: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // }, + // Tags: map[string]*string{ + // "a": to.Ptr("b"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypes_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypes_client.go index 1d6bcd31d3b6..76930169e65c 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypes_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypes_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ApplicationTypesClient struct { } // NewApplicationTypesClient creates a new instance of ApplicationTypesClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewApplicationTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationTypesClient, error) { @@ -46,8 +42,8 @@ func NewApplicationTypesClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Create or update a Service Fabric managed application type name resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - parameters - The application type name resource. @@ -76,8 +72,8 @@ func (client *ApplicationTypesClient) CreateOrUpdate(ctx context.Context, resour } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationTypesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeResource, options *ApplicationTypesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}" +func (client *ApplicationTypesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeResource, _ *ApplicationTypesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -99,9 +95,10 @@ func (client *ApplicationTypesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -120,8 +117,8 @@ func (client *ApplicationTypesClient) createOrUpdateHandleResponse(resp *http.Re // BeginDelete - Delete a Service Fabric managed application type name resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - options - ApplicationTypesClientBeginDeleteOptions contains the optional parameters for the ApplicationTypesClient.BeginDelete @@ -133,8 +130,7 @@ func (client *ApplicationTypesClient) BeginDelete(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationTypesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -147,7 +143,7 @@ func (client *ApplicationTypesClient) BeginDelete(ctx context.Context, resourceG // Delete - Delete a Service Fabric managed application type name resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ApplicationTypesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationTypesClient.BeginDelete" @@ -162,7 +158,7 @@ func (client *ApplicationTypesClient) deleteOperation(ctx context.Context, resou if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -170,8 +166,8 @@ func (client *ApplicationTypesClient) deleteOperation(ctx context.Context, resou } // deleteCreateRequest creates the Delete request. -func (client *ApplicationTypesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}" +func (client *ApplicationTypesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, _ *ApplicationTypesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -193,7 +189,7 @@ func (client *ApplicationTypesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,8 +199,8 @@ func (client *ApplicationTypesClient) deleteCreateRequest(ctx context.Context, r // managed cluster resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - options - ApplicationTypesClientGetOptions contains the optional parameters for the ApplicationTypesClient.Get method. @@ -231,8 +227,8 @@ func (client *ApplicationTypesClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *ApplicationTypesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}" +func (client *ApplicationTypesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, _ *ApplicationTypesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -254,7 +250,7 @@ func (client *ApplicationTypesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,8 +268,8 @@ func (client *ApplicationTypesClient) getHandleResponse(resp *http.Response) (Ap // NewListPager - Gets all application type name resources created or in the process of being created in the Service Fabric // managed cluster resource. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - options - ApplicationTypesClientListOptions contains the optional parameters for the ApplicationTypesClient.NewListPager // method. @@ -301,8 +297,8 @@ func (client *ApplicationTypesClient) NewListPager(resourceGroupName string, clu } // listCreateRequest creates the List request. -func (client *ApplicationTypesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ApplicationTypesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes" +func (client *ApplicationTypesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ApplicationTypesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -320,7 +316,7 @@ func (client *ApplicationTypesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,8 +334,8 @@ func (client *ApplicationTypesClient) listHandleResponse(resp *http.Response) (A // Update - Updates the tags of an application type resource of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - parameters - The application type resource updated tags. @@ -367,8 +363,8 @@ func (client *ApplicationTypesClient) Update(ctx context.Context, resourceGroupN } // updateCreateRequest creates the Update request. -func (client *ApplicationTypesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeUpdateParameters, options *ApplicationTypesClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}" +func (client *ApplicationTypesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeUpdateParameters, _ *ApplicationTypesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -390,9 +386,10 @@ func (client *ApplicationTypesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypes_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypes_client_example_test.go index a7b00d8d8204..bf04436d3934 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypes_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypes_client_example_test.go @@ -1,145 +1,108 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameGetOperation_example.json -func ExampleApplicationTypesClient_Get() { +// Generated from example definition: 2025-03-01-preview/ApplicationTypeNamePutOperation_example.json +func ExampleApplicationTypesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewApplicationTypesClient().Get(ctx, "resRg", "myCluster", "myAppType", nil) + res, err := clientFactory.NewApplicationTypesClient().CreateOrUpdate(ctx, "resRg", "myCluster", "myAppType", armservicefabricmanagedclusters.ApplicationTypeResource{ + Location: to.Ptr("eastus"), + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationTypeResource = armservicefabricmanagedclusters.ApplicationTypeResource{ - // Name: to.Ptr("myAppType"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType"), - // Properties: &armservicefabricmanagedclusters.ApplicationTypeResourceProperties{ - // ProvisioningState: to.Ptr("Succeeded"), + // res = armservicefabricmanagedclusters.ApplicationTypesClientCreateOrUpdateResponse{ + // ApplicationTypeResource: &armservicefabricmanagedclusters.ApplicationTypeResource{ + // Name: to.Ptr("myAppType"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType"), + // Properties: &armservicefabricmanagedclusters.ApplicationTypeResourceProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNamePutOperation_example.json -func ExampleApplicationTypesClient_CreateOrUpdate() { +// Generated from example definition: 2025-03-01-preview/ApplicationTypeNameDeleteOperation_example.json +func ExampleApplicationTypesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewApplicationTypesClient().CreateOrUpdate(ctx, "resRg", "myCluster", "myAppType", armservicefabricmanagedclusters.ApplicationTypeResource{ - Location: to.Ptr("eastus"), - }, nil) + poller, err := clientFactory.NewApplicationTypesClient().BeginDelete(ctx, "resRg", "myCluster", "myAppType", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationTypeResource = armservicefabricmanagedclusters.ApplicationTypeResource{ - // Name: to.Ptr("myAppType"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType"), - // Properties: &armservicefabricmanagedclusters.ApplicationTypeResourceProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNamePatchOperation_example.json -func ExampleApplicationTypesClient_Update() { +// Generated from example definition: 2025-03-01-preview/ApplicationTypeNameGetOperation_example.json +func ExampleApplicationTypesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewApplicationTypesClient().Update(ctx, "resRg", "myCluster", "myAppType", armservicefabricmanagedclusters.ApplicationTypeUpdateParameters{ - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - }, nil) + res, err := clientFactory.NewApplicationTypesClient().Get(ctx, "resRg", "myCluster", "myAppType", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationTypeResource = armservicefabricmanagedclusters.ApplicationTypeResource{ - // Name: to.Ptr("myAppType"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.ApplicationTypeResourceProperties{ - // ProvisioningState: to.Ptr("Succeeded"), + // res = armservicefabricmanagedclusters.ApplicationTypesClientGetResponse{ + // ApplicationTypeResource: &armservicefabricmanagedclusters.ApplicationTypeResource{ + // Name: to.Ptr("myAppType"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType"), + // Properties: &armservicefabricmanagedclusters.ApplicationTypeResourceProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameDeleteOperation_example.json -func ExampleApplicationTypesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationTypesClient().BeginDelete(ctx, "resRg", "myCluster", "myAppType", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameListOperation_example.json +// Generated from example definition: 2025-03-01-preview/ApplicationTypeNameListOperation_example.json func ExampleApplicationTypesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -154,16 +117,57 @@ func ExampleApplicationTypesClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationTypeResourceList = armservicefabricmanagedclusters.ApplicationTypeResourceList{ - // Value: []*armservicefabricmanagedclusters.ApplicationTypeResource{ - // { - // Name: to.Ptr("myAppType"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType"), - // Properties: &armservicefabricmanagedclusters.ApplicationTypeResourceProperties{ - // ProvisioningState: to.Ptr("Succeeded"), + // page = armservicefabricmanagedclusters.ApplicationTypesClientListResponse{ + // ApplicationTypeResourceList: armservicefabricmanagedclusters.ApplicationTypeResourceList{ + // NextLink: to.Ptr("http://examplelink.com"), + // Value: []*armservicefabricmanagedclusters.ApplicationTypeResource{ + // { + // Name: to.Ptr("myAppType"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType"), + // Properties: &armservicefabricmanagedclusters.ApplicationTypeResourceProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-03-01-preview/ApplicationTypeNamePatchOperation_example.json +func ExampleApplicationTypesClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewApplicationTypesClient().Update(ctx, "resRg", "myCluster", "myAppType", armservicefabricmanagedclusters.ApplicationTypeUpdateParameters{ + Tags: map[string]*string{ + "a": to.Ptr("b"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ApplicationTypesClientUpdateResponse{ + // ApplicationTypeResource: &armservicefabricmanagedclusters.ApplicationTypeResource{ + // Name: to.Ptr("myAppType"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType"), + // Properties: &armservicefabricmanagedclusters.ApplicationTypeResourceProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // Tags: map[string]*string{ + // "a": to.Ptr("b"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypeversions_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypeversions_client.go index fdffb48b9747..a3fbb9d62b03 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypeversions_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypeversions_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ApplicationTypeVersionsClient struct { } // NewApplicationTypeVersionsClient creates a new instance of ApplicationTypeVersionsClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewApplicationTypeVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationTypeVersionsClient, error) { @@ -46,8 +42,8 @@ func NewApplicationTypeVersionsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Create or update a Service Fabric managed application type version resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - version - The application type version. @@ -61,8 +57,7 @@ func (client *ApplicationTypeVersionsClient) BeginCreateOrUpdate(ctx context.Con return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationTypeVersionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -75,7 +70,7 @@ func (client *ApplicationTypeVersionsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create or update a Service Fabric managed application type version resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ApplicationTypeVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionResource, options *ApplicationTypeVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ApplicationTypeVersionsClient.BeginCreateOrUpdate" @@ -98,8 +93,8 @@ func (client *ApplicationTypeVersionsClient) createOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationTypeVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionResource, options *ApplicationTypeVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" +func (client *ApplicationTypeVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionResource, _ *ApplicationTypeVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -125,9 +120,10 @@ func (client *ApplicationTypeVersionsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -137,8 +133,8 @@ func (client *ApplicationTypeVersionsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Delete a Service Fabric managed application type version resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - version - The application type version. @@ -151,8 +147,7 @@ func (client *ApplicationTypeVersionsClient) BeginDelete(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationTypeVersionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -165,7 +160,7 @@ func (client *ApplicationTypeVersionsClient) BeginDelete(ctx context.Context, re // Delete - Delete a Service Fabric managed application type version resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ApplicationTypeVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, options *ApplicationTypeVersionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationTypeVersionsClient.BeginDelete" @@ -180,7 +175,7 @@ func (client *ApplicationTypeVersionsClient) deleteOperation(ctx context.Context if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -188,8 +183,8 @@ func (client *ApplicationTypeVersionsClient) deleteOperation(ctx context.Context } // deleteCreateRequest creates the Delete request. -func (client *ApplicationTypeVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, options *ApplicationTypeVersionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" +func (client *ApplicationTypeVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, _ *ApplicationTypeVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -215,7 +210,7 @@ func (client *ApplicationTypeVersionsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,8 +220,8 @@ func (client *ApplicationTypeVersionsClient) deleteCreateRequest(ctx context.Con // Service Fabric managed application type name resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - version - The application type version. @@ -255,8 +250,8 @@ func (client *ApplicationTypeVersionsClient) Get(ctx context.Context, resourceGr } // getCreateRequest creates the Get request. -func (client *ApplicationTypeVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, options *ApplicationTypeVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" +func (client *ApplicationTypeVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, _ *ApplicationTypeVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -282,7 +277,7 @@ func (client *ApplicationTypeVersionsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,8 +295,8 @@ func (client *ApplicationTypeVersionsClient) getHandleResponse(resp *http.Respon // NewListByApplicationTypesPager - Gets all application type version resources created or in the process of being created // in the Service Fabric managed application type name resource. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - options - ApplicationTypeVersionsClientListByApplicationTypesOptions contains the optional parameters for the ApplicationTypeVersionsClient.NewListByApplicationTypesPager @@ -330,8 +325,8 @@ func (client *ApplicationTypeVersionsClient) NewListByApplicationTypesPager(reso } // listByApplicationTypesCreateRequest creates the ListByApplicationTypes request. -func (client *ApplicationTypeVersionsClient) listByApplicationTypesCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypeVersionsClientListByApplicationTypesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions" +func (client *ApplicationTypeVersionsClient) listByApplicationTypesCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, _ *ApplicationTypeVersionsClientListByApplicationTypesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -353,7 +348,7 @@ func (client *ApplicationTypeVersionsClient) listByApplicationTypesCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,8 +366,8 @@ func (client *ApplicationTypeVersionsClient) listByApplicationTypesHandleRespons // Update - Updates the tags of an application type version resource of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. // - version - The application type version. @@ -402,8 +397,8 @@ func (client *ApplicationTypeVersionsClient) Update(ctx context.Context, resourc } // updateCreateRequest creates the Update request. -func (client *ApplicationTypeVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionUpdateParameters, options *ApplicationTypeVersionsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" +func (client *ApplicationTypeVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionUpdateParameters, _ *ApplicationTypeVersionsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -429,9 +424,10 @@ func (client *ApplicationTypeVersionsClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypeversions_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypeversions_client_example_test.go index 908957219fc9..db72a6460ff9 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypeversions_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/applicationtypeversions_client_example_test.go @@ -1,60 +1,25 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionGetOperation_example.json -func ExampleApplicationTypeVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationTypeVersionsClient().Get(ctx, "resRg", "myCluster", "myAppType", "1.0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationTypeVersionResource = armservicefabricmanagedclusters.ApplicationTypeVersionResource{ - // Name: to.Ptr("1.0"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), - // Properties: &armservicefabricmanagedclusters.ApplicationTypeVersionResourceProperties{ - // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionPutOperation_example.json +// Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionPutOperation_example.json func ExampleApplicationTypeVersionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -74,82 +39,79 @@ func ExampleApplicationTypeVersionsClient_BeginCreateOrUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationTypeVersionResource = armservicefabricmanagedclusters.ApplicationTypeVersionResource{ - // Name: to.Ptr("1.0"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), - // Properties: &armservicefabricmanagedclusters.ApplicationTypeVersionResourceProperties{ - // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), - // ProvisioningState: to.Ptr("Succeeded"), + // res = armservicefabricmanagedclusters.ApplicationTypeVersionsClientCreateOrUpdateResponse{ + // ApplicationTypeVersionResource: &armservicefabricmanagedclusters.ApplicationTypeVersionResource{ + // Name: to.Ptr("1.0"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // Properties: &armservicefabricmanagedclusters.ApplicationTypeVersionResourceProperties{ + // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), + // ProvisioningState: to.Ptr("Creating"), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionPatchOperation_example.json -func ExampleApplicationTypeVersionsClient_Update() { +// Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionDeleteOperation_example.json +func ExampleApplicationTypeVersionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewApplicationTypeVersionsClient().Update(ctx, "resRg", "myCluster", "myAppType", "1.0", armservicefabricmanagedclusters.ApplicationTypeVersionUpdateParameters{ - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - }, nil) + poller, err := clientFactory.NewApplicationTypeVersionsClient().BeginDelete(ctx, "resRg", "myCluster", "myAppType", "1.0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationTypeVersionResource = armservicefabricmanagedclusters.ApplicationTypeVersionResource{ - // Name: to.Ptr("1.0"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.ApplicationTypeVersionResourceProperties{ - // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionDeleteOperation_example.json -func ExampleApplicationTypeVersionsClient_BeginDelete() { +// Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionGetOperation_example.json +func ExampleApplicationTypeVersionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewApplicationTypeVersionsClient().BeginDelete(ctx, "resRg", "myCluster", "myAppType", "1.0", nil) + res, err := clientFactory.NewApplicationTypeVersionsClient().Get(ctx, "resRg", "myCluster", "myAppType", "1.0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ApplicationTypeVersionsClientGetResponse{ + // ApplicationTypeVersionResource: &armservicefabricmanagedclusters.ApplicationTypeVersionResource{ + // Name: to.Ptr("1.0"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // Properties: &armservicefabricmanagedclusters.ApplicationTypeVersionResourceProperties{ + // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), + // ProvisioningState: to.Ptr("Updating"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionListOperation_example.json +// Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionListOperation_example.json func ExampleApplicationTypeVersionsClient_NewListByApplicationTypesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -164,17 +126,59 @@ func ExampleApplicationTypeVersionsClient_NewListByApplicationTypesPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationTypeVersionResourceList = armservicefabricmanagedclusters.ApplicationTypeVersionResourceList{ - // Value: []*armservicefabricmanagedclusters.ApplicationTypeVersionResource{ - // { - // Name: to.Ptr("1.0"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), - // Properties: &armservicefabricmanagedclusters.ApplicationTypeVersionResourceProperties{ - // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), - // ProvisioningState: to.Ptr("Succeeded"), + // page = armservicefabricmanagedclusters.ApplicationTypeVersionsClientListByApplicationTypesResponse{ + // ApplicationTypeVersionResourceList: armservicefabricmanagedclusters.ApplicationTypeVersionResourceList{ + // NextLink: to.Ptr("http://examplelink.com"), + // Value: []*armservicefabricmanagedclusters.ApplicationTypeVersionResource{ + // { + // Name: to.Ptr("1.0"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // Properties: &armservicefabricmanagedclusters.ApplicationTypeVersionResourceProperties{ + // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), + // ProvisioningState: to.Ptr("Updating"), + // }, // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionPatchOperation_example.json +func ExampleApplicationTypeVersionsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewApplicationTypeVersionsClient().Update(ctx, "resRg", "myCluster", "myAppType", "1.0", armservicefabricmanagedclusters.ApplicationTypeVersionUpdateParameters{ + Tags: map[string]*string{ + "a": to.Ptr("b"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ApplicationTypeVersionsClientUpdateResponse{ + // ApplicationTypeVersionResource: &armservicefabricmanagedclusters.ApplicationTypeVersionResource{ + // Name: to.Ptr("1.0"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0"), + // Properties: &armservicefabricmanagedclusters.ApplicationTypeVersionResourceProperties{ + // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // Tags: map[string]*string{ + // "a": to.Ptr("b"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/autorest.md b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/autorest.md deleted file mode 100644 index b9679fc8122d..000000000000 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.3.0 -tag: package-2024-09-preview -``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/build.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/build.go deleted file mode 100644 index 1c70205b1107..000000000000 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired -removeUnreferencedTypes resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters - -package armservicefabricmanagedclusters diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/client_factory.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/client_factory.go index 9548e6f963e7..bd1f2883f7e5 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/client_factory.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/client_factory.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -22,7 +18,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/constants.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/constants.go index b34140bf0e22..08f1f85ca6f1 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/constants.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/constants.go @@ -1,24 +1,22 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" - moduleVersion = "v0.3.0" + moduleVersion = "v0.4.0" ) // Access - The network traffic is allowed or denied. type Access string const ( + // AccessAllow - The network traffic is allowed. AccessAllow Access = "allow" - AccessDeny Access = "deny" + // AccessDeny - The network traffic is denied. + AccessDeny Access = "deny" ) // PossibleAccessValues returns the possible values for the Access const type. @@ -30,10 +28,11 @@ func PossibleAccessValues() []Access { } // AutoGeneratedDomainNameLabelScope - This enum is the entrypoint to using a certificate from a public CA for your cluster. -// This property was introduced to solve the domain squatting problem with new domains. A domain name will be -// generated in the following format: .... The hash portion comes from Azure DNS' Deterministic Name Library. The library -// creates a hash using the cluster's Tenant, Subscription, Resource Group and -// Resource Name using the AutoGeneratedDomainNameLabelScope/reuse policy chosen. +// This property was introduced to solve the +// domain squatting problem with new domains. A domain name will be generated in the following format: {clustername}.{hash}.{regionname}.sfmcdomain. +// The hash portion comes from Azure DNS' Deterministic Name Library. The library creates a hash using the cluster's Tenant, +// Subscription, Resource Group +// and Resource Name using the AutoGeneratedDomainNameLabelScope/reuse policy chosen. type AutoGeneratedDomainNameLabelScope string const ( @@ -139,11 +138,37 @@ func PossibleClusterUpgradeModeValues() []ClusterUpgradeMode { } } +// CreatedByType - The kind of entity that created the resource. +type CreatedByType string + +const ( + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + // Direction - Network security rule direction. type Direction string const ( - DirectionInbound Direction = "inbound" + // DirectionInbound - Inbound direction. + DirectionInbound Direction = "inbound" + // DirectionOutbound - Outbound direction. DirectionOutbound Direction = "outbound" ) @@ -161,19 +186,31 @@ type DiskType string const ( // DiskTypePremiumLRS - Premium SSD locally redundant storage. Best for production and performance sensitive workloads. DiskTypePremiumLRS DiskType = "Premium_LRS" + // DiskTypePremiumV2LRS - Premium SSD V2 locally redundant storage. Best for production and performance sensitive workloads + // that consistently require low latency and high IOPS and throughput. + DiskTypePremiumV2LRS DiskType = "PremiumV2_LRS" + // DiskTypePremiumZRS - Premium SSD zone redundant storage. Best for production workloads that need storage resiliency against + // zone failures. + DiskTypePremiumZRS DiskType = "Premium_ZRS" // DiskTypeStandardLRS - Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. DiskTypeStandardLRS DiskType = "Standard_LRS" // DiskTypeStandardSSDLRS - Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications // and dev/test. DiskTypeStandardSSDLRS DiskType = "StandardSSD_LRS" + // DiskTypeStandardSSDZRS - Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications + // and dev/test that need storage resiliency against zone failures. + DiskTypeStandardSSDZRS DiskType = "StandardSSD_ZRS" ) // PossibleDiskTypeValues returns the possible values for the DiskType const type. func PossibleDiskTypeValues() []DiskType { return []DiskType{ DiskTypePremiumLRS, + DiskTypePremiumV2LRS, + DiskTypePremiumZRS, DiskTypeStandardLRS, DiskTypeStandardSSDLRS, + DiskTypeStandardSSDZRS, } } @@ -196,14 +233,15 @@ func PossibleEvictionPolicyTypeValues() []EvictionPolicyType { } // FailureAction - The compensating action to perform when a Monitored upgrade encounters monitoring policy or health policy -// violations. Rollback specifies that the upgrade will start rolling back automatically. Manual -// indicates that the upgrade will switch to UnmonitoredManual upgrade mode. +// violations. Invalid indicates the failure action is invalid. Rollback specifies that the upgrade will start rolling back +// automatically. Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. type FailureAction string const ( - // FailureActionManual - The upgrade will switch to UnmonitoredManual upgrade mode. The value is 1 + // FailureActionManual - Indicates that a manual repair will need to be performed by the administrator if the upgrade fails. + // Service Fabric will not proceed to the next upgrade domain automatically. FailureActionManual FailureAction = "Manual" - // FailureActionRollback - The upgrade will start rolling back automatically. The value is 0 + // FailureActionRollback - Indicates that a rollback of the upgrade will be performed by Service Fabric if the upgrade fails. FailureActionRollback FailureAction = "Rollback" ) @@ -215,6 +253,57 @@ func PossibleFailureActionValues() []FailureAction { } } +// FaultKind - The kind of fault simulation. +type FaultKind string + +const ( + // FaultKindZone - Simulates an availability zone down. + FaultKindZone FaultKind = "Zone" +) + +// PossibleFaultKindValues returns the possible values for the FaultKind const type. +func PossibleFaultKindValues() []FaultKind { + return []FaultKind{ + FaultKindZone, + } +} + +// FaultSimulationStatus - Fault simulation status. +type FaultSimulationStatus string + +const ( + // FaultSimulationStatusActive - Indicates the fault simulation is active. The simulation will have this status after the + // start operation has completed successfully. + FaultSimulationStatusActive FaultSimulationStatus = "Active" + // FaultSimulationStatusDone - Indicates the fault simulation is done. The simulation will have this status after the stop + // operation has completed successfully. + FaultSimulationStatusDone FaultSimulationStatus = "Done" + // FaultSimulationStatusStartFailed - Indicates the fault simulation has failed on start. The simulation will have this status + // after the start operation fails. + FaultSimulationStatusStartFailed FaultSimulationStatus = "StartFailed" + // FaultSimulationStatusStarting - Indicates the fault simulation is starting. The simulation will have this status while + // the start operation is in progress. + FaultSimulationStatusStarting FaultSimulationStatus = "Starting" + // FaultSimulationStatusStopFailed - Indicates the fault simulation has failed on stop. The simulation will have this status + // after the stop operation fails. + FaultSimulationStatusStopFailed FaultSimulationStatus = "StopFailed" + // FaultSimulationStatusStopping - Indicates the fault simulation is stopping. The simulation will have this status while + // the stop operation is in progress. + FaultSimulationStatusStopping FaultSimulationStatus = "Stopping" +) + +// PossibleFaultSimulationStatusValues returns the possible values for the FaultSimulationStatus const type. +func PossibleFaultSimulationStatusValues() []FaultSimulationStatus { + return []FaultSimulationStatus{ + FaultSimulationStatusActive, + FaultSimulationStatusDone, + FaultSimulationStatusStartFailed, + FaultSimulationStatusStarting, + FaultSimulationStatusStopFailed, + FaultSimulationStatusStopping, + } +} + // IPAddressType - The IP address type. type IPAddressType string @@ -254,10 +343,11 @@ func PossibleManagedClusterAddOnFeatureValues() []ManagedClusterAddOnFeature { } } +// ManagedClusterVersionEnvironment - The operating system of the cluster. The default means all. type ManagedClusterVersionEnvironment string const ( - // ManagedClusterVersionEnvironmentWindows - Windows. + // ManagedClusterVersionEnvironmentWindows - Indicates os is Windows. ManagedClusterVersionEnvironmentWindows ManagedClusterVersionEnvironment = "Windows" ) @@ -297,16 +387,27 @@ func PossibleManagedIdentityTypeValues() []ManagedIdentityType { type ManagedResourceProvisioningState string const ( - ManagedResourceProvisioningStateCanceled ManagedResourceProvisioningState = "Canceled" - ManagedResourceProvisioningStateCreated ManagedResourceProvisioningState = "Created" - ManagedResourceProvisioningStateCreating ManagedResourceProvisioningState = "Creating" - ManagedResourceProvisioningStateDeleted ManagedResourceProvisioningState = "Deleted" - ManagedResourceProvisioningStateDeleting ManagedResourceProvisioningState = "Deleting" - ManagedResourceProvisioningStateFailed ManagedResourceProvisioningState = "Failed" - ManagedResourceProvisioningStateNone ManagedResourceProvisioningState = "None" - ManagedResourceProvisioningStateOther ManagedResourceProvisioningState = "Other" + // ManagedResourceProvisioningStateCanceled - The resource provisioning has been canceled. + ManagedResourceProvisioningStateCanceled ManagedResourceProvisioningState = "Canceled" + // ManagedResourceProvisioningStateCreated - The resource is created. + ManagedResourceProvisioningStateCreated ManagedResourceProvisioningState = "Created" + // ManagedResourceProvisioningStateCreating - The resource is being created. + ManagedResourceProvisioningStateCreating ManagedResourceProvisioningState = "Creating" + // ManagedResourceProvisioningStateDeleted - The resource has been deleted. + ManagedResourceProvisioningStateDeleted ManagedResourceProvisioningState = "Deleted" + // ManagedResourceProvisioningStateDeleting - The resource is being deleted. + ManagedResourceProvisioningStateDeleting ManagedResourceProvisioningState = "Deleting" + // ManagedResourceProvisioningStateFailed - The resource provisioning has failed. + ManagedResourceProvisioningStateFailed ManagedResourceProvisioningState = "Failed" + // ManagedResourceProvisioningStateNone - The resource does not have a provisioning state. + ManagedResourceProvisioningStateNone ManagedResourceProvisioningState = "None" + // ManagedResourceProvisioningStateOther - The resource provisioning state is a state other than the previously specified + // states. + ManagedResourceProvisioningStateOther ManagedResourceProvisioningState = "Other" + // ManagedResourceProvisioningStateSucceeded - The resource provisioning has succeeded. ManagedResourceProvisioningStateSucceeded ManagedResourceProvisioningState = "Succeeded" - ManagedResourceProvisioningStateUpdating ManagedResourceProvisioningState = "Updating" + // ManagedResourceProvisioningStateUpdating - The resource is being updated. + ManagedResourceProvisioningStateUpdating ManagedResourceProvisioningState = "Updating" ) // PossibleManagedResourceProvisioningStateValues returns the possible values for the ManagedResourceProvisioningState const type. @@ -374,13 +475,20 @@ func PossibleNodeTypeSKUScaleTypeValues() []NodeTypeSKUScaleType { type NsgProtocol string const ( - NsgProtocolAh NsgProtocol = "ah" - NsgProtocolEsp NsgProtocol = "esp" - NsgProtocolHTTP NsgProtocol = "http" + // NsgProtocolAh - Protocol applies to AH. + NsgProtocolAh NsgProtocol = "ah" + // NsgProtocolEsp - Protocol applies to ESP. + NsgProtocolEsp NsgProtocol = "esp" + // NsgProtocolHTTP - Protocol applies to HTTP. + NsgProtocolHTTP NsgProtocol = "http" + // NsgProtocolHTTPS - Protocol applies to HTTPS. NsgProtocolHTTPS NsgProtocol = "https" - NsgProtocolIcmp NsgProtocol = "icmp" - NsgProtocolTCP NsgProtocol = "tcp" - NsgProtocolUDP NsgProtocol = "udp" + // NsgProtocolIcmp - Protocol applies to ICMP. + NsgProtocolIcmp NsgProtocol = "icmp" + // NsgProtocolTCP - Protocol applies to TCP. + NsgProtocolTCP NsgProtocol = "tcp" + // NsgProtocolUDP - Protocol applies to UDP. + NsgProtocolUDP NsgProtocol = "udp" ) // PossibleNsgProtocolValues returns the possible values for the NsgProtocol const type. @@ -439,8 +547,10 @@ func PossiblePartitionSchemeValues() []PartitionScheme { type PrivateEndpointNetworkPolicies string const ( + // PrivateEndpointNetworkPoliciesDisabled - Disable apply network policies on private end point in the subnet. PrivateEndpointNetworkPoliciesDisabled PrivateEndpointNetworkPolicies = "disabled" - PrivateEndpointNetworkPoliciesEnabled PrivateEndpointNetworkPolicies = "enabled" + // PrivateEndpointNetworkPoliciesEnabled - Enable apply network policies on private end point in the subnet. + PrivateEndpointNetworkPoliciesEnabled PrivateEndpointNetworkPolicies = "enabled" ) // PossiblePrivateEndpointNetworkPoliciesValues returns the possible values for the PrivateEndpointNetworkPolicies const type. @@ -455,7 +565,9 @@ func PossiblePrivateEndpointNetworkPoliciesValues() []PrivateEndpointNetworkPoli type PrivateIPAddressVersion string const ( + // PrivateIPAddressVersionIPv4 - The IP configuration's private IP is IPv4. PrivateIPAddressVersionIPv4 PrivateIPAddressVersion = "IPv4" + // PrivateIPAddressVersionIPv6 - The IP configuration's private IP is IPv6. PrivateIPAddressVersionIPv6 PrivateIPAddressVersion = "IPv6" ) @@ -471,8 +583,10 @@ func PossiblePrivateIPAddressVersionValues() []PrivateIPAddressVersion { type PrivateLinkServiceNetworkPolicies string const ( + // PrivateLinkServiceNetworkPoliciesDisabled - Disable apply network policies on private link service in the subnet. PrivateLinkServiceNetworkPoliciesDisabled PrivateLinkServiceNetworkPolicies = "disabled" - PrivateLinkServiceNetworkPoliciesEnabled PrivateLinkServiceNetworkPolicies = "enabled" + // PrivateLinkServiceNetworkPoliciesEnabled - Enable apply network policies on private link service in the subnet. + PrivateLinkServiceNetworkPoliciesEnabled PrivateLinkServiceNetworkPolicies = "enabled" ) // PossiblePrivateLinkServiceNetworkPoliciesValues returns the possible values for the PrivateLinkServiceNetworkPolicies const type. @@ -483,13 +597,16 @@ func PossiblePrivateLinkServiceNetworkPoliciesValues() []PrivateLinkServiceNetwo } } -// ProbeProtocol - the reference to the load balancer probe used by the load balancing rule. +// ProbeProtocol - The reference to the load balancer probe used by the load balancing rule. type ProbeProtocol string const ( - ProbeProtocolHTTP ProbeProtocol = "http" + // ProbeProtocolHTTP - Probe protocol is HTTP. + ProbeProtocolHTTP ProbeProtocol = "http" + // ProbeProtocolHTTPS - Probe protocol is HTTPS. ProbeProtocolHTTPS ProbeProtocol = "https" - ProbeProtocolTCP ProbeProtocol = "tcp" + // ProbeProtocolTCP - Probe protocol is TCP. + ProbeProtocolTCP ProbeProtocol = "tcp" ) // PossibleProbeProtocolValues returns the possible values for the ProbeProtocol const type. @@ -505,7 +622,9 @@ func PossibleProbeProtocolValues() []ProbeProtocol { type Protocol string const ( + // ProtocolTCP - Transport protocol is TCP. ProtocolTCP Protocol = "tcp" + // ProtocolUDP - Transport protocol is UDP. ProtocolUDP Protocol = "udp" ) @@ -521,7 +640,9 @@ func PossibleProtocolValues() []Protocol { type PublicIPAddressVersion string const ( + // PublicIPAddressVersionIPv4 - The IP configuration's public IP is IPv4. PublicIPAddressVersionIPv4 PublicIPAddressVersion = "IPv4" + // PublicIPAddressVersionIPv6 - The IP configuration's public IP is IPv6. PublicIPAddressVersionIPv6 PublicIPAddressVersion = "IPv6" ) @@ -571,10 +692,32 @@ func PossibleSKUNameValues() []SKUName { } } +// SecurityEncryptionType - Specifies the securityEncryptionType type of the nodeType. Only DiskWithVMGuestState and VMGuestStateOnly +// are currently supported +type SecurityEncryptionType string + +const ( + // SecurityEncryptionTypeDiskWithVMGuestState - For encryption of the managed disk along with VMGuestState blob. + SecurityEncryptionTypeDiskWithVMGuestState SecurityEncryptionType = "DiskWithVMGuestState" + // SecurityEncryptionTypeVMGuestStateOnly - For encryption of just the VMGuestState blob. + SecurityEncryptionTypeVMGuestStateOnly SecurityEncryptionType = "VMGuestStateOnly" +) + +// PossibleSecurityEncryptionTypeValues returns the possible values for the SecurityEncryptionType const type. +func PossibleSecurityEncryptionTypeValues() []SecurityEncryptionType { + return []SecurityEncryptionType{ + SecurityEncryptionTypeDiskWithVMGuestState, + SecurityEncryptionTypeVMGuestStateOnly, + } +} + // SecurityType - Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported type SecurityType string const ( + // SecurityTypeConfidentialVM - ConfidentialVM provides hardware-based encryption, trusted execution environment (TEE) and + // isolation of the VM memory & CPU from host. + SecurityTypeConfidentialVM SecurityType = "ConfidentialVM" // SecurityTypeStandard - Standard is the default security type for all machines. SecurityTypeStandard SecurityType = "Standard" // SecurityTypeTrustedLaunch - Trusted Launch is a security type that secures generation 2 virtual machines. @@ -584,6 +727,7 @@ const ( // PossibleSecurityTypeValues returns the possible values for the SecurityType const type. func PossibleSecurityTypeValues() []SecurityType { return []SecurityType{ + SecurityTypeConfidentialVM, SecurityTypeStandard, SecurityTypeTrustedLaunch, } @@ -631,8 +775,7 @@ func PossibleServiceKindValues() []ServiceKind { } // ServiceLoadMetricWeight - Determines the metric weight relative to the other metrics that are configured for this service. -// During runtime, if two metrics end up in conflict, the Cluster Resource Manager prefers the metric with -// the higher weight. +// During runtime, if two metrics end up in conflict, the Cluster Resource Manager prefers the metric with the higher weight. type ServiceLoadMetricWeight string const ( @@ -749,6 +892,36 @@ func PossibleServiceScalingTriggerKindValues() []ServiceScalingTriggerKind { } } +// SfmcOperationStatus - Sfmc operation status. +type SfmcOperationStatus string + +const ( + // SfmcOperationStatusAborted - Operation aborted. + SfmcOperationStatusAborted SfmcOperationStatus = "Aborted" + // SfmcOperationStatusCanceled - Operation canceled. + SfmcOperationStatusCanceled SfmcOperationStatus = "Canceled" + // SfmcOperationStatusCreated - Operation created. + SfmcOperationStatusCreated SfmcOperationStatus = "Created" + // SfmcOperationStatusFailed - Operation failed. + SfmcOperationStatusFailed SfmcOperationStatus = "Failed" + // SfmcOperationStatusStarted - Operation started. + SfmcOperationStatusStarted SfmcOperationStatus = "Started" + // SfmcOperationStatusSucceeded - Operation succeeded. + SfmcOperationStatusSucceeded SfmcOperationStatus = "Succeeded" +) + +// PossibleSfmcOperationStatusValues returns the possible values for the SfmcOperationStatus const type. +func PossibleSfmcOperationStatusValues() []SfmcOperationStatus { + return []SfmcOperationStatus{ + SfmcOperationStatusAborted, + SfmcOperationStatusCanceled, + SfmcOperationStatusCreated, + SfmcOperationStatusFailed, + SfmcOperationStatusStarted, + SfmcOperationStatusSucceeded, + } +} + // UpdateType - Specifies the way the operation will be performed. type UpdateType string diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applications_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applications_server.go index f57dbfe89751..4f03a14ee2d5 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applications_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applications_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -41,15 +37,15 @@ type ApplicationsServer struct { NewListPager func(resourceGroupName string, clusterName string, options *armservicefabricmanagedclusters.ApplicationsClientListOptions) (resp azfake.PagerResponder[armservicefabricmanagedclusters.ApplicationsClientListResponse]) // BeginReadUpgrade is the fake for method ApplicationsClient.BeginReadUpgrade - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReadUpgrade func(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *armservicefabricmanagedclusters.ApplicationsClientBeginReadUpgradeOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.ApplicationsClientReadUpgradeResponse], errResp azfake.ErrorResponder) // BeginResumeUpgrade is the fake for method ApplicationsClient.BeginResumeUpgrade - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResumeUpgrade func(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters armservicefabricmanagedclusters.RuntimeResumeApplicationUpgradeParameters, options *armservicefabricmanagedclusters.ApplicationsClientBeginResumeUpgradeOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.ApplicationsClientResumeUpgradeResponse], errResp azfake.ErrorResponder) // BeginStartRollback is the fake for method ApplicationsClient.BeginStartRollback - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStartRollback func(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *armservicefabricmanagedclusters.ApplicationsClientBeginStartRollbackOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.ApplicationsClientStartRollbackResponse], errResp azfake.ErrorResponder) // Update is the fake for method ApplicationsClient.Update @@ -92,35 +88,54 @@ func (a *ApplicationsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ApplicationsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "ApplicationsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "ApplicationsClient.Get": - resp, err = a.dispatchGet(req) - case "ApplicationsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "ApplicationsClient.BeginReadUpgrade": - resp, err = a.dispatchBeginReadUpgrade(req) - case "ApplicationsClient.BeginResumeUpgrade": - resp, err = a.dispatchBeginResumeUpgrade(req) - case "ApplicationsClient.BeginStartRollback": - resp, err = a.dispatchBeginStartRollback(req) - case "ApplicationsClient.Update": - resp, err = a.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return a.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (a *ApplicationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if applicationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "ApplicationsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "ApplicationsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ApplicationsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "ApplicationsClient.BeginReadUpgrade": + res.resp, res.err = a.dispatchBeginReadUpgrade(req) + case "ApplicationsClient.BeginResumeUpgrade": + res.resp, res.err = a.dispatchBeginResumeUpgrade(req) + case "ApplicationsClient.BeginStartRollback": + res.resp, res.err = a.dispatchBeginStartRollback(req) + case "ApplicationsClient.Update": + res.resp, res.err = a.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -129,10 +144,10 @@ func (a *ApplicationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Requ } beginCreateOrUpdate := a.beginCreateOrUpdate.get(req) if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ApplicationResource](req) @@ -181,10 +196,10 @@ func (a *ApplicationsServerTransport) dispatchBeginDelete(req *http.Request) (*h } beginDelete := a.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -227,10 +242,10 @@ func (a *ApplicationsServerTransport) dispatchGet(req *http.Request) (*http.Resp if a.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -266,10 +281,10 @@ func (a *ApplicationsServerTransport) dispatchNewListPager(req *http.Request) (* } newListPager := a.newListPager.get(req) if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -310,7 +325,7 @@ func (a *ApplicationsServerTransport) dispatchBeginReadUpgrade(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fetchUpgradeStatus` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -338,9 +353,9 @@ func (a *ApplicationsServerTransport) dispatchBeginReadUpgrade(req *http.Request return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginReadUpgrade.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReadUpgrade) { a.beginReadUpgrade.remove(req) @@ -358,7 +373,7 @@ func (a *ApplicationsServerTransport) dispatchBeginResumeUpgrade(req *http.Reque const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resumeUpgrade` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.RuntimeResumeApplicationUpgradeParameters](req) @@ -390,9 +405,9 @@ func (a *ApplicationsServerTransport) dispatchBeginResumeUpgrade(req *http.Reque return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginResumeUpgrade.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResumeUpgrade) { a.beginResumeUpgrade.remove(req) @@ -410,7 +425,7 @@ func (a *ApplicationsServerTransport) dispatchBeginStartRollback(req *http.Reque const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startRollback` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -438,9 +453,9 @@ func (a *ApplicationsServerTransport) dispatchBeginStartRollback(req *http.Reque return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginStartRollback.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStartRollback) { a.beginStartRollback.remove(req) @@ -453,10 +468,10 @@ func (a *ApplicationsServerTransport) dispatchUpdate(req *http.Request) (*http.R if a.srv.Update == nil { return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ApplicationUpdateParameters](req) @@ -489,3 +504,9 @@ func (a *ApplicationsServerTransport) dispatchUpdate(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationsServerTransport +var applicationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applicationtypes_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applicationtypes_server.go index 5edbe1814c4f..667411def940 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applicationtypes_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applicationtypes_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -72,39 +68,58 @@ func (a *ApplicationTypesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationTypesClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "ApplicationTypesClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "ApplicationTypesClient.Get": - resp, err = a.dispatchGet(req) - case "ApplicationTypesClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "ApplicationTypesClient.Update": - resp, err = a.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationTypesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationTypesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationTypesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationTypesClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "ApplicationTypesClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "ApplicationTypesClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ApplicationTypesClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "ApplicationTypesClient.Update": + res.resp, res.err = a.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationTypesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { if a.srv.CreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ApplicationTypeResource](req) @@ -144,10 +159,10 @@ func (a *ApplicationTypesServerTransport) dispatchBeginDelete(req *http.Request) } beginDelete := a.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -190,10 +205,10 @@ func (a *ApplicationTypesServerTransport) dispatchGet(req *http.Request) (*http. if a.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -229,10 +244,10 @@ func (a *ApplicationTypesServerTransport) dispatchNewListPager(req *http.Request } newListPager := a.newListPager.get(req) if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -268,10 +283,10 @@ func (a *ApplicationTypesServerTransport) dispatchUpdate(req *http.Request) (*ht if a.srv.Update == nil { return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ApplicationTypeUpdateParameters](req) @@ -304,3 +319,9 @@ func (a *ApplicationTypesServerTransport) dispatchUpdate(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationTypesServerTransport +var applicationTypesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applicationtypeversions_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applicationtypeversions_server.go index 05765c854fd7..d16ef94f5f41 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applicationtypeversions_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/applicationtypeversions_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -74,29 +70,48 @@ func (a *ApplicationTypeVersionsServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationTypeVersionsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "ApplicationTypeVersionsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "ApplicationTypeVersionsClient.Get": - resp, err = a.dispatchGet(req) - case "ApplicationTypeVersionsClient.NewListByApplicationTypesPager": - resp, err = a.dispatchNewListByApplicationTypesPager(req) - case "ApplicationTypeVersionsClient.Update": - resp, err = a.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationTypeVersionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationTypeVersionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationTypeVersionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationTypeVersionsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "ApplicationTypeVersionsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "ApplicationTypeVersionsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ApplicationTypeVersionsClient.NewListByApplicationTypesPager": + res.resp, res.err = a.dispatchNewListByApplicationTypesPager(req) + case "ApplicationTypeVersionsClient.Update": + res.resp, res.err = a.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationTypeVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -105,10 +120,10 @@ func (a *ApplicationTypeVersionsServerTransport) dispatchBeginCreateOrUpdate(req } beginCreateOrUpdate := a.beginCreateOrUpdate.get(req) if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ApplicationTypeVersionResource](req) @@ -161,10 +176,10 @@ func (a *ApplicationTypeVersionsServerTransport) dispatchBeginDelete(req *http.R } beginDelete := a.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -211,10 +226,10 @@ func (a *ApplicationTypeVersionsServerTransport) dispatchGet(req *http.Request) if a.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -254,10 +269,10 @@ func (a *ApplicationTypeVersionsServerTransport) dispatchNewListByApplicationTyp } newListByApplicationTypesPager := a.newListByApplicationTypesPager.get(req) if newListByApplicationTypesPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -297,10 +312,10 @@ func (a *ApplicationTypeVersionsServerTransport) dispatchUpdate(req *http.Reques if a.srv.Update == nil { return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ApplicationTypeVersionUpdateParameters](req) @@ -337,3 +352,9 @@ func (a *ApplicationTypeVersionsServerTransport) dispatchUpdate(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationTypeVersionsServerTransport +var applicationTypeVersionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/internal.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/internal.go index be04ff43d678..d9c359c154c2 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/internal.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/internal.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -14,6 +10,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedapplymaintenancewindow_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedapplymaintenancewindow_server.go index 84c54c16be19..621c3c6e3137 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedapplymaintenancewindow_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedapplymaintenancewindow_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -49,21 +45,40 @@ func (m *ManagedApplyMaintenanceWindowServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedApplyMaintenanceWindowClient.Post": - resp, err = m.dispatchPost(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedApplyMaintenanceWindowServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedApplyMaintenanceWindowServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedApplyMaintenanceWindowServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedApplyMaintenanceWindowClient.Post": + res.resp, res.err = m.dispatchPost(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedApplyMaintenanceWindowServerTransport) dispatchPost(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (m *ManagedApplyMaintenanceWindowServerTransport) dispatchPost(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applyMaintenanceWindow` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -98,3 +113,9 @@ func (m *ManagedApplyMaintenanceWindowServerTransport) dispatchPost(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedApplyMaintenanceWindowServerTransport +var managedApplyMaintenanceWindowServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedazresiliencystatus_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedazresiliencystatus_server.go index c612b0a6c7d3..28d502b20dd5 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedazresiliencystatus_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedazresiliencystatus_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -49,21 +45,40 @@ func (m *ManagedAzResiliencyStatusServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedAzResiliencyStatusClient.Get": - resp, err = m.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedAzResiliencyStatusServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedAzResiliencyStatusServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedAzResiliencyStatusServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedAzResiliencyStatusClient.Get": + res.resp, res.err = m.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedAzResiliencyStatusServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (m *ManagedAzResiliencyStatusServerTransport) dispatchGet(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getazresiliencystatus` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -98,3 +113,9 @@ func (m *ManagedAzResiliencyStatusServerTransport) dispatchGet(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedAzResiliencyStatusServerTransport +var managedAzResiliencyStatusServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedclusters_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedclusters_server.go index e5f05d6b122c..188ccdcf92e3 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedclusters_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedclusters_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -36,6 +32,10 @@ type ManagedClustersServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, clusterName string, options *armservicefabricmanagedclusters.ManagedClustersClientGetOptions) (resp azfake.Responder[armservicefabricmanagedclusters.ManagedClustersClientGetResponse], errResp azfake.ErrorResponder) + // GetFaultSimulation is the fake for method ManagedClustersClient.GetFaultSimulation + // HTTP status codes to indicate success: http.StatusOK + GetFaultSimulation func(ctx context.Context, resourceGroupName string, clusterName string, parameters armservicefabricmanagedclusters.FaultSimulationIDContent, options *armservicefabricmanagedclusters.ManagedClustersClientGetFaultSimulationOptions) (resp azfake.Responder[armservicefabricmanagedclusters.ManagedClustersClientGetFaultSimulationResponse], errResp azfake.ErrorResponder) + // NewListByResourceGroupPager is the fake for method ManagedClustersClient.NewListByResourceGroupPager // HTTP status codes to indicate success: http.StatusOK NewListByResourceGroupPager func(resourceGroupName string, options *armservicefabricmanagedclusters.ManagedClustersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListByResourceGroupResponse]) @@ -44,6 +44,18 @@ type ManagedClustersServer struct { // HTTP status codes to indicate success: http.StatusOK NewListBySubscriptionPager func(options *armservicefabricmanagedclusters.ManagedClustersClientListBySubscriptionOptions) (resp azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListBySubscriptionResponse]) + // NewListFaultSimulationPager is the fake for method ManagedClustersClient.NewListFaultSimulationPager + // HTTP status codes to indicate success: http.StatusOK + NewListFaultSimulationPager func(resourceGroupName string, clusterName string, options *armservicefabricmanagedclusters.ManagedClustersClientListFaultSimulationOptions) (resp azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListFaultSimulationResponse]) + + // BeginStartFaultSimulation is the fake for method ManagedClustersClient.BeginStartFaultSimulation + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStartFaultSimulation func(ctx context.Context, resourceGroupName string, clusterName string, parameters armservicefabricmanagedclusters.FaultSimulationContentWrapper, options *armservicefabricmanagedclusters.ManagedClustersClientBeginStartFaultSimulationOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.ManagedClustersClientStartFaultSimulationResponse], errResp azfake.ErrorResponder) + + // BeginStopFaultSimulation is the fake for method ManagedClustersClient.BeginStopFaultSimulation + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStopFaultSimulation func(ctx context.Context, resourceGroupName string, clusterName string, parameters armservicefabricmanagedclusters.FaultSimulationIDContent, options *armservicefabricmanagedclusters.ManagedClustersClientBeginStopFaultSimulationOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.ManagedClustersClientStopFaultSimulationResponse], errResp azfake.ErrorResponder) + // Update is the fake for method ManagedClustersClient.Update // HTTP status codes to indicate success: http.StatusOK Update func(ctx context.Context, resourceGroupName string, clusterName string, parameters armservicefabricmanagedclusters.ManagedClusterUpdateParameters, options *armservicefabricmanagedclusters.ManagedClustersClientUpdateOptions) (resp azfake.Responder[armservicefabricmanagedclusters.ManagedClustersClientUpdateResponse], errResp azfake.ErrorResponder) @@ -59,6 +71,9 @@ func NewManagedClustersServerTransport(srv *ManagedClustersServer) *ManagedClust beginDelete: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.ManagedClustersClientDeleteResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListByResourceGroupResponse]](), newListBySubscriptionPager: newTracker[azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListBySubscriptionResponse]](), + newListFaultSimulationPager: newTracker[azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListFaultSimulationResponse]](), + beginStartFaultSimulation: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.ManagedClustersClientStartFaultSimulationResponse]](), + beginStopFaultSimulation: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.ManagedClustersClientStopFaultSimulationResponse]](), } } @@ -70,6 +85,9 @@ type ManagedClustersServerTransport struct { beginDelete *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.ManagedClustersClientDeleteResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListByResourceGroupResponse]] newListBySubscriptionPager *tracker[azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListBySubscriptionResponse]] + newListFaultSimulationPager *tracker[azfake.PagerResponder[armservicefabricmanagedclusters.ManagedClustersClientListFaultSimulationResponse]] + beginStartFaultSimulation *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.ManagedClustersClientStartFaultSimulationResponse]] + beginStopFaultSimulation *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.ManagedClustersClientStopFaultSimulationResponse]] } // Do implements the policy.Transporter interface for ManagedClustersServerTransport. @@ -80,31 +98,58 @@ func (m *ManagedClustersServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedClustersClient.BeginCreateOrUpdate": - resp, err = m.dispatchBeginCreateOrUpdate(req) - case "ManagedClustersClient.BeginDelete": - resp, err = m.dispatchBeginDelete(req) - case "ManagedClustersClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedClustersClient.NewListByResourceGroupPager": - resp, err = m.dispatchNewListByResourceGroupPager(req) - case "ManagedClustersClient.NewListBySubscriptionPager": - resp, err = m.dispatchNewListBySubscriptionPager(req) - case "ManagedClustersClient.Update": - resp, err = m.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedClustersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedClustersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedClustersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedClustersClient.BeginCreateOrUpdate": + res.resp, res.err = m.dispatchBeginCreateOrUpdate(req) + case "ManagedClustersClient.BeginDelete": + res.resp, res.err = m.dispatchBeginDelete(req) + case "ManagedClustersClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagedClustersClient.GetFaultSimulation": + res.resp, res.err = m.dispatchGetFaultSimulation(req) + case "ManagedClustersClient.NewListByResourceGroupPager": + res.resp, res.err = m.dispatchNewListByResourceGroupPager(req) + case "ManagedClustersClient.NewListBySubscriptionPager": + res.resp, res.err = m.dispatchNewListBySubscriptionPager(req) + case "ManagedClustersClient.NewListFaultSimulationPager": + res.resp, res.err = m.dispatchNewListFaultSimulationPager(req) + case "ManagedClustersClient.BeginStartFaultSimulation": + res.resp, res.err = m.dispatchBeginStartFaultSimulation(req) + case "ManagedClustersClient.BeginStopFaultSimulation": + res.resp, res.err = m.dispatchBeginStopFaultSimulation(req) + case "ManagedClustersClient.Update": + res.resp, res.err = m.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -116,7 +161,7 @@ func (m *ManagedClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ManagedCluster](req) @@ -164,7 +209,7 @@ func (m *ManagedClustersServerTransport) dispatchBeginDelete(req *http.Request) const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -206,7 +251,7 @@ func (m *ManagedClustersServerTransport) dispatchGet(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -232,6 +277,43 @@ func (m *ManagedClustersServerTransport) dispatchGet(req *http.Request) (*http.R return resp, nil } +func (m *ManagedClustersServerTransport) dispatchGetFaultSimulation(req *http.Request) (*http.Response, error) { + if m.srv.GetFaultSimulation == nil { + return nil, &nonRetriableError{errors.New("fake for method GetFaultSimulation not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getFaultSimulation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.FaultSimulationIDContent](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.GetFaultSimulation(req.Context(), resourceGroupNameParam, clusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FaultSimulation, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (m *ManagedClustersServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { if m.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} @@ -241,7 +323,7 @@ func (m *ManagedClustersServerTransport) dispatchNewListByResourceGroupPager(req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -278,7 +360,7 @@ func (m *ManagedClustersServerTransport) dispatchNewListBySubscriptionPager(req const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { + if len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := m.srv.NewListBySubscriptionPager(nil) @@ -302,6 +384,143 @@ func (m *ManagedClustersServerTransport) dispatchNewListBySubscriptionPager(req return resp, nil } +func (m *ManagedClustersServerTransport) dispatchNewListFaultSimulationPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListFaultSimulationPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListFaultSimulationPager not implemented")} + } + newListFaultSimulationPager := m.newListFaultSimulationPager.get(req) + if newListFaultSimulationPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listFaultSimulation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListFaultSimulationPager(resourceGroupNameParam, clusterNameParam, nil) + newListFaultSimulationPager = &resp + m.newListFaultSimulationPager.add(req, newListFaultSimulationPager) + server.PagerResponderInjectNextLinks(newListFaultSimulationPager, req, func(page *armservicefabricmanagedclusters.ManagedClustersClientListFaultSimulationResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListFaultSimulationPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListFaultSimulationPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListFaultSimulationPager) { + m.newListFaultSimulationPager.remove(req) + } + return resp, nil +} + +func (m *ManagedClustersServerTransport) dispatchBeginStartFaultSimulation(req *http.Request) (*http.Response, error) { + if m.srv.BeginStartFaultSimulation == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStartFaultSimulation not implemented")} + } + beginStartFaultSimulation := m.beginStartFaultSimulation.get(req) + if beginStartFaultSimulation == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startFaultSimulation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.FaultSimulationContentWrapper](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginStartFaultSimulation(req.Context(), resourceGroupNameParam, clusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStartFaultSimulation = &respr + m.beginStartFaultSimulation.add(req, beginStartFaultSimulation) + } + + resp, err := server.PollerResponderNext(beginStartFaultSimulation, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + m.beginStartFaultSimulation.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStartFaultSimulation) { + m.beginStartFaultSimulation.remove(req) + } + + return resp, nil +} + +func (m *ManagedClustersServerTransport) dispatchBeginStopFaultSimulation(req *http.Request) (*http.Response, error) { + if m.srv.BeginStopFaultSimulation == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStopFaultSimulation not implemented")} + } + beginStopFaultSimulation := m.beginStopFaultSimulation.get(req) + if beginStopFaultSimulation == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stopFaultSimulation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.FaultSimulationIDContent](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginStopFaultSimulation(req.Context(), resourceGroupNameParam, clusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStopFaultSimulation = &respr + m.beginStopFaultSimulation.add(req, beginStopFaultSimulation) + } + + resp, err := server.PollerResponderNext(beginStopFaultSimulation, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + m.beginStopFaultSimulation.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStopFaultSimulation) { + m.beginStopFaultSimulation.remove(req) + } + + return resp, nil +} + func (m *ManagedClustersServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { if m.srv.Update == nil { return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} @@ -309,7 +528,7 @@ func (m *ManagedClustersServerTransport) dispatchUpdate(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ManagedClusterUpdateParameters](req) @@ -338,3 +557,9 @@ func (m *ManagedClustersServerTransport) dispatchUpdate(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedClustersServerTransport +var managedClustersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedclusterversion_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedclusterversion_server.go index 4cf1d0702dec..58dc56e2478f 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedclusterversion_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedclusterversion_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -61,27 +57,46 @@ func (m *ManagedClusterVersionServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedClusterVersionClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedClusterVersionClient.GetByEnvironment": - resp, err = m.dispatchGetByEnvironment(req) - case "ManagedClusterVersionClient.List": - resp, err = m.dispatchList(req) - case "ManagedClusterVersionClient.ListByEnvironment": - resp, err = m.dispatchListByEnvironment(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedClusterVersionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedClusterVersionServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedClusterVersionServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedClusterVersionClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagedClusterVersionClient.GetByEnvironment": + res.resp, res.err = m.dispatchGetByEnvironment(req) + case "ManagedClusterVersionClient.List": + res.resp, res.err = m.dispatchList(req) + case "ManagedClusterVersionClient.ListByEnvironment": + res.resp, res.err = m.dispatchListByEnvironment(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedClusterVersionServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -91,7 +106,7 @@ func (m *ManagedClusterVersionServerTransport) dispatchGet(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedClusterVersions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) @@ -124,7 +139,7 @@ func (m *ManagedClusterVersionServerTransport) dispatchGetByEnvironment(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedClusterVersions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) @@ -167,7 +182,7 @@ func (m *ManagedClusterVersionServerTransport) dispatchList(req *http.Request) ( const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedClusterVersions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) @@ -196,7 +211,7 @@ func (m *ManagedClusterVersionServerTransport) dispatchListByEnvironment(req *ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/environments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedClusterVersions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) @@ -227,3 +242,9 @@ func (m *ManagedClusterVersionServerTransport) dispatchListByEnvironment(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedClusterVersionServerTransport +var managedClusterVersionServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedmaintenancewindowstatus_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedmaintenancewindowstatus_server.go index 60457ae14cee..2747b2a69348 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedmaintenancewindowstatus_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedmaintenancewindowstatus_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -49,21 +45,40 @@ func (m *ManagedMaintenanceWindowStatusServerTransport) Do(req *http.Request) (* return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedMaintenanceWindowStatusClient.Get": - resp, err = m.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedMaintenanceWindowStatusServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedMaintenanceWindowStatusServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedMaintenanceWindowStatusServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedMaintenanceWindowStatusClient.Get": + res.resp, res.err = m.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedMaintenanceWindowStatusServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (m *ManagedMaintenanceWindowStatusServerTransport) dispatchGet(req *http.Re const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getMaintenanceWindowStatus` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -98,3 +113,9 @@ func (m *ManagedMaintenanceWindowStatusServerTransport) dispatchGet(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedMaintenanceWindowStatusServerTransport +var managedMaintenanceWindowStatusServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedunsupportedvmsizes_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedunsupportedvmsizes_server.go index 5ac75079510a..f917fdc5bc47 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedunsupportedvmsizes_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/managedunsupportedvmsizes_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -58,23 +54,42 @@ func (m *ManagedUnsupportedVMSizesServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedUnsupportedVMSizesClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedUnsupportedVMSizesClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedUnsupportedVMSizesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedUnsupportedVMSizesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedUnsupportedVMSizesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedUnsupportedVMSizesClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagedUnsupportedVMSizesClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedUnsupportedVMSizesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -84,7 +99,7 @@ func (m *ManagedUnsupportedVMSizesServerTransport) dispatchGet(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedUnsupportedVMSizes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) @@ -119,7 +134,7 @@ func (m *ManagedUnsupportedVMSizesServerTransport) dispatchNewListPager(req *htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedUnsupportedVMSizes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { + if len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) @@ -146,3 +161,9 @@ func (m *ManagedUnsupportedVMSizesServerTransport) dispatchNewListPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedUnsupportedVMSizesServerTransport +var managedUnsupportedVMSizesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/nodetypes_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/nodetypes_server.go index 99fa95cd2aed..2eb3830d97e2 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/nodetypes_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/nodetypes_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -28,30 +24,58 @@ type NodeTypesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.NodeType, options *armservicefabricmanagedclusters.NodeTypesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + // BeginDeallocate is the fake for method NodeTypesClient.BeginDeallocate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDeallocate func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.NodeTypeActionParameters, options *armservicefabricmanagedclusters.NodeTypesClientBeginDeallocateOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeallocateResponse], errResp azfake.ErrorResponder) + // BeginDelete is the fake for method NodeTypesClient.BeginDelete // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, options *armservicefabricmanagedclusters.NodeTypesClientBeginDeleteOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDeleteNode is the fake for method NodeTypesClient.BeginDeleteNode - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteNode func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.NodeTypeActionParameters, options *armservicefabricmanagedclusters.NodeTypesClientBeginDeleteNodeOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeleteNodeResponse], errResp azfake.ErrorResponder) // Get is the fake for method NodeTypesClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, options *armservicefabricmanagedclusters.NodeTypesClientGetOptions) (resp azfake.Responder[armservicefabricmanagedclusters.NodeTypesClientGetResponse], errResp azfake.ErrorResponder) + // GetFaultSimulation is the fake for method NodeTypesClient.GetFaultSimulation + // HTTP status codes to indicate success: http.StatusOK + GetFaultSimulation func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.FaultSimulationIDContent, options *armservicefabricmanagedclusters.NodeTypesClientGetFaultSimulationOptions) (resp azfake.Responder[armservicefabricmanagedclusters.NodeTypesClientGetFaultSimulationResponse], errResp azfake.ErrorResponder) + // NewListByManagedClustersPager is the fake for method NodeTypesClient.NewListByManagedClustersPager // HTTP status codes to indicate success: http.StatusOK NewListByManagedClustersPager func(resourceGroupName string, clusterName string, options *armservicefabricmanagedclusters.NodeTypesClientListByManagedClustersOptions) (resp azfake.PagerResponder[armservicefabricmanagedclusters.NodeTypesClientListByManagedClustersResponse]) + // NewListFaultSimulationPager is the fake for method NodeTypesClient.NewListFaultSimulationPager + // HTTP status codes to indicate success: http.StatusOK + NewListFaultSimulationPager func(resourceGroupName string, clusterName string, nodeTypeName string, options *armservicefabricmanagedclusters.NodeTypesClientListFaultSimulationOptions) (resp azfake.PagerResponder[armservicefabricmanagedclusters.NodeTypesClientListFaultSimulationResponse]) + + // BeginRedeploy is the fake for method NodeTypesClient.BeginRedeploy + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginRedeploy func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.NodeTypeActionParameters, options *armservicefabricmanagedclusters.NodeTypesClientBeginRedeployOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientRedeployResponse], errResp azfake.ErrorResponder) + // BeginReimage is the fake for method NodeTypesClient.BeginReimage - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReimage func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.NodeTypeActionParameters, options *armservicefabricmanagedclusters.NodeTypesClientBeginReimageOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientReimageResponse], errResp azfake.ErrorResponder) // BeginRestart is the fake for method NodeTypesClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.NodeTypeActionParameters, options *armservicefabricmanagedclusters.NodeTypesClientBeginRestartOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientRestartResponse], errResp azfake.ErrorResponder) + // BeginStart is the fake for method NodeTypesClient.BeginStart + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginStart func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.NodeTypeActionParameters, options *armservicefabricmanagedclusters.NodeTypesClientBeginStartOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStartResponse], errResp azfake.ErrorResponder) + + // BeginStartFaultSimulation is the fake for method NodeTypesClient.BeginStartFaultSimulation + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStartFaultSimulation func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.FaultSimulationContentWrapper, options *armservicefabricmanagedclusters.NodeTypesClientBeginStartFaultSimulationOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStartFaultSimulationResponse], errResp azfake.ErrorResponder) + + // BeginStopFaultSimulation is the fake for method NodeTypesClient.BeginStopFaultSimulation + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginStopFaultSimulation func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.FaultSimulationIDContent, options *armservicefabricmanagedclusters.NodeTypesClientBeginStopFaultSimulationOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStopFaultSimulationResponse], errResp azfake.ErrorResponder) + // BeginUpdate is the fake for method NodeTypesClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdate func(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters armservicefabricmanagedclusters.NodeTypeUpdateParameters, options *armservicefabricmanagedclusters.NodeTypesClientBeginUpdateOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientUpdateResponse], errResp azfake.ErrorResponder) @@ -64,11 +88,17 @@ func NewNodeTypesServerTransport(srv *NodeTypesServer) *NodeTypesServerTransport return &NodeTypesServerTransport{ srv: srv, beginCreateOrUpdate: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse]](), + beginDeallocate: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeallocateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeleteResponse]](), beginDeleteNode: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeleteNodeResponse]](), newListByManagedClustersPager: newTracker[azfake.PagerResponder[armservicefabricmanagedclusters.NodeTypesClientListByManagedClustersResponse]](), + newListFaultSimulationPager: newTracker[azfake.PagerResponder[armservicefabricmanagedclusters.NodeTypesClientListFaultSimulationResponse]](), + beginRedeploy: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientRedeployResponse]](), beginReimage: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientReimageResponse]](), beginRestart: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientRestartResponse]](), + beginStart: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStartResponse]](), + beginStartFaultSimulation: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStartFaultSimulationResponse]](), + beginStopFaultSimulation: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStopFaultSimulationResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientUpdateResponse]](), } } @@ -78,11 +108,17 @@ func NewNodeTypesServerTransport(srv *NodeTypesServer) *NodeTypesServerTransport type NodeTypesServerTransport struct { srv *NodeTypesServer beginCreateOrUpdate *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse]] + beginDeallocate *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeallocateResponse]] beginDelete *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeleteResponse]] beginDeleteNode *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientDeleteNodeResponse]] newListByManagedClustersPager *tracker[azfake.PagerResponder[armservicefabricmanagedclusters.NodeTypesClientListByManagedClustersResponse]] + newListFaultSimulationPager *tracker[azfake.PagerResponder[armservicefabricmanagedclusters.NodeTypesClientListFaultSimulationResponse]] + beginRedeploy *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientRedeployResponse]] beginReimage *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientReimageResponse]] beginRestart *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientRestartResponse]] + beginStart *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStartResponse]] + beginStartFaultSimulation *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStartFaultSimulationResponse]] + beginStopFaultSimulation *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientStopFaultSimulationResponse]] beginUpdate *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.NodeTypesClientUpdateResponse]] } @@ -94,35 +130,68 @@ func (n *NodeTypesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "NodeTypesClient.BeginCreateOrUpdate": - resp, err = n.dispatchBeginCreateOrUpdate(req) - case "NodeTypesClient.BeginDelete": - resp, err = n.dispatchBeginDelete(req) - case "NodeTypesClient.BeginDeleteNode": - resp, err = n.dispatchBeginDeleteNode(req) - case "NodeTypesClient.Get": - resp, err = n.dispatchGet(req) - case "NodeTypesClient.NewListByManagedClustersPager": - resp, err = n.dispatchNewListByManagedClustersPager(req) - case "NodeTypesClient.BeginReimage": - resp, err = n.dispatchBeginReimage(req) - case "NodeTypesClient.BeginRestart": - resp, err = n.dispatchBeginRestart(req) - case "NodeTypesClient.BeginUpdate": - resp, err = n.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return n.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (n *NodeTypesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if nodeTypesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = nodeTypesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NodeTypesClient.BeginCreateOrUpdate": + res.resp, res.err = n.dispatchBeginCreateOrUpdate(req) + case "NodeTypesClient.BeginDeallocate": + res.resp, res.err = n.dispatchBeginDeallocate(req) + case "NodeTypesClient.BeginDelete": + res.resp, res.err = n.dispatchBeginDelete(req) + case "NodeTypesClient.BeginDeleteNode": + res.resp, res.err = n.dispatchBeginDeleteNode(req) + case "NodeTypesClient.Get": + res.resp, res.err = n.dispatchGet(req) + case "NodeTypesClient.GetFaultSimulation": + res.resp, res.err = n.dispatchGetFaultSimulation(req) + case "NodeTypesClient.NewListByManagedClustersPager": + res.resp, res.err = n.dispatchNewListByManagedClustersPager(req) + case "NodeTypesClient.NewListFaultSimulationPager": + res.resp, res.err = n.dispatchNewListFaultSimulationPager(req) + case "NodeTypesClient.BeginRedeploy": + res.resp, res.err = n.dispatchBeginRedeploy(req) + case "NodeTypesClient.BeginReimage": + res.resp, res.err = n.dispatchBeginReimage(req) + case "NodeTypesClient.BeginRestart": + res.resp, res.err = n.dispatchBeginRestart(req) + case "NodeTypesClient.BeginStart": + res.resp, res.err = n.dispatchBeginStart(req) + case "NodeTypesClient.BeginStartFaultSimulation": + res.resp, res.err = n.dispatchBeginStartFaultSimulation(req) + case "NodeTypesClient.BeginStopFaultSimulation": + res.resp, res.err = n.dispatchBeginStopFaultSimulation(req) + case "NodeTypesClient.BeginUpdate": + res.resp, res.err = n.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (n *NodeTypesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -134,7 +203,7 @@ func (n *NodeTypesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.NodeType](req) @@ -177,6 +246,58 @@ func (n *NodeTypesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request return resp, nil } +func (n *NodeTypesServerTransport) dispatchBeginDeallocate(req *http.Request) (*http.Response, error) { + if n.srv.BeginDeallocate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDeallocate not implemented")} + } + beginDeallocate := n.beginDeallocate.get(req) + if beginDeallocate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deallocate` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.NodeTypeActionParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + nodeTypeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nodeTypeName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginDeallocate(req.Context(), resourceGroupNameParam, clusterNameParam, nodeTypeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDeallocate = &respr + n.beginDeallocate.add(req, beginDeallocate) + } + + resp, err := server.PollerResponderNext(beginDeallocate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + n.beginDeallocate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDeallocate) { + n.beginDeallocate.remove(req) + } + + return resp, nil +} + func (n *NodeTypesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { if n.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} @@ -186,7 +307,7 @@ func (n *NodeTypesServerTransport) dispatchBeginDelete(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -234,7 +355,7 @@ func (n *NodeTypesServerTransport) dispatchBeginDeleteNode(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deleteNode` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.NodeTypeActionParameters](req) @@ -266,9 +387,9 @@ func (n *NodeTypesServerTransport) dispatchBeginDeleteNode(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { n.beginDeleteNode.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteNode) { n.beginDeleteNode.remove(req) @@ -284,7 +405,7 @@ func (n *NodeTypesServerTransport) dispatchGet(req *http.Request) (*http.Respons const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -314,6 +435,47 @@ func (n *NodeTypesServerTransport) dispatchGet(req *http.Request) (*http.Respons return resp, nil } +func (n *NodeTypesServerTransport) dispatchGetFaultSimulation(req *http.Request) (*http.Response, error) { + if n.srv.GetFaultSimulation == nil { + return nil, &nonRetriableError{errors.New("fake for method GetFaultSimulation not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getFaultSimulation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.FaultSimulationIDContent](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + nodeTypeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nodeTypeName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.GetFaultSimulation(req.Context(), resourceGroupNameParam, clusterNameParam, nodeTypeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).FaultSimulation, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (n *NodeTypesServerTransport) dispatchNewListByManagedClustersPager(req *http.Request) (*http.Response, error) { if n.srv.NewListByManagedClustersPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByManagedClustersPager not implemented")} @@ -323,7 +485,7 @@ func (n *NodeTypesServerTransport) dispatchNewListByManagedClustersPager(req *ht const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -355,6 +517,103 @@ func (n *NodeTypesServerTransport) dispatchNewListByManagedClustersPager(req *ht return resp, nil } +func (n *NodeTypesServerTransport) dispatchNewListFaultSimulationPager(req *http.Request) (*http.Response, error) { + if n.srv.NewListFaultSimulationPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListFaultSimulationPager not implemented")} + } + newListFaultSimulationPager := n.newListFaultSimulationPager.get(req) + if newListFaultSimulationPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listFaultSimulation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + nodeTypeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nodeTypeName")]) + if err != nil { + return nil, err + } + resp := n.srv.NewListFaultSimulationPager(resourceGroupNameParam, clusterNameParam, nodeTypeNameParam, nil) + newListFaultSimulationPager = &resp + n.newListFaultSimulationPager.add(req, newListFaultSimulationPager) + server.PagerResponderInjectNextLinks(newListFaultSimulationPager, req, func(page *armservicefabricmanagedclusters.NodeTypesClientListFaultSimulationResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListFaultSimulationPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + n.newListFaultSimulationPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListFaultSimulationPager) { + n.newListFaultSimulationPager.remove(req) + } + return resp, nil +} + +func (n *NodeTypesServerTransport) dispatchBeginRedeploy(req *http.Request) (*http.Response, error) { + if n.srv.BeginRedeploy == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRedeploy not implemented")} + } + beginRedeploy := n.beginRedeploy.get(req) + if beginRedeploy == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/redeploy` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.NodeTypeActionParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + nodeTypeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nodeTypeName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginRedeploy(req.Context(), resourceGroupNameParam, clusterNameParam, nodeTypeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRedeploy = &respr + n.beginRedeploy.add(req, beginRedeploy) + } + + resp, err := server.PollerResponderNext(beginRedeploy, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + n.beginRedeploy.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRedeploy) { + n.beginRedeploy.remove(req) + } + + return resp, nil +} + func (n *NodeTypesServerTransport) dispatchBeginReimage(req *http.Request) (*http.Response, error) { if n.srv.BeginReimage == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReimage not implemented")} @@ -364,7 +623,7 @@ func (n *NodeTypesServerTransport) dispatchBeginReimage(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimage` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.NodeTypeActionParameters](req) @@ -396,9 +655,9 @@ func (n *NodeTypesServerTransport) dispatchBeginReimage(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { n.beginReimage.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReimage) { n.beginReimage.remove(req) @@ -416,7 +675,7 @@ func (n *NodeTypesServerTransport) dispatchBeginRestart(req *http.Request) (*htt const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.NodeTypeActionParameters](req) @@ -448,9 +707,9 @@ func (n *NodeTypesServerTransport) dispatchBeginRestart(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { n.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { n.beginRestart.remove(req) @@ -459,6 +718,162 @@ func (n *NodeTypesServerTransport) dispatchBeginRestart(req *http.Request) (*htt return resp, nil } +func (n *NodeTypesServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { + if n.srv.BeginStart == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} + } + beginStart := n.beginStart.get(req) + if beginStart == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.NodeTypeActionParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + nodeTypeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nodeTypeName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginStart(req.Context(), resourceGroupNameParam, clusterNameParam, nodeTypeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStart = &respr + n.beginStart.add(req, beginStart) + } + + resp, err := server.PollerResponderNext(beginStart, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + n.beginStart.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStart) { + n.beginStart.remove(req) + } + + return resp, nil +} + +func (n *NodeTypesServerTransport) dispatchBeginStartFaultSimulation(req *http.Request) (*http.Response, error) { + if n.srv.BeginStartFaultSimulation == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStartFaultSimulation not implemented")} + } + beginStartFaultSimulation := n.beginStartFaultSimulation.get(req) + if beginStartFaultSimulation == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startFaultSimulation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.FaultSimulationContentWrapper](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + nodeTypeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nodeTypeName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginStartFaultSimulation(req.Context(), resourceGroupNameParam, clusterNameParam, nodeTypeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStartFaultSimulation = &respr + n.beginStartFaultSimulation.add(req, beginStartFaultSimulation) + } + + resp, err := server.PollerResponderNext(beginStartFaultSimulation, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + n.beginStartFaultSimulation.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStartFaultSimulation) { + n.beginStartFaultSimulation.remove(req) + } + + return resp, nil +} + +func (n *NodeTypesServerTransport) dispatchBeginStopFaultSimulation(req *http.Request) (*http.Response, error) { + if n.srv.BeginStopFaultSimulation == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStopFaultSimulation not implemented")} + } + beginStopFaultSimulation := n.beginStopFaultSimulation.get(req) + if beginStopFaultSimulation == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/stopFaultSimulation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.FaultSimulationIDContent](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + nodeTypeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nodeTypeName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginStopFaultSimulation(req.Context(), resourceGroupNameParam, clusterNameParam, nodeTypeNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStopFaultSimulation = &respr + n.beginStopFaultSimulation.add(req, beginStopFaultSimulation) + } + + resp, err := server.PollerResponderNext(beginStopFaultSimulation, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + n.beginStopFaultSimulation.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStopFaultSimulation) { + n.beginStopFaultSimulation.remove(req) + } + + return resp, nil +} + func (n *NodeTypesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { if n.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} @@ -468,7 +883,7 @@ func (n *NodeTypesServerTransport) dispatchBeginUpdate(req *http.Request) (*http const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.NodeTypeUpdateParameters](req) @@ -510,3 +925,9 @@ func (n *NodeTypesServerTransport) dispatchBeginUpdate(req *http.Request) (*http return resp, nil } + +// set this to conditionally intercept incoming requests to NodeTypesServerTransport +var nodeTypesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/nodetypeskus_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/nodetypeskus_server.go index 004ad4b5cd83..5e35abbf943b 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/nodetypeskus_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/nodetypeskus_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -53,21 +49,40 @@ func (n *NodeTypeSKUsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return n.dispatchToMethodFake(req, method) +} - switch method { - case "NodeTypeSKUsClient.NewListPager": - resp, err = n.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (n *NodeTypeSKUsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if nodeTypeSkUsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = nodeTypeSkUsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NodeTypeSKUsClient.NewListPager": + res.resp, res.err = n.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (n *NodeTypeSKUsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -79,7 +94,7 @@ func (n *NodeTypeSKUsServerTransport) dispatchNewListPager(req *http.Request) (* const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/nodeTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skus` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -114,3 +129,9 @@ func (n *NodeTypeSKUsServerTransport) dispatchNewListPager(req *http.Request) (* } return resp, nil } + +// set this to conditionally intercept incoming requests to NodeTypeSKUsServerTransport +var nodeTypeSkUsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operationresults_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operationresults_server.go index f2c9a5355afd..1df69caecfcf 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operationresults_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operationresults_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -23,22 +19,26 @@ import ( // OperationResultsServer is a fake server for instances of the armservicefabricmanagedclusters.OperationResultsClient type. type OperationResultsServer struct { - // Get is the fake for method OperationResultsClient.Get + // BeginGet is the fake for method OperationResultsClient.BeginGet // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - Get func(ctx context.Context, location string, operationID string, options *armservicefabricmanagedclusters.OperationResultsClientGetOptions) (resp azfake.Responder[armservicefabricmanagedclusters.OperationResultsClientGetResponse], errResp azfake.ErrorResponder) + BeginGet func(ctx context.Context, location string, operationID string, options *armservicefabricmanagedclusters.OperationResultsClientBeginGetOptions) (resp azfake.PollerResponder[armservicefabricmanagedclusters.OperationResultsClientGetResponse], errResp azfake.ErrorResponder) } // NewOperationResultsServerTransport creates a new instance of OperationResultsServerTransport with the provided implementation. // The returned OperationResultsServerTransport instance is connected to an instance of armservicefabricmanagedclusters.OperationResultsClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewOperationResultsServerTransport(srv *OperationResultsServer) *OperationResultsServerTransport { - return &OperationResultsServerTransport{srv: srv} + return &OperationResultsServerTransport{ + srv: srv, + beginGet: newTracker[azfake.PollerResponder[armservicefabricmanagedclusters.OperationResultsClientGetResponse]](), + } } // OperationResultsServerTransport connects instances of armservicefabricmanagedclusters.OperationResultsClient to instances of OperationResultsServer. // Don't use this type directly, use NewOperationResultsServerTransport instead. type OperationResultsServerTransport struct { - srv *OperationResultsServer + srv *OperationResultsServer + beginGet *tracker[azfake.PollerResponder[armservicefabricmanagedclusters.OperationResultsClientGetResponse]] } // Do implements the policy.Transporter interface for OperationResultsServerTransport. @@ -49,55 +49,88 @@ func (o *OperationResultsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationResultsClient.Get": - resp, err = o.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationResultsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationResultsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationResultsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationResultsClient.BeginGet": + res.resp, res.err = o.dispatchBeginGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil -} + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() -func (o *OperationResultsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if o.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedClusterOperationResults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) +} + +func (o *OperationResultsServerTransport) dispatchBeginGet(req *http.Request) (*http.Response, error) { + if o.srv.BeginGet == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGet not implemented")} } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err + beginGet := o.beginGet.get(req) + if beginGet == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedClusterOperationResults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + operationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("operationId")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.BeginGet(req.Context(), locationParam, operationIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGet = &respr + o.beginGet.add(req, beginGet) } - operationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("operationId")]) + + resp, err := server.PollerResponderNext(beginGet, req) if err != nil { return nil, err } - respr, errRespr := o.srv.Get(req.Context(), locationParam, operationIDParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + o.beginGet.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if val := server.GetResponse(respr).Location; val != nil { - resp.Header.Set("Location", *val) + if !server.PollerResponderMore(beginGet) { + o.beginGet.remove(req) } + return resp, nil } + +// set this to conditionally intercept incoming requests to OperationResultsServerTransport +var operationResultsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operations_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operations_server.go index 70b027aa0406..2e17923f3b18 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operations_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operations_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -51,21 +47,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +109,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operationstatus_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operationstatus_server.go index 71865044d19d..afd5bac32770 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operationstatus_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/operationstatus_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -49,21 +45,40 @@ func (o *OperationStatusServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationStatusClient.Get": - resp, err = o.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationStatusServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationStatusServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationStatusServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationStatusClient.Get": + res.resp, res.err = o.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationStatusServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -73,7 +88,7 @@ func (o *OperationStatusServerTransport) dispatchGet(req *http.Request) (*http.R const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/managedClusterOperations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { + if len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) @@ -98,3 +113,9 @@ func (o *OperationStatusServerTransport) dispatchGet(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationStatusServerTransport +var operationStatusServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/server_factory.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/server_factory.go index c6f69bc653ef..66d3a1362827 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/server_factory.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/server_factory.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -19,21 +15,50 @@ import ( // ServerFactory is a fake server for instances of the armservicefabricmanagedclusters.ClientFactory type. type ServerFactory struct { - ApplicationTypeVersionsServer ApplicationTypeVersionsServer - ApplicationTypesServer ApplicationTypesServer - ApplicationsServer ApplicationsServer - ManagedApplyMaintenanceWindowServer ManagedApplyMaintenanceWindowServer - ManagedAzResiliencyStatusServer ManagedAzResiliencyStatusServer - ManagedClusterVersionServer ManagedClusterVersionServer - ManagedClustersServer ManagedClustersServer + // ApplicationTypeVersionsServer contains the fakes for client ApplicationTypeVersionsClient + ApplicationTypeVersionsServer ApplicationTypeVersionsServer + + // ApplicationTypesServer contains the fakes for client ApplicationTypesClient + ApplicationTypesServer ApplicationTypesServer + + // ApplicationsServer contains the fakes for client ApplicationsClient + ApplicationsServer ApplicationsServer + + // ManagedApplyMaintenanceWindowServer contains the fakes for client ManagedApplyMaintenanceWindowClient + ManagedApplyMaintenanceWindowServer ManagedApplyMaintenanceWindowServer + + // ManagedAzResiliencyStatusServer contains the fakes for client ManagedAzResiliencyStatusClient + ManagedAzResiliencyStatusServer ManagedAzResiliencyStatusServer + + // ManagedClusterVersionServer contains the fakes for client ManagedClusterVersionClient + ManagedClusterVersionServer ManagedClusterVersionServer + + // ManagedClustersServer contains the fakes for client ManagedClustersClient + ManagedClustersServer ManagedClustersServer + + // ManagedMaintenanceWindowStatusServer contains the fakes for client ManagedMaintenanceWindowStatusClient ManagedMaintenanceWindowStatusServer ManagedMaintenanceWindowStatusServer - ManagedUnsupportedVMSizesServer ManagedUnsupportedVMSizesServer - NodeTypeSKUsServer NodeTypeSKUsServer - NodeTypesServer NodeTypesServer - OperationResultsServer OperationResultsServer - OperationStatusServer OperationStatusServer - OperationsServer OperationsServer - ServicesServer ServicesServer + + // ManagedUnsupportedVMSizesServer contains the fakes for client ManagedUnsupportedVMSizesClient + ManagedUnsupportedVMSizesServer ManagedUnsupportedVMSizesServer + + // NodeTypeSKUsServer contains the fakes for client NodeTypeSKUsClient + NodeTypeSKUsServer NodeTypeSKUsServer + + // NodeTypesServer contains the fakes for client NodeTypesClient + NodeTypesServer NodeTypesServer + + // OperationResultsServer contains the fakes for client OperationResultsClient + OperationResultsServer OperationResultsServer + + // OperationStatusServer contains the fakes for client OperationStatusClient + OperationStatusServer OperationStatusServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // ServicesServer contains the fakes for client ServicesClient + ServicesServer ServicesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/services_server.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/services_server.go index ae56f29f1bd9..9e36da1115ef 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/services_server.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/services_server.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -74,29 +70,48 @@ func (s *ServicesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServicesClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServicesClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServicesClient.Get": - resp, err = s.dispatchGet(req) - case "ServicesClient.NewListByApplicationsPager": - resp, err = s.dispatchNewListByApplicationsPager(req) - case "ServicesClient.Update": - resp, err = s.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServicesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if servicesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = servicesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServicesClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "ServicesClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "ServicesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServicesClient.NewListByApplicationsPager": + res.resp, res.err = s.dispatchNewListByApplicationsPager(req) + case "ServicesClient.Update": + res.resp, res.err = s.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServicesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -105,10 +120,10 @@ func (s *ServicesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) } beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ServiceResource](req) @@ -161,10 +176,10 @@ func (s *ServicesServerTransport) dispatchBeginDelete(req *http.Request) (*http. } beginDelete := s.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -211,10 +226,10 @@ func (s *ServicesServerTransport) dispatchGet(req *http.Request) (*http.Response if s.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -254,10 +269,10 @@ func (s *ServicesServerTransport) dispatchNewListByApplicationsPager(req *http.R } newListByApplicationsPager := s.newListByApplicationsPager.get(req) if newListByApplicationsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { + if len(matches) < 5 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) @@ -297,10 +312,10 @@ func (s *ServicesServerTransport) dispatchUpdate(req *http.Request) (*http.Respo if s.srv.Update == nil { return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedclusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ServiceFabric/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { + if len(matches) < 6 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } body, err := server.UnmarshalRequestAsJSON[armservicefabricmanagedclusters.ServiceUpdateParameters](req) @@ -337,3 +352,9 @@ func (s *ServicesServerTransport) dispatchUpdate(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to ServicesServerTransport +var servicesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/time_rfc3339.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/interfaces.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/interfaces.go index 6019f0ecf6ea..bce48f3ca482 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/interfaces.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/interfaces.go @@ -1,13 +1,18 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters +// FaultSimulationContentClassification provides polymorphic access to related types. +// Call the interface's GetFaultSimulationContent() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *FaultSimulationContent, *ZoneFaultSimulationContent +type FaultSimulationContentClassification interface { + // GetFaultSimulationContent returns the FaultSimulationContent content of the underlying type. + GetFaultSimulationContent() *FaultSimulationContent +} + // PartitionClassification provides polymorphic access to related types. // Call the interface's GetPartition() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedapplymaintenancewindow_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedapplymaintenancewindow_client.go index 7797768d8486..6aa2804e54da 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedapplymaintenancewindow_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedapplymaintenancewindow_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ManagedApplyMaintenanceWindowClient struct { } // NewManagedApplyMaintenanceWindowClient creates a new instance of ManagedApplyMaintenanceWindowClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedApplyMaintenanceWindowClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedApplyMaintenanceWindowClient, error) { @@ -47,8 +43,8 @@ func NewManagedApplyMaintenanceWindowClient(subscriptionID string, credential az // applied. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - options - ManagedApplyMaintenanceWindowClientPostOptions contains the optional parameters for the ManagedApplyMaintenanceWindowClient.Post // method. @@ -74,8 +70,12 @@ func (client *ManagedApplyMaintenanceWindowClient) Post(ctx context.Context, res } // postCreateRequest creates the Post request. -func (client *ManagedApplyMaintenanceWindowClient) postCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ManagedApplyMaintenanceWindowClientPostOptions) (*policy.Request, error) { +func (client *ManagedApplyMaintenanceWindowClient) postCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ManagedApplyMaintenanceWindowClientPostOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applyMaintenanceWindow" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -84,16 +84,12 @@ func (client *ManagedApplyMaintenanceWindowClient) postCreateRequest(ctx context return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedapplymaintenancewindow_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedapplymaintenancewindow_client_example_test.go index 0b148530c2fd..ddf094be161e 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedapplymaintenancewindow_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedapplymaintenancewindow_client_example_test.go @@ -1,35 +1,34 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedApplyMaintenanceWindowPost_example.json +// Generated from example definition: 2025-03-01-preview/ManagedApplyMaintenanceWindowPost_example.json func ExampleManagedApplyMaintenanceWindowClient_Post() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewManagedApplyMaintenanceWindowClient().Post(ctx, "resourceGroup1", "mycluster1", nil) + res, err := clientFactory.NewManagedApplyMaintenanceWindowClient().Post(ctx, "resourceGroup1", "mycluster1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ManagedApplyMaintenanceWindowClientPostResponse{ + // } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedazresiliencystatus_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedazresiliencystatus_client.go index a8d5da5c783b..94fb11e5886e 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedazresiliencystatus_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedazresiliencystatus_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ManagedAzResiliencyStatusClient struct { } // NewManagedAzResiliencyStatusClient creates a new instance of ManagedAzResiliencyStatusClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedAzResiliencyStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedAzResiliencyStatusClient, error) { @@ -46,8 +42,8 @@ func NewManagedAzResiliencyStatusClient(subscriptionID string, credential azcore // Get - Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - options - ManagedAzResiliencyStatusClientGetOptions contains the optional parameters for the ManagedAzResiliencyStatusClient.Get // method. @@ -74,8 +70,12 @@ func (client *ManagedAzResiliencyStatusClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ManagedAzResiliencyStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ManagedAzResiliencyStatusClientGetOptions) (*policy.Request, error) { +func (client *ManagedAzResiliencyStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ManagedAzResiliencyStatusClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getazresiliencystatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -84,16 +84,12 @@ func (client *ManagedAzResiliencyStatusClient) getCreateRequest(ctx context.Cont return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedazresiliencystatus_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedazresiliencystatus_client_example_test.go index 21585aa7c473..dda996497f4a 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedazresiliencystatus_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedazresiliencystatus_client_example_test.go @@ -1,30 +1,24 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/managedAzResiliencyStatusGet_example.json +// Generated from example definition: 2025-03-01-preview/managedAzResiliencyStatusGet_example.json func ExampleManagedAzResiliencyStatusClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,24 +29,27 @@ func ExampleManagedAzResiliencyStatusClient_Get() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedAzResiliencyStatus = armservicefabricmanagedclusters.ManagedAzResiliencyStatus{ - // BaseResourceStatus: []*armservicefabricmanagedclusters.ResourceAzStatus{ - // { - // IsZoneResilient: to.Ptr(false), - // ResourceName: to.Ptr("mycluster1storage"), - // ResourceType: to.Ptr("Microsoft.Storage/storageaccounts"), - // }, - // { - // IsZoneResilient: to.Ptr(true), - // ResourceName: to.Ptr("PublicIP-mycluster1"), - // ResourceType: to.Ptr("Microsoft.Network/publicIPAddress"), + // res = armservicefabricmanagedclusters.ManagedAzResiliencyStatusClientGetResponse{ + // ManagedAzResiliencyStatus: &armservicefabricmanagedclusters.ManagedAzResiliencyStatus{ + // BaseResourceStatus: []*armservicefabricmanagedclusters.ResourceAzStatus{ + // { + // IsZoneResilient: to.Ptr(false), + // ResourceName: to.Ptr("mycluster1storage"), + // ResourceType: to.Ptr("Microsoft.Storage/storageaccounts"), + // }, + // { + // IsZoneResilient: to.Ptr(true), + // ResourceName: to.Ptr("PublicIP-mycluster1"), + // ResourceType: to.Ptr("Microsoft.Network/publicIPAddress"), + // }, + // { + // IsZoneResilient: to.Ptr(false), + // ResourceName: to.Ptr("Primary"), + // ResourceType: to.Ptr("Microsoft.Compute/virtualmachinescalesets"), + // Details: to.Ptr("Status: InProgress, ZonalNodes: 3, RegionalNodes: 3"), + // }, // }, - // { - // IsZoneResilient: to.Ptr(false), - // ResourceName: to.Ptr("Primary"), - // ResourceType: to.Ptr("Microsoft.Compute/virtualmachinescalesets"), - // Details: to.Ptr("Status: InProgress, ZonalNodes: 3, RegionalNodes: 3"), - // }}, - // IsClusterZoneResilient: to.Ptr(false), + // IsClusterZoneResilient: to.Ptr(false), + // }, // } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusters_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusters_client.go index fe5f14bd0b8d..cda8ac8a54b8 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusters_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusters_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ManagedClustersClient struct { } // NewManagedClustersClient creates a new instance of ManagedClustersClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedClustersClient, error) { @@ -46,8 +42,8 @@ func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Create or update a Service Fabric managed cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - parameters - The cluster resource. // - options - ManagedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClustersClient.BeginCreateOrUpdate @@ -59,8 +55,7 @@ func (client *ManagedClustersClient) BeginCreateOrUpdate(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -73,7 +68,7 @@ func (client *ManagedClustersClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create or update a Service Fabric managed cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ManagedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginCreateOrUpdate" @@ -96,8 +91,12 @@ func (client *ManagedClustersClient) createOrUpdate(ctx context.Context, resourc } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters ManagedCluster, _ *ManagedClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -106,18 +105,15 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -127,8 +123,8 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete a Service Fabric managed cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - options - ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete // method. @@ -139,8 +135,7 @@ func (client *ManagedClustersClient) BeginDelete(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -153,7 +148,7 @@ func (client *ManagedClustersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete a Service Fabric managed cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ManagedClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginDelete" @@ -168,7 +163,7 @@ func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resour if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -176,8 +171,12 @@ func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resour } // deleteCreateRequest creates the Delete request. -func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ManagedClustersClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ManagedClustersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -186,16 +185,12 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,8 +200,8 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - options - ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. func (client *ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *ManagedClustersClientGetOptions) (ManagedClustersClientGetResponse, error) { @@ -232,8 +227,12 @@ func (client *ManagedClustersClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ManagedClustersClientGetOptions) (*policy.Request, error) { +func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ManagedClustersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -242,16 +241,12 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,11 +261,81 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man return result, nil } +// GetFaultSimulation - Gets a fault simulation by the simulationId. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - parameters - parameter with fault simulation id. +// - options - ManagedClustersClientGetFaultSimulationOptions contains the optional parameters for the ManagedClustersClient.GetFaultSimulation +// method. +func (client *ManagedClustersClient) GetFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, parameters FaultSimulationIDContent, options *ManagedClustersClientGetFaultSimulationOptions) (ManagedClustersClientGetFaultSimulationResponse, error) { + var err error + const operationName = "ManagedClustersClient.GetFaultSimulation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getFaultSimulationCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) + if err != nil { + return ManagedClustersClientGetFaultSimulationResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClustersClientGetFaultSimulationResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedClustersClientGetFaultSimulationResponse{}, err + } + resp, err := client.getFaultSimulationHandleResponse(httpResp) + return resp, err +} + +// getFaultSimulationCreateRequest creates the GetFaultSimulation request. +func (client *ManagedClustersClient) getFaultSimulationCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters FaultSimulationIDContent, _ *ManagedClustersClientGetFaultSimulationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getFaultSimulation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// getFaultSimulationHandleResponse handles the GetFaultSimulation response. +func (client *ManagedClustersClient) getFaultSimulationHandleResponse(resp *http.Response) (ManagedClustersClientGetFaultSimulationResponse, error) { + result := ManagedClustersClientGetFaultSimulationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FaultSimulation); err != nil { + return ManagedClustersClientGetFaultSimulationResponse{}, err + } + return result, nil +} + // NewListByResourceGroupPager - Gets all Service Fabric cluster resources created or in the process of being created in the // resource group. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.NewListByResourceGroupPager // method. func (client *ManagedClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ManagedClustersClientListByResourceGroupOptions) *runtime.Pager[ManagedClustersClientListByResourceGroupResponse] { @@ -297,22 +362,22 @@ func (client *ManagedClustersClient) NewListByResourceGroupPager(resourceGroupNa } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClustersClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ManagedClustersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +395,7 @@ func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - Gets all Service Fabric cluster resources created or in the process of being created in the // subscription. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview // - options - ManagedClustersClientListBySubscriptionOptions contains the optional parameters for the ManagedClustersClient.NewListBySubscriptionPager // method. func (client *ManagedClustersClient) NewListBySubscriptionPager(options *ManagedClustersClientListBySubscriptionOptions) *runtime.Pager[ManagedClustersClientListBySubscriptionResponse] { @@ -357,7 +422,7 @@ func (client *ManagedClustersClient) NewListBySubscriptionPager(options *Managed } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ManagedClustersClient) listBySubscriptionCreateRequest(ctx context.Context, options *ManagedClustersClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ManagedClustersClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ManagedClustersClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -368,7 +433,7 @@ func (client *ManagedClustersClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,11 +448,238 @@ func (client *ManagedClustersClient) listBySubscriptionHandleResponse(resp *http return result, nil } +// NewListFaultSimulationPager - Gets the list of recent fault simulations for the cluster. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - options - ManagedClustersClientListFaultSimulationOptions contains the optional parameters for the ManagedClustersClient.NewListFaultSimulationPager +// method. +func (client *ManagedClustersClient) NewListFaultSimulationPager(resourceGroupName string, clusterName string, options *ManagedClustersClientListFaultSimulationOptions) *runtime.Pager[ManagedClustersClientListFaultSimulationResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClustersClientListFaultSimulationResponse]{ + More: func(page ManagedClustersClientListFaultSimulationResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClustersClientListFaultSimulationResponse) (ManagedClustersClientListFaultSimulationResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListFaultSimulationPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listFaultSimulationCreateRequest(ctx, resourceGroupName, clusterName, options) + }, nil) + if err != nil { + return ManagedClustersClientListFaultSimulationResponse{}, err + } + return client.listFaultSimulationHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listFaultSimulationCreateRequest creates the ListFaultSimulation request. +func (client *ManagedClustersClient) listFaultSimulationCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ManagedClustersClientListFaultSimulationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/listFaultSimulation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listFaultSimulationHandleResponse handles the ListFaultSimulation response. +func (client *ManagedClustersClient) listFaultSimulationHandleResponse(resp *http.Response) (ManagedClustersClientListFaultSimulationResponse, error) { + result := ManagedClustersClientListFaultSimulationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FaultSimulationListResult); err != nil { + return ManagedClustersClientListFaultSimulationResponse{}, err + } + return result, nil +} + +// BeginStartFaultSimulation - Starts a fault simulation on the cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - parameters - parameters describing the fault simulation. +// - options - ManagedClustersClientBeginStartFaultSimulationOptions contains the optional parameters for the ManagedClustersClient.BeginStartFaultSimulation +// method. +func (client *ManagedClustersClient) BeginStartFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, parameters FaultSimulationContentWrapper, options *ManagedClustersClientBeginStartFaultSimulationOptions) (*runtime.Poller[ManagedClustersClientStartFaultSimulationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startFaultSimulation(ctx, resourceGroupName, clusterName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientStartFaultSimulationResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientStartFaultSimulationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StartFaultSimulation - Starts a fault simulation on the cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *ManagedClustersClient) startFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, parameters FaultSimulationContentWrapper, options *ManagedClustersClientBeginStartFaultSimulationOptions) (*http.Response, error) { + var err error + const operationName = "ManagedClustersClient.BeginStartFaultSimulation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startFaultSimulationCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startFaultSimulationCreateRequest creates the StartFaultSimulation request. +func (client *ManagedClustersClient) startFaultSimulationCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters FaultSimulationContentWrapper, _ *ManagedClustersClientBeginStartFaultSimulationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/startFaultSimulation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginStopFaultSimulation - Stops a fault simulation on the cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - parameters - parameter with fault simulation id. +// - options - ManagedClustersClientBeginStopFaultSimulationOptions contains the optional parameters for the ManagedClustersClient.BeginStopFaultSimulation +// method. +func (client *ManagedClustersClient) BeginStopFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, parameters FaultSimulationIDContent, options *ManagedClustersClientBeginStopFaultSimulationOptions) (*runtime.Poller[ManagedClustersClientStopFaultSimulationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopFaultSimulation(ctx, resourceGroupName, clusterName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientStopFaultSimulationResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientStopFaultSimulationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StopFaultSimulation - Stops a fault simulation on the cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *ManagedClustersClient) stopFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, parameters FaultSimulationIDContent, options *ManagedClustersClientBeginStopFaultSimulationOptions) (*http.Response, error) { + var err error + const operationName = "ManagedClustersClient.BeginStopFaultSimulation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.stopFaultSimulationCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// stopFaultSimulationCreateRequest creates the StopFaultSimulation request. +func (client *ManagedClustersClient) stopFaultSimulationCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters FaultSimulationIDContent, _ *ManagedClustersClientBeginStopFaultSimulationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/stopFaultSimulation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + // Update - Update the tags of of a Service Fabric managed cluster resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - parameters - The managed cluster resource updated tags. // - options - ManagedClustersClientUpdateOptions contains the optional parameters for the ManagedClustersClient.Update method. @@ -414,8 +706,12 @@ func (client *ManagedClustersClient) Update(ctx context.Context, resourceGroupNa } // updateCreateRequest creates the Update request. -func (client *ManagedClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters ManagedClusterUpdateParameters, options *ManagedClustersClientUpdateOptions) (*policy.Request, error) { +func (client *ManagedClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters ManagedClusterUpdateParameters, _ *ManagedClustersClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -424,18 +720,15 @@ func (client *ManagedClustersClient) updateCreateRequest(ctx context.Context, re return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusters_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusters_client_example_test.go index de783559078f..dbb2732efb65 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusters_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusters_client_example_test.go @@ -1,328 +1,36 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterListByResourceGroupOperation_example.json -func ExampleManagedClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedClustersClient().NewListByResourceGroupPager("resRg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedClusterListResult = armservicefabricmanagedclusters.ManagedClusterListResult{ - // Value: []*armservicefabricmanagedclusters.ManagedCluster{ - // { - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - // AdminUserName: to.Ptr("vmadmin"), - // ClientConnectionPort: to.Ptr[int32](19000), - // ClusterCertificateThumbprints: []*string{ - // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622")}, - // ClusterCodeVersion: to.Ptr("7.1.168.9494"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), - // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), - // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), - // DNSName: to.Ptr("myCluster"), - // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ - // { - // Name: to.Ptr("ManagedIdentityTokenService"), - // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ - // { - // Name: to.Ptr("IsEnabled"), - // Value: to.Ptr("true"), - // }}, - // }}, - // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), - // HTTPGatewayConnectionPort: to.Ptr[int32](19080), - // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // }, - // SKU: &armservicefabricmanagedclusters.SKU{ - // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("myCluster2"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // Etag: to.Ptr("W/\"636462502164040075\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - // AdminUserName: to.Ptr("vmadmin"), - // ClientConnectionPort: to.Ptr[int32](19000), - // ClusterCertificateThumbprints: []*string{ - // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622")}, - // ClusterCodeVersion: to.Ptr("7.1.168.9494"), - // ClusterID: to.Ptr("2747e469-b24e-4039-8a0a-46151419523f"), - // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), - // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), - // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), - // DNSName: to.Ptr("myCluster2"), - // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ - // { - // Name: to.Ptr("ManagedIdentityTokenService"), - // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ - // { - // Name: to.Ptr("IsEnabled"), - // Value: to.Ptr("true"), - // }}, - // }}, - // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), - // HTTPGatewayConnectionPort: to.Ptr[int32](19080), - // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // }, - // SKU: &armservicefabricmanagedclusters.SKU{ - // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterListBySubscriptionOperation_example.json -func ExampleManagedClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedClustersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedClusterListResult = armservicefabricmanagedclusters.ManagedClusterListResult{ - // Value: []*armservicefabricmanagedclusters.ManagedCluster{ - // { - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - // AdminUserName: to.Ptr("vmadmin"), - // ClientConnectionPort: to.Ptr[int32](19000), - // ClusterCertificateThumbprints: []*string{ - // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622")}, - // ClusterCodeVersion: to.Ptr("7.1.168.9494"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), - // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), - // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), - // DNSName: to.Ptr("myCluster"), - // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ - // { - // Name: to.Ptr("ManagedIdentityTokenService"), - // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ - // { - // Name: to.Ptr("IsEnabled"), - // Value: to.Ptr("true"), - // }}, - // }}, - // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), - // HTTPGatewayConnectionPort: to.Ptr[int32](19080), - // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // }, - // SKU: &armservicefabricmanagedclusters.SKU{ - // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("myCluster2"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // Etag: to.Ptr("W/\"636462502164040075\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - // AdminUserName: to.Ptr("vmadmin"), - // ClientConnectionPort: to.Ptr[int32](19000), - // ClusterCertificateThumbprints: []*string{ - // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622")}, - // ClusterCodeVersion: to.Ptr("7.1.168.9494"), - // ClusterID: to.Ptr("2747e469-b24e-4039-8a0a-46151419523f"), - // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), - // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), - // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), - // DNSName: to.Ptr("myCluster2"), - // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ - // { - // Name: to.Ptr("ManagedIdentityTokenService"), - // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ - // { - // Name: to.Ptr("IsEnabled"), - // Value: to.Ptr("true"), - // }}, - // }}, - // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), - // HTTPGatewayConnectionPort: to.Ptr[int32](19080), - // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // }, - // SKU: &armservicefabricmanagedclusters.SKU{ - // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterGetOperation_example.json -func ExampleManagedClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedClustersClient().Get(ctx, "resRg", "myCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedCluster = armservicefabricmanagedclusters.ManagedCluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - // AdminUserName: to.Ptr("vmadmin"), - // ClientConnectionPort: to.Ptr[int32](19000), - // ClusterCertificateThumbprints: []*string{ - // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622")}, - // ClusterCodeVersion: to.Ptr("7.1.168.9494"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), - // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), - // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), - // DNSName: to.Ptr("myCluster"), - // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ - // { - // Name: to.Ptr("ManagedIdentityTokenService"), - // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ - // { - // Name: to.Ptr("IsEnabled"), - // Value: to.Ptr("true"), - // }}, - // }}, - // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), - // HTTPGatewayConnectionPort: to.Ptr[int32](19080), - // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ - // { - // BackendPort: to.Ptr[int32](80), - // FrontendPort: to.Ptr[int32](80), - // ProbePort: to.Ptr[int32](80), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), - // }, - // { - // BackendPort: to.Ptr[int32](443), - // FrontendPort: to.Ptr[int32](443), - // ProbePort: to.Ptr[int32](443), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), - // }, - // { - // BackendPort: to.Ptr[int32](10000), - // FrontendPort: to.Ptr[int32](10000), - // ProbePort: to.Ptr[int32](10000), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolTCP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.ProtocolTCP), - // }}, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // }, - // SKU: &armservicefabricmanagedclusters.SKU{ - // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterPutOperation_example_max.json +// Generated from example definition: 2025-03-01-preview/ManagedClusterPutOperation_example_max.json func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "resRg", "mycluster", armservicefabricmanagedclusters.ManagedCluster{ Location: to.Ptr("eastus"), - Tags: map[string]*string{}, Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ AddonFeatures: []*armservicefabricmanagedclusters.ManagedClusterAddOnFeature{ to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureDNSService), to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureBackupRestoreService), - to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureResourceMonitorService)}, + to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureResourceMonitorService), + }, AdminPassword: to.Ptr("{vm-password}"), AdminUserName: to.Ptr("vmadmin"), AllocatedOutboundPorts: to.Ptr[int32](0), @@ -338,7 +46,8 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumPara NetworkSecurityGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/networkSecurityGroups/sn1"), PrivateEndpointNetworkPolicies: to.Ptr(armservicefabricmanagedclusters.PrivateEndpointNetworkPoliciesEnabled), PrivateLinkServiceNetworkPolicies: to.Ptr(armservicefabricmanagedclusters.PrivateLinkServiceNetworkPoliciesEnabled), - }}, + }, + }, ClientConnectionPort: to.Ptr[int32](19000), ClusterCodeVersion: to.Ptr("7.1.168.9494"), ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeManual), @@ -354,15 +63,18 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumPara { Name: to.Ptr("IsEnabled"), Value: to.Ptr("true"), - }}, - }}, + }, + }, + }, + }, HTTPGatewayConnectionPort: to.Ptr[int32](19080), HTTPGatewayTokenAuthConnectionPort: to.Ptr[int32](19081), IPTags: []*armservicefabricmanagedclusters.IPTag{ { IPTagType: to.Ptr("FirstPartyUsage"), Tag: to.Ptr("SQL"), - }}, + }, + }, LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ { BackendPort: to.Ptr[int32](80), @@ -385,22 +97,27 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumPara ProbePort: to.Ptr[int32](10000), ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), Protocol: to.Ptr(armservicefabricmanagedclusters.ProtocolTCP), - }}, + }, + }, NetworkSecurityRules: []*armservicefabricmanagedclusters.NetworkSecurityRule{ { Name: to.Ptr("TestName"), Description: to.Ptr("Test description"), Access: to.Ptr(armservicefabricmanagedclusters.AccessAllow), DestinationAddressPrefixes: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, DestinationPortRanges: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, Direction: to.Ptr(armservicefabricmanagedclusters.DirectionInbound), Priority: to.Ptr[int32](1010), SourceAddressPrefixes: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, SourcePortRanges: []*string{ - to.Ptr("*")}, + to.Ptr("*"), + }, Protocol: to.Ptr(armservicefabricmanagedclusters.NsgProtocolTCP), }, { @@ -413,16 +130,19 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumPara SourceAddressPrefix: to.Ptr("AzureResourceManager"), SourcePortRange: to.Ptr("*"), Protocol: to.Ptr(armservicefabricmanagedclusters.NsgProtocol("*")), - }}, + }, + }, PublicIPPrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPPrefix"), PublicIPv6PrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPv6Prefix"), ServiceEndpoints: []*armservicefabricmanagedclusters.ServiceEndpoint{ { Locations: []*string{ to.Ptr("eastus2"), - to.Ptr("usnorth")}, + to.Ptr("usnorth"), + }, Service: to.Ptr("Microsoft.Storage"), - }}, + }, + }, UpgradeDescription: &armservicefabricmanagedclusters.ClusterUpgradePolicy{ DeltaHealthPolicy: &armservicefabricmanagedclusters.ClusterUpgradeDeltaHealthPolicy{ MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](40), @@ -449,6 +169,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumPara SKU: &armservicefabricmanagedclusters.SKU{ Name: to.Ptr(armservicefabricmanagedclusters.SKUNameBasic), }, + Tags: map[string]*string{}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -460,19 +181,19 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumPara // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedCluster = armservicefabricmanagedclusters.ManagedCluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - // AddonFeatures: []*armservicefabricmanagedclusters.ManagedClusterAddOnFeature{ - // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureDNSService), - // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureBackupRestoreService), - // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureResourceMonitorService)}, + // res = armservicefabricmanagedclusters.ManagedClustersClientCreateOrUpdateResponse{ + // ManagedCluster: &armservicefabricmanagedclusters.ManagedCluster{ + // Name: to.Ptr("myCluster"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), + // Etag: to.Ptr("W/\"636462502169240745\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ + // AddonFeatures: []*armservicefabricmanagedclusters.ManagedClusterAddOnFeature{ + // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureDNSService), + // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureBackupRestoreService), + // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureResourceMonitorService), + // }, // AdminUserName: to.Ptr("vmadmin"), // AllocatedOutboundPorts: to.Ptr[int32](0), // AllowRdpAccess: to.Ptr(true), @@ -487,190 +208,22 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumPara // NetworkSecurityGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/networkSecurityGroups/sn1"), // PrivateEndpointNetworkPolicies: to.Ptr(armservicefabricmanagedclusters.PrivateEndpointNetworkPoliciesEnabled), // PrivateLinkServiceNetworkPolicies: to.Ptr(armservicefabricmanagedclusters.PrivateLinkServiceNetworkPoliciesEnabled), - // }}, + // }, + // }, // ClientConnectionPort: to.Ptr[int32](19000), // ClusterCertificateThumbprints: []*string{ - // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622")}, - // ClusterCodeVersion: to.Ptr("7.1.168.9494"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), - // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeManual), - // DdosProtectionPlanID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/ddosProtectionPlans/myDDoSProtectionPlan"), - // DNSName: to.Ptr("mycluster"), - // EnableAutoOSUpgrade: to.Ptr(true), - // EnableHTTPGatewayExclusiveAuthMode: to.Ptr(true), - // EnableIPv6: to.Ptr(true), - // EnableServicePublicIP: to.Ptr(true), - // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ - // { - // Name: to.Ptr("ManagedIdentityTokenService"), - // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ - // { - // Name: to.Ptr("IsEnabled"), - // Value: to.Ptr("true"), - // }}, - // }}, - // Fqdn: to.Ptr("mycluster.eastus.cloudapp.azure.com"), - // HTTPGatewayConnectionPort: to.Ptr[int32](19080), - // HTTPGatewayTokenAuthConnectionPort: to.Ptr[int32](19081), - // IPTags: []*armservicefabricmanagedclusters.IPTag{ - // { - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("SQL"), - // }}, - // IPv6Address: to.Ptr("0000:0000:0000:0000:0000:0000:0000:0000"), - // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ - // { - // BackendPort: to.Ptr[int32](80), - // FrontendPort: to.Ptr[int32](80), - // ProbePort: to.Ptr[int32](80), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), - // }, - // { - // BackendPort: to.Ptr[int32](443), - // FrontendPort: to.Ptr[int32](443), - // ProbePort: to.Ptr[int32](443), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), - // }, - // { - // BackendPort: to.Ptr[int32](10000), - // FrontendPort: to.Ptr[int32](10000), - // LoadDistribution: to.Ptr("Default"), - // ProbePort: to.Ptr[int32](10000), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolTCP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.ProtocolTCP), - // }}, - // NetworkSecurityRules: []*armservicefabricmanagedclusters.NetworkSecurityRule{ - // { - // Name: to.Ptr("TestName"), - // Description: to.Ptr("Test description"), - // Access: to.Ptr(armservicefabricmanagedclusters.AccessAllow), - // DestinationAddressPrefixes: []*string{ - // to.Ptr("*")}, - // DestinationPortRanges: []*string{ - // to.Ptr("*")}, - // Direction: to.Ptr(armservicefabricmanagedclusters.DirectionInbound), - // Priority: to.Ptr[int32](1010), - // SourceAddressPrefixes: []*string{ - // to.Ptr("*")}, - // SourcePortRanges: []*string{ - // to.Ptr("*")}, - // Protocol: to.Ptr(armservicefabricmanagedclusters.NsgProtocolTCP), - // }, - // { - // Name: to.Ptr("AllowARM"), - // Access: to.Ptr(armservicefabricmanagedclusters.AccessAllow), - // DestinationAddressPrefix: to.Ptr("*"), - // DestinationPortRange: to.Ptr("33500-33699"), - // Direction: to.Ptr(armservicefabricmanagedclusters.DirectionInbound), - // Priority: to.Ptr[int32](2002), - // SourceAddressPrefix: to.Ptr("AzureResourceManager"), - // SourcePortRange: to.Ptr("*"), - // Protocol: to.Ptr(armservicefabricmanagedclusters.NsgProtocol("*")), - // }}, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // PublicIPPrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPPrefix"), - // PublicIPv6PrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPv6Prefix"), - // ServiceEndpoints: []*armservicefabricmanagedclusters.ServiceEndpoint{ - // { - // Locations: []*string{ - // to.Ptr("eastus2"), - // to.Ptr("usnorth")}, - // Service: to.Ptr("Microsoft.Storage"), - // }}, - // UpgradeDescription: &armservicefabricmanagedclusters.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabricmanagedclusters.ClusterUpgradeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](40), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](20), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](40), - // }, - // ForceRestart: to.Ptr(false), - // HealthPolicy: &armservicefabricmanagedclusters.ClusterHealthPolicy{ - // MaxPercentUnhealthyApplications: to.Ptr[int32](30), - // MaxPercentUnhealthyNodes: to.Ptr[int32](10), - // }, - // MonitoringPolicy: &armservicefabricmanagedclusters.ClusterMonitoringPolicy{ - // HealthCheckRetryTimeout: to.Ptr("00:55:00"), - // HealthCheckStableDuration: to.Ptr("00:45:00"), - // HealthCheckWaitDuration: to.Ptr("00:05:00"), - // UpgradeDomainTimeout: to.Ptr("03:00:00"), - // UpgradeTimeout: to.Ptr("12:00:00"), - // }, - // UpgradeReplicaSetCheckTimeout: to.Ptr("49710.06:28:16"), - // }, - // UseCustomVnet: to.Ptr(true), - // ZonalResiliency: to.Ptr(true), - // ZonalUpdateMode: to.Ptr(armservicefabricmanagedclusters.ZonalUpdateModeFast), - // }, - // SKU: &armservicefabricmanagedclusters.SKU{ - // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterPutOperation_example_min.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMinimumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", armservicefabricmanagedclusters.ManagedCluster{ - Location: to.Ptr("eastus"), - Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - AdminPassword: to.Ptr("{vm-password}"), - AdminUserName: to.Ptr("vmadmin"), - ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave1), - ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), - DNSName: to.Ptr("myCluster"), - FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ - { - Name: to.Ptr("ManagedIdentityTokenService"), - Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ - { - Name: to.Ptr("IsEnabled"), - Value: to.Ptr("true"), - }}, - }}, - }, - SKU: &armservicefabricmanagedclusters.SKU{ - Name: to.Ptr(armservicefabricmanagedclusters.SKUNameBasic), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedCluster = armservicefabricmanagedclusters.ManagedCluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - // AdminUserName: to.Ptr("vmadmin"), - // ClientConnectionPort: to.Ptr[int32](19000), - // ClusterCertificateThumbprints: []*string{ - // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622")}, + // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), + // }, + // ClusterCodeVersion: to.Ptr("7.1.168.9494"), // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), - // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave1), - // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), - // DNSName: to.Ptr("myCluster"), + // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeManual), + // DdosProtectionPlanID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/ddosProtectionPlans/myDDoSProtectionPlan"), + // DNSName: to.Ptr("mycluster"), + // EnableAutoOSUpgrade: to.Ptr(true), + // EnableHTTPGatewayExclusiveAuthMode: to.Ptr(true), + // EnableIPv6: to.Ptr(true), + // EnableServicePublicIP: to.Ptr(true), // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ // { // Name: to.Ptr("ManagedIdentityTokenService"), @@ -678,134 +231,219 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMinimumPara // { // Name: to.Ptr("IsEnabled"), // Value: to.Ptr("true"), - // }}, - // }}, - // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), - // HTTPGatewayConnectionPort: to.Ptr[int32](19080), + // }, + // }, + // }, + // }, + // Fqdn: to.Ptr("mycluster.eastus.cloudapp.azure.com"), + // HTTPGatewayConnectionPort: to.Ptr[int32](19080), + // HTTPGatewayTokenAuthConnectionPort: to.Ptr[int32](19081), + // IPTags: []*armservicefabricmanagedclusters.IPTag{ + // { + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("SQL"), + // }, + // }, + // IPv6Address: to.Ptr("0000:0000:0000:0000:0000:0000:0000:0000"), // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ + // { + // BackendPort: to.Ptr[int32](80), + // FrontendPort: to.Ptr[int32](80), + // ProbePort: to.Ptr[int32](80), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), + // }, + // { + // BackendPort: to.Ptr[int32](443), + // FrontendPort: to.Ptr[int32](443), + // ProbePort: to.Ptr[int32](443), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), + // }, + // { + // BackendPort: to.Ptr[int32](10000), + // FrontendPort: to.Ptr[int32](10000), + // LoadDistribution: to.Ptr("Default"), + // ProbePort: to.Ptr[int32](10000), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolTCP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.ProtocolTCP), + // }, // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // NetworkSecurityRules: []*armservicefabricmanagedclusters.NetworkSecurityRule{ + // { + // Name: to.Ptr("TestName"), + // Description: to.Ptr("Test description"), + // Access: to.Ptr(armservicefabricmanagedclusters.AccessAllow), + // DestinationAddressPrefixes: []*string{ + // to.Ptr("*"), + // }, + // DestinationPortRanges: []*string{ + // to.Ptr("*"), + // }, + // Direction: to.Ptr(armservicefabricmanagedclusters.DirectionInbound), + // Priority: to.Ptr[int32](1010), + // SourceAddressPrefixes: []*string{ + // to.Ptr("*"), + // }, + // SourcePortRanges: []*string{ + // to.Ptr("*"), + // }, + // Protocol: to.Ptr(armservicefabricmanagedclusters.NsgProtocolTCP), + // }, + // { + // Name: to.Ptr("AllowARM"), + // Access: to.Ptr(armservicefabricmanagedclusters.AccessAllow), + // DestinationAddressPrefix: to.Ptr("*"), + // DestinationPortRange: to.Ptr("33500-33699"), + // Direction: to.Ptr(armservicefabricmanagedclusters.DirectionInbound), + // Priority: to.Ptr[int32](2002), + // SourceAddressPrefix: to.Ptr("AzureResourceManager"), + // SourcePortRange: to.Ptr("*"), + // Protocol: to.Ptr(armservicefabricmanagedclusters.NsgProtocol("*")), + // }, + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // PublicIPPrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPPrefix"), + // PublicIPv6PrefixID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPv6Prefix"), + // ServiceEndpoints: []*armservicefabricmanagedclusters.ServiceEndpoint{ + // { + // Locations: []*string{ + // to.Ptr("eastus2"), + // to.Ptr("usnorth"), + // }, + // Service: to.Ptr("Microsoft.Storage"), + // }, + // }, + // UpgradeDescription: &armservicefabricmanagedclusters.ClusterUpgradePolicy{ + // DeltaHealthPolicy: &armservicefabricmanagedclusters.ClusterUpgradeDeltaHealthPolicy{ + // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](40), + // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](20), + // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](40), + // }, + // ForceRestart: to.Ptr(false), + // HealthPolicy: &armservicefabricmanagedclusters.ClusterHealthPolicy{ + // MaxPercentUnhealthyApplications: to.Ptr[int32](30), + // MaxPercentUnhealthyNodes: to.Ptr[int32](10), + // }, + // MonitoringPolicy: &armservicefabricmanagedclusters.ClusterMonitoringPolicy{ + // HealthCheckRetryTimeout: to.Ptr("00:55:00"), + // HealthCheckStableDuration: to.Ptr("00:45:00"), + // HealthCheckWaitDuration: to.Ptr("00:05:00"), + // UpgradeDomainTimeout: to.Ptr("03:00:00"), + // UpgradeTimeout: to.Ptr("12:00:00"), + // }, + // UpgradeReplicaSetCheckTimeout: to.Ptr("49710.06:28:16"), + // }, + // UseCustomVnet: to.Ptr(true), + // ZonalResiliency: to.Ptr(true), + // ZonalUpdateMode: to.Ptr(armservicefabricmanagedclusters.ZonalUpdateModeFast), // }, // SKU: &armservicefabricmanagedclusters.SKU{ // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameBasic), // }, - // } + // Tags: map[string]*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterPatchOperation_example.json -func ExampleManagedClustersClient_Update() { +// Generated from example definition: 2025-03-01-preview/ManagedClusterPutOperation_example_min.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_putAClusterWithMinimumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewManagedClustersClient().Update(ctx, "resRg", "myCluster", armservicefabricmanagedclusters.ManagedClusterUpdateParameters{ - Tags: map[string]*string{ - "a": to.Ptr("b"), + poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", armservicefabricmanagedclusters.ManagedCluster{ + Location: to.Ptr("eastus"), + Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ + AdminPassword: to.Ptr("{vm-password}"), + AdminUserName: to.Ptr("vmadmin"), + ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave1), + ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), + DNSName: to.Ptr("myCluster"), + FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ + { + Name: to.Ptr("ManagedIdentityTokenService"), + Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ + { + Name: to.Ptr("IsEnabled"), + Value: to.Ptr("true"), + }, + }, + }, + }, + }, + SKU: &armservicefabricmanagedclusters.SKU{ + Name: to.Ptr(armservicefabricmanagedclusters.SKUNameBasic), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedCluster = armservicefabricmanagedclusters.ManagedCluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ - // AddonFeatures: []*armservicefabricmanagedclusters.ManagedClusterAddOnFeature{ - // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureDNSService), - // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureBackupRestoreService), - // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureResourceMonitorService)}, + // res = armservicefabricmanagedclusters.ManagedClustersClientCreateOrUpdateResponse{ + // ManagedCluster: &armservicefabricmanagedclusters.ManagedCluster{ + // Name: to.Ptr("myCluster"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), + // Etag: to.Ptr("W/\"636462502169240745\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ // AdminUserName: to.Ptr("vmadmin"), - // AllowRdpAccess: to.Ptr(true), - // ClientConnectionPort: to.Ptr[int32](19001), + // ClientConnectionPort: to.Ptr[int32](19000), // ClusterCertificateThumbprints: []*string{ - // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622")}, - // ClusterCodeVersion: to.Ptr("7.1.168.9494"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), - // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), - // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), - // DNSName: to.Ptr("myCluster"), - // EnableAutoOSUpgrade: to.Ptr(true), - // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ - // { - // Name: to.Ptr("ManagedIdentityTokenService"), - // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ - // { - // Name: to.Ptr("IsEnabled"), - // Value: to.Ptr("false"), - // }}, - // }}, - // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), - // HTTPGatewayConnectionPort: to.Ptr[int32](19081), - // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ - // { - // BackendPort: to.Ptr[int32](80), - // FrontendPort: to.Ptr[int32](80), - // ProbePort: to.Ptr[int32](80), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), - // }, - // { - // BackendPort: to.Ptr[int32](443), - // FrontendPort: to.Ptr[int32](443), - // ProbePort: to.Ptr[int32](443), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), + // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), + // }, + // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), + // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), + // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave1), + // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), + // DNSName: to.Ptr("myCluster"), + // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ + // { + // Name: to.Ptr("ManagedIdentityTokenService"), + // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ + // { + // Name: to.Ptr("IsEnabled"), + // Value: to.Ptr("true"), + // }, // }, - // { - // BackendPort: to.Ptr[int32](10000), - // FrontendPort: to.Ptr[int32](10000), - // ProbePort: to.Ptr[int32](10000), - // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), - // Protocol: to.Ptr(armservicefabricmanagedclusters.ProtocolTCP), - // }}, - // NetworkSecurityRules: []*armservicefabricmanagedclusters.NetworkSecurityRule{ - // { - // Name: to.Ptr("TestName"), - // Description: to.Ptr("Test description"), - // Access: to.Ptr(armservicefabricmanagedclusters.AccessAllow), - // DestinationAddressPrefixes: []*string{ - // to.Ptr("*")}, - // DestinationPortRanges: []*string{ - // to.Ptr("*")}, - // Direction: to.Ptr(armservicefabricmanagedclusters.DirectionInbound), - // Priority: to.Ptr[int32](1010), - // SourceAddressPrefixes: []*string{ - // to.Ptr("*")}, - // SourcePortRanges: []*string{ - // to.Ptr("*")}, - // Protocol: to.Ptr(armservicefabricmanagedclusters.NsgProtocolTCP), - // }}, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // }, - // SKU: &armservicefabricmanagedclusters.SKU{ - // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), - // }, - // } + // }, + // }, + // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), + // HTTPGatewayConnectionPort: to.Ptr[int32](19080), + // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // }, + // SKU: &armservicefabricmanagedclusters.SKU{ + // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameBasic), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterDeleteOperation_example.json +// Generated from example definition: 2025-03-01-preview/ManagedClusterDeleteOperation_example.json func ExampleManagedClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -818,3 +456,433 @@ func ExampleManagedClustersClient_BeginDelete() { log.Fatalf("failed to pull the result: %v", err) } } + +// Generated from example definition: 2025-03-01-preview/ManagedClusterGetOperation_example.json +func ExampleManagedClustersClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClustersClient().Get(ctx, "resRg", "myCluster", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ManagedClustersClientGetResponse{ + // ManagedCluster: &armservicefabricmanagedclusters.ManagedCluster{ + // Name: to.Ptr("myCluster"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), + // Etag: to.Ptr("W/\"636462502169240745\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ + // AdminUserName: to.Ptr("vmadmin"), + // ClientConnectionPort: to.Ptr[int32](19000), + // ClusterCertificateThumbprints: []*string{ + // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), + // }, + // ClusterCodeVersion: to.Ptr("7.1.168.9494"), + // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), + // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), + // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), + // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), + // DNSName: to.Ptr("myCluster"), + // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ + // { + // Name: to.Ptr("ManagedIdentityTokenService"), + // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ + // { + // Name: to.Ptr("IsEnabled"), + // Value: to.Ptr("true"), + // }, + // }, + // }, + // }, + // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), + // HTTPGatewayConnectionPort: to.Ptr[int32](19080), + // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ + // { + // BackendPort: to.Ptr[int32](80), + // FrontendPort: to.Ptr[int32](80), + // ProbePort: to.Ptr[int32](80), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), + // }, + // { + // BackendPort: to.Ptr[int32](443), + // FrontendPort: to.Ptr[int32](443), + // ProbePort: to.Ptr[int32](443), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), + // }, + // { + // BackendPort: to.Ptr[int32](10000), + // FrontendPort: to.Ptr[int32](10000), + // ProbePort: to.Ptr[int32](10000), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolTCP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.ProtocolTCP), + // }, + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // }, + // SKU: &armservicefabricmanagedclusters.SKU{ + // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-03-01-preview/ManagedClusterListByResourceGroupOperation_example.json +func ExampleManagedClustersClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedClustersClient().NewListByResourceGroupPager("resRg", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armservicefabricmanagedclusters.ManagedClustersClientListByResourceGroupResponse{ + // ManagedClusterListResult: armservicefabricmanagedclusters.ManagedClusterListResult{ + // NextLink: to.Ptr("http://examplelink.com"), + // Value: []*armservicefabricmanagedclusters.ManagedCluster{ + // { + // Name: to.Ptr("myCluster"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), + // Etag: to.Ptr("W/\"636462502169240745\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ + // AdminUserName: to.Ptr("vmadmin"), + // ClientConnectionPort: to.Ptr[int32](19000), + // ClusterCertificateThumbprints: []*string{ + // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), + // }, + // ClusterCodeVersion: to.Ptr("7.1.168.9494"), + // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), + // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), + // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), + // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), + // DNSName: to.Ptr("myCluster"), + // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ + // { + // Name: to.Ptr("ManagedIdentityTokenService"), + // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ + // { + // Name: to.Ptr("IsEnabled"), + // Value: to.Ptr("true"), + // }, + // }, + // }, + // }, + // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), + // HTTPGatewayConnectionPort: to.Ptr[int32](19080), + // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // }, + // SKU: &armservicefabricmanagedclusters.SKU{ + // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // Name: to.Ptr("myCluster2"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), + // Etag: to.Ptr("W/\"636462502164040075\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster2"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ + // AdminUserName: to.Ptr("vmadmin"), + // ClientConnectionPort: to.Ptr[int32](19000), + // ClusterCertificateThumbprints: []*string{ + // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), + // }, + // ClusterCodeVersion: to.Ptr("7.1.168.9494"), + // ClusterID: to.Ptr("2747e469-b24e-4039-8a0a-46151419523f"), + // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), + // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), + // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), + // DNSName: to.Ptr("myCluster2"), + // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ + // { + // Name: to.Ptr("ManagedIdentityTokenService"), + // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ + // { + // Name: to.Ptr("IsEnabled"), + // Value: to.Ptr("true"), + // }, + // }, + // }, + // }, + // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), + // HTTPGatewayConnectionPort: to.Ptr[int32](19080), + // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // }, + // SKU: &armservicefabricmanagedclusters.SKU{ + // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-03-01-preview/ManagedClusterListBySubscriptionOperation_example.json +func ExampleManagedClustersClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedClustersClient().NewListBySubscriptionPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armservicefabricmanagedclusters.ManagedClustersClientListBySubscriptionResponse{ + // ManagedClusterListResult: armservicefabricmanagedclusters.ManagedClusterListResult{ + // NextLink: to.Ptr("http://examplelink.com"), + // Value: []*armservicefabricmanagedclusters.ManagedCluster{ + // { + // Name: to.Ptr("myCluster"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), + // Etag: to.Ptr("W/\"636462502169240745\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ + // AdminUserName: to.Ptr("vmadmin"), + // ClientConnectionPort: to.Ptr[int32](19000), + // ClusterCertificateThumbprints: []*string{ + // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), + // }, + // ClusterCodeVersion: to.Ptr("7.1.168.9494"), + // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), + // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), + // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), + // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), + // DNSName: to.Ptr("myCluster"), + // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ + // { + // Name: to.Ptr("ManagedIdentityTokenService"), + // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ + // { + // Name: to.Ptr("IsEnabled"), + // Value: to.Ptr("true"), + // }, + // }, + // }, + // }, + // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), + // HTTPGatewayConnectionPort: to.Ptr[int32](19080), + // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // }, + // SKU: &armservicefabricmanagedclusters.SKU{ + // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // Name: to.Ptr("myCluster2"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), + // Etag: to.Ptr("W/\"636462502164040075\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster2"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ + // AdminUserName: to.Ptr("vmadmin"), + // ClientConnectionPort: to.Ptr[int32](19000), + // ClusterCertificateThumbprints: []*string{ + // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), + // }, + // ClusterCodeVersion: to.Ptr("7.1.168.9494"), + // ClusterID: to.Ptr("2747e469-b24e-4039-8a0a-46151419523f"), + // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), + // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), + // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), + // DNSName: to.Ptr("myCluster2"), + // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ + // { + // Name: to.Ptr("ManagedIdentityTokenService"), + // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ + // { + // Name: to.Ptr("IsEnabled"), + // Value: to.Ptr("true"), + // }, + // }, + // }, + // }, + // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), + // HTTPGatewayConnectionPort: to.Ptr[int32](19080), + // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // }, + // SKU: &armservicefabricmanagedclusters.SKU{ + // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-03-01-preview/ManagedClusterPatchOperation_example.json +func ExampleManagedClustersClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClustersClient().Update(ctx, "resRg", "myCluster", armservicefabricmanagedclusters.ManagedClusterUpdateParameters{ + Tags: map[string]*string{ + "a": to.Ptr("b"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ManagedClustersClientUpdateResponse{ + // ManagedCluster: &armservicefabricmanagedclusters.ManagedCluster{ + // Name: to.Ptr("myCluster"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters"), + // Etag: to.Ptr("W/\"636462502169240745\""), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster"), + // Location: to.Ptr("eastus"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterProperties{ + // AddonFeatures: []*armservicefabricmanagedclusters.ManagedClusterAddOnFeature{ + // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureDNSService), + // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureBackupRestoreService), + // to.Ptr(armservicefabricmanagedclusters.ManagedClusterAddOnFeatureResourceMonitorService), + // }, + // AdminUserName: to.Ptr("vmadmin"), + // AllowRdpAccess: to.Ptr(true), + // ClientConnectionPort: to.Ptr[int32](19001), + // ClusterCertificateThumbprints: []*string{ + // to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), + // }, + // ClusterCodeVersion: to.Ptr("7.1.168.9494"), + // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), + // ClusterState: to.Ptr(armservicefabricmanagedclusters.ClusterStateWaitingForNodes), + // ClusterUpgradeCadence: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeCadenceWave0), + // ClusterUpgradeMode: to.Ptr(armservicefabricmanagedclusters.ClusterUpgradeModeAutomatic), + // DNSName: to.Ptr("myCluster"), + // EnableAutoOSUpgrade: to.Ptr(true), + // FabricSettings: []*armservicefabricmanagedclusters.SettingsSectionDescription{ + // { + // Name: to.Ptr("ManagedIdentityTokenService"), + // Parameters: []*armservicefabricmanagedclusters.SettingsParameterDescription{ + // { + // Name: to.Ptr("IsEnabled"), + // Value: to.Ptr("false"), + // }, + // }, + // }, + // }, + // Fqdn: to.Ptr("MyCluster.eastus.cloudapp.azure.com"), + // HTTPGatewayConnectionPort: to.Ptr[int32](19081), + // LoadBalancingRules: []*armservicefabricmanagedclusters.LoadBalancingRule{ + // { + // BackendPort: to.Ptr[int32](80), + // FrontendPort: to.Ptr[int32](80), + // ProbePort: to.Ptr[int32](80), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), + // }, + // { + // BackendPort: to.Ptr[int32](443), + // FrontendPort: to.Ptr[int32](443), + // ProbePort: to.Ptr[int32](443), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.Protocol("http")), + // }, + // { + // BackendPort: to.Ptr[int32](10000), + // FrontendPort: to.Ptr[int32](10000), + // ProbePort: to.Ptr[int32](10000), + // ProbeProtocol: to.Ptr(armservicefabricmanagedclusters.ProbeProtocolHTTP), + // Protocol: to.Ptr(armservicefabricmanagedclusters.ProtocolTCP), + // }, + // }, + // NetworkSecurityRules: []*armservicefabricmanagedclusters.NetworkSecurityRule{ + // { + // Name: to.Ptr("TestName"), + // Description: to.Ptr("Test description"), + // Access: to.Ptr(armservicefabricmanagedclusters.AccessAllow), + // DestinationAddressPrefixes: []*string{ + // to.Ptr("*"), + // }, + // DestinationPortRanges: []*string{ + // to.Ptr("*"), + // }, + // Direction: to.Ptr(armservicefabricmanagedclusters.DirectionInbound), + // Priority: to.Ptr[int32](1010), + // SourceAddressPrefixes: []*string{ + // to.Ptr("*"), + // }, + // SourcePortRanges: []*string{ + // to.Ptr("*"), + // }, + // Protocol: to.Ptr(armservicefabricmanagedclusters.NsgProtocolTCP), + // }, + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // }, + // SKU: &armservicefabricmanagedclusters.SKU{ + // Name: to.Ptr(armservicefabricmanagedclusters.SKUNameStandard), + // }, + // Tags: map[string]*string{ + // "a": to.Ptr("b"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusterversion_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusterversion_client.go index 0eadb01e608f..8184b0ff6cc9 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusterversion_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusterversion_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ManagedClusterVersionClient struct { } // NewManagedClusterVersionClient creates a new instance of ManagedClusterVersionClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedClusterVersionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedClusterVersionClient, error) { @@ -43,10 +39,12 @@ func NewManagedClusterVersionClient(subscriptionID string, credential azcore.Tok return client, nil } -// Get - Gets information about an available Service Fabric managed cluster code version. +// Get - Gets information about a Service Fabric managed cluster code version available in the specified location. +// +// Gets information about an available Service Fabric managed cluster code version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview // - location - The location for the cluster code versions. This is different from cluster location. // - clusterVersion - The cluster code version. // - options - ManagedClusterVersionClientGetOptions contains the optional parameters for the ManagedClusterVersionClient.Get @@ -74,16 +72,16 @@ func (client *ManagedClusterVersionClient) Get(ctx context.Context, location str } // getCreateRequest creates the Get request. -func (client *ManagedClusterVersionClient) getCreateRequest(ctx context.Context, location string, clusterVersion string, options *ManagedClusterVersionClientGetOptions) (*policy.Request, error) { +func (client *ManagedClusterVersionClient) getCreateRequest(ctx context.Context, location string, clusterVersion string, _ *ManagedClusterVersionClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if clusterVersion == "" { return nil, errors.New("parameter clusterVersion cannot be empty") } @@ -93,7 +91,7 @@ func (client *ManagedClusterVersionClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,12 +106,14 @@ func (client *ManagedClusterVersionClient) getHandleResponse(resp *http.Response return result, nil } -// GetByEnvironment - Gets information about an available Service Fabric cluster code version by environment. +// GetByEnvironment - Gets information about a Service Fabric cluster code version available for the specified environment. +// +// Gets information about an available Service Fabric cluster code version by environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview // - location - The location for the cluster code versions. This is different from cluster location. -// - environment - The operating system of the cluster. The default means all. +// - environment - The operating system of the cluster. // - clusterVersion - The cluster code version. // - options - ManagedClusterVersionClientGetByEnvironmentOptions contains the optional parameters for the ManagedClusterVersionClient.GetByEnvironment // method. @@ -140,8 +140,12 @@ func (client *ManagedClusterVersionClient) GetByEnvironment(ctx context.Context, } // getByEnvironmentCreateRequest creates the GetByEnvironment request. -func (client *ManagedClusterVersionClient) getByEnvironmentCreateRequest(ctx context.Context, location string, environment ManagedClusterVersionEnvironment, clusterVersion string, options *ManagedClusterVersionClientGetByEnvironmentOptions) (*policy.Request, error) { +func (client *ManagedClusterVersionClient) getByEnvironmentCreateRequest(ctx context.Context, location string, environment ManagedClusterVersionEnvironment, clusterVersion string, _ *ManagedClusterVersionClientGetByEnvironmentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions/{clusterVersion}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if location == "" { return nil, errors.New("parameter location cannot be empty") } @@ -150,10 +154,6 @@ func (client *ManagedClusterVersionClient) getByEnvironmentCreateRequest(ctx con return nil, errors.New("parameter environment cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{environment}", url.PathEscape(string(environment))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if clusterVersion == "" { return nil, errors.New("parameter clusterVersion cannot be empty") } @@ -163,7 +163,7 @@ func (client *ManagedClusterVersionClient) getByEnvironmentCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,10 +178,12 @@ func (client *ManagedClusterVersionClient) getByEnvironmentHandleResponse(resp * return result, nil } -// List - Gets all available code versions for Service Fabric cluster resources by location. +// List - Gets the list of Service Fabric cluster code versions available for the specified location. +// +// Gets all available code versions for Service Fabric cluster resources by location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview // - location - The location for the cluster code versions. This is different from cluster location. // - options - ManagedClusterVersionClientListOptions contains the optional parameters for the ManagedClusterVersionClient.List // method. @@ -208,22 +210,22 @@ func (client *ManagedClusterVersionClient) List(ctx context.Context, location st } // listCreateRequest creates the List request. -func (client *ManagedClusterVersionClient) listCreateRequest(ctx context.Context, location string, options *ManagedClusterVersionClientListOptions) (*policy.Request, error) { +func (client *ManagedClusterVersionClient) listCreateRequest(ctx context.Context, location string, _ *ManagedClusterVersionClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,12 +240,14 @@ func (client *ManagedClusterVersionClient) listHandleResponse(resp *http.Respons return result, nil } -// ListByEnvironment - Gets all available code versions for Service Fabric cluster resources by environment. +// ListByEnvironment - Gets the list of Service Fabric cluster code versions available for the specified environment. +// +// Gets all available code versions for Service Fabric cluster resources by environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview // - location - The location for the cluster code versions. This is different from cluster location. -// - environment - The operating system of the cluster. The default means all. +// - environment - The operating system of the cluster. // - options - ManagedClusterVersionClientListByEnvironmentOptions contains the optional parameters for the ManagedClusterVersionClient.ListByEnvironment // method. func (client *ManagedClusterVersionClient) ListByEnvironment(ctx context.Context, location string, environment ManagedClusterVersionEnvironment, options *ManagedClusterVersionClientListByEnvironmentOptions) (ManagedClusterVersionClientListByEnvironmentResponse, error) { @@ -269,8 +273,12 @@ func (client *ManagedClusterVersionClient) ListByEnvironment(ctx context.Context } // listByEnvironmentCreateRequest creates the ListByEnvironment request. -func (client *ManagedClusterVersionClient) listByEnvironmentCreateRequest(ctx context.Context, location string, environment ManagedClusterVersionEnvironment, options *ManagedClusterVersionClientListByEnvironmentOptions) (*policy.Request, error) { +func (client *ManagedClusterVersionClient) listByEnvironmentCreateRequest(ctx context.Context, location string, environment ManagedClusterVersionEnvironment, _ *ManagedClusterVersionClientListByEnvironmentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if location == "" { return nil, errors.New("parameter location cannot be empty") } @@ -279,16 +287,12 @@ func (client *ManagedClusterVersionClient) listByEnvironmentCreateRequest(ctx co return nil, errors.New("parameter environment cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{environment}", url.PathEscape(string(environment))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusterversion_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusterversion_client_example_test.go index fdcd591a2184..c32c702d9005 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusterversion_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedclusterversion_client_example_test.go @@ -1,30 +1,24 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterVersionGet_example.json +// Generated from example definition: 2025-03-01-preview/ManagedClusterVersionGet_example.json func ExampleManagedClusterVersionClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,26 +29,28 @@ func ExampleManagedClusterVersionClient_Get() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedClusterCodeVersionResult = armservicefabricmanagedclusters.ManagedClusterCodeVersionResult{ - // Name: to.Ptr("7.2.477.9590"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.477.9590"), - // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ - // ClusterCodeVersion: to.Ptr("7.2.477.9590"), - // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), - // SupportExpiryUTC: to.Ptr("2021-11-30T00:00:00"), + // res = armservicefabricmanagedclusters.ManagedClusterVersionClientGetResponse{ + // ManagedClusterCodeVersionResult: &armservicefabricmanagedclusters.ManagedClusterCodeVersionResult{ + // Name: to.Ptr("7.2.477.9590"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.477.9590"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ + // ClusterCodeVersion: to.Ptr("7.2.477.9590"), + // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), + // SupportExpiryUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T00:00:00"); return t}()), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterVersionGetByEnvironment_example.json +// Generated from example definition: 2025-03-01-preview/ManagedClusterVersionGetByEnvironment_example.json func ExampleManagedClusterVersionClient_GetByEnvironment() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -65,26 +61,28 @@ func ExampleManagedClusterVersionClient_GetByEnvironment() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedClusterCodeVersionResult = armservicefabricmanagedclusters.ManagedClusterCodeVersionResult{ - // Name: to.Ptr("7.2.477.9590"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.477.9590"), - // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ - // ClusterCodeVersion: to.Ptr("7.2.477.9590"), - // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), - // SupportExpiryUTC: to.Ptr("2021-11-30T00:00:00"), + // res = armservicefabricmanagedclusters.ManagedClusterVersionClientGetByEnvironmentResponse{ + // ManagedClusterCodeVersionResult: &armservicefabricmanagedclusters.ManagedClusterCodeVersionResult{ + // Name: to.Ptr("7.2.477.9590"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.477.9590"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ + // ClusterCodeVersion: to.Ptr("7.2.477.9590"), + // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), + // SupportExpiryUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T00:00:00"); return t}()), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterVersionList_example.json +// Generated from example definition: 2025-03-01-preview/ManagedClusterVersionList_example.json func ExampleManagedClusterVersionClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -95,37 +93,40 @@ func ExampleManagedClusterVersionClient_List() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedClusterCodeVersionResultArray = []*armservicefabricmanagedclusters.ManagedClusterCodeVersionResult{ - // { - // Name: to.Ptr("7.2.457.9590"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.457.9590"), - // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ - // ClusterCodeVersion: to.Ptr("7.2.457.9590"), - // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), - // SupportExpiryUTC: to.Ptr("2021-11-30T00:00:00"), + // res = armservicefabricmanagedclusters.ManagedClusterVersionClientListResponse{ + // undefined: &[]*armservicefabricmanagedclusters.ManagedClusterCodeVersionResult{ + // { + // Name: to.Ptr("7.2.457.9590"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.457.9590"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ + // ClusterCodeVersion: to.Ptr("7.2.457.9590"), + // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), + // SupportExpiryUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T00:00:00"); return t}()), + // }, // }, - // }, - // { - // Name: to.Ptr("7.2.477.9590"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.477.9590"), - // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ - // ClusterCodeVersion: to.Ptr("7.2.477.9590"), - // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), - // SupportExpiryUTC: to.Ptr("2021-11-30T00:00:00"), + // { + // Name: to.Ptr("7.2.477.9590"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.477.9590"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ + // ClusterCodeVersion: to.Ptr("7.2.477.9590"), + // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), + // SupportExpiryUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T00:00:00"); return t}()), + // }, // }, - // }} + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterVersionListByEnvironment.json +// Generated from example definition: 2025-03-01-preview/ManagedClusterVersionListByEnvironment.json func ExampleManagedClusterVersionClient_ListByEnvironment() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -136,25 +137,28 @@ func ExampleManagedClusterVersionClient_ListByEnvironment() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedClusterCodeVersionResultArray = []*armservicefabricmanagedclusters.ManagedClusterCodeVersionResult{ - // { - // Name: to.Ptr("7.2.457.9590"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.457.9590"), - // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ - // ClusterCodeVersion: to.Ptr("7.2.457.9590"), - // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), - // SupportExpiryUTC: to.Ptr("2021-11-30T00:00:00"), + // res = armservicefabricmanagedclusters.ManagedClusterVersionClientListByEnvironmentResponse{ + // undefined: &[]*armservicefabricmanagedclusters.ManagedClusterCodeVersionResult{ + // { + // Name: to.Ptr("7.2.457.9590"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.457.9590"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ + // ClusterCodeVersion: to.Ptr("7.2.457.9590"), + // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), + // SupportExpiryUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T00:00:00"); return t}()), + // }, // }, - // }, - // { - // Name: to.Ptr("7.2.477.9590"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.477.9590"), - // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ - // ClusterCodeVersion: to.Ptr("7.2.477.9590"), - // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), - // SupportExpiryUTC: to.Ptr("2021-11-30T00:00:00"), + // { + // Name: to.Ptr("7.2.477.9590"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/managedClusterVersions"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/managedClusterVersions/7.2.477.9590"), + // Properties: &armservicefabricmanagedclusters.ManagedClusterVersionDetails{ + // ClusterCodeVersion: to.Ptr("7.2.477.9590"), + // OSType: to.Ptr(armservicefabricmanagedclusters.OsTypeWindows), + // SupportExpiryUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T00:00:00"); return t}()), + // }, // }, - // }} + // }, + // } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedmaintenancewindowstatus_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedmaintenancewindowstatus_client.go index eb9dcdab4aaa..8d19a4cbada8 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedmaintenancewindowstatus_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedmaintenancewindowstatus_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ManagedMaintenanceWindowStatusClient struct { } // NewManagedMaintenanceWindowStatusClient creates a new instance of ManagedMaintenanceWindowStatusClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedMaintenanceWindowStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedMaintenanceWindowStatusClient, error) { @@ -46,8 +42,8 @@ func NewManagedMaintenanceWindowStatusClient(subscriptionID string, credential a // Get - Action to get Maintenance Window Status of the Service Fabric Managed Clusters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - options - ManagedMaintenanceWindowStatusClientGetOptions contains the optional parameters for the ManagedMaintenanceWindowStatusClient.Get // method. @@ -74,8 +70,12 @@ func (client *ManagedMaintenanceWindowStatusClient) Get(ctx context.Context, res } // getCreateRequest creates the Get request. -func (client *ManagedMaintenanceWindowStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ManagedMaintenanceWindowStatusClientGetOptions) (*policy.Request, error) { +func (client *ManagedMaintenanceWindowStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ManagedMaintenanceWindowStatusClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getMaintenanceWindowStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -84,16 +84,12 @@ func (client *ManagedMaintenanceWindowStatusClient) getCreateRequest(ctx context return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedmaintenancewindowstatus_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedmaintenancewindowstatus_client_example_test.go index 07cd5e247502..7e51404d9639 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedmaintenancewindowstatus_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedmaintenancewindowstatus_client_example_test.go @@ -1,30 +1,24 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedMaintenanceWindowStatusGet_example.json +// Generated from example definition: 2025-03-01-preview/ManagedMaintenanceWindowStatusGet_example.json func ExampleManagedMaintenanceWindowStatusClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,13 +29,15 @@ func ExampleManagedMaintenanceWindowStatusClient_Get() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedMaintenanceWindowStatus = armservicefabricmanagedclusters.ManagedMaintenanceWindowStatus{ - // CanApplyUpdates: to.Ptr(true), - // IsRegionReady: to.Ptr(true), - // IsWindowActive: to.Ptr(true), - // IsWindowEnabled: to.Ptr(false), - // LastWindowEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-30T00:00:00.000Z"); return t}()), - // LastWindowStartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-30T00:00:00.000Z"); return t}()), - // LastWindowStatusUpdateAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-30T00:00:00.000Z"); return t}()), + // res = armservicefabricmanagedclusters.ManagedMaintenanceWindowStatusClientGetResponse{ + // ManagedMaintenanceWindowStatus: &armservicefabricmanagedclusters.ManagedMaintenanceWindowStatus{ + // CanApplyUpdates: to.Ptr(true), + // IsRegionReady: to.Ptr(true), + // IsWindowActive: to.Ptr(true), + // IsWindowEnabled: to.Ptr(false), + // LastWindowEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-30T00:00:00"); return t}()), + // LastWindowStartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-30T00:00:00"); return t}()), + // LastWindowStatusUpdateAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-30T00:00:00"); return t}()), + // }, // } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedunsupportedvmsizes_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedunsupportedvmsizes_client.go index 67cdf9de3668..55829c8356e5 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedunsupportedvmsizes_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedunsupportedvmsizes_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ManagedUnsupportedVMSizesClient struct { } // NewManagedUnsupportedVMSizesClient creates a new instance of ManagedUnsupportedVMSizesClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedUnsupportedVMSizesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedUnsupportedVMSizesClient, error) { @@ -46,7 +42,7 @@ func NewManagedUnsupportedVMSizesClient(subscriptionID string, credential azcore // Get - Get unsupported vm size for Service Fabric Managed Clusters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview // - location - The location for the cluster code versions. This is different from cluster location. // - vmSize - VM Size name. // - options - ManagedUnsupportedVMSizesClientGetOptions contains the optional parameters for the ManagedUnsupportedVMSizesClient.Get @@ -74,16 +70,16 @@ func (client *ManagedUnsupportedVMSizesClient) Get(ctx context.Context, location } // getCreateRequest creates the Get request. -func (client *ManagedUnsupportedVMSizesClient) getCreateRequest(ctx context.Context, location string, vmSize string, options *ManagedUnsupportedVMSizesClientGetOptions) (*policy.Request, error) { +func (client *ManagedUnsupportedVMSizesClient) getCreateRequest(ctx context.Context, location string, vmSize string, _ *ManagedUnsupportedVMSizesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if vmSize == "" { return nil, errors.New("parameter vmSize cannot be empty") } @@ -93,7 +89,7 @@ func (client *ManagedUnsupportedVMSizesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +106,7 @@ func (client *ManagedUnsupportedVMSizesClient) getHandleResponse(resp *http.Resp // NewListPager - Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview // - location - The location for the cluster code versions. This is different from cluster location. // - options - ManagedUnsupportedVMSizesClientListOptions contains the optional parameters for the ManagedUnsupportedVMSizesClient.NewListPager // method. @@ -138,22 +134,22 @@ func (client *ManagedUnsupportedVMSizesClient) NewListPager(location string, opt } // listCreateRequest creates the List request. -func (client *ManagedUnsupportedVMSizesClient) listCreateRequest(ctx context.Context, location string, options *ManagedUnsupportedVMSizesClientListOptions) (*policy.Request, error) { +func (client *ManagedUnsupportedVMSizesClient) listCreateRequest(ctx context.Context, location string, _ *ManagedUnsupportedVMSizesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedunsupportedvmsizes_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedunsupportedvmsizes_client_example_test.go index f2c2dcaaf399..8640ca1e8639 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedunsupportedvmsizes_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/managedunsupportedvmsizes_client_example_test.go @@ -1,30 +1,54 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/managedUnsupportedVMSizesList_example.json +// Generated from example definition: 2025-03-01-preview/managedUnsupportedVMSizesGet_example.json +func ExampleManagedUnsupportedVMSizesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedUnsupportedVMSizesClient().Get(ctx, "eastus", "Standard_B1ls1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ManagedUnsupportedVMSizesClientGetResponse{ + // ManagedVMSize: &armservicefabricmanagedclusters.ManagedVMSize{ + // Name: to.Ptr("Standard_B1ls1"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B1ls1"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_B1ls1"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-03-01-preview/managedUnsupportedVMSizesList_example.json func ExampleManagedUnsupportedVMSizesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,196 +63,171 @@ func ExampleManagedUnsupportedVMSizesClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedVMSizesResult = armservicefabricmanagedclusters.ManagedVMSizesResult{ - // Value: []*armservicefabricmanagedclusters.ManagedVMSize{ - // { - // Name: to.Ptr("Standard_B1ls1"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B1ls1"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_B1ls1"), - // }, - // }, - // { - // Name: to.Ptr("Standard_B1s"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B1s"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_B1s"), - // }, - // }, - // { - // Name: to.Ptr("Standard_B1ms"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B1ms"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_B1ms"), - // }, - // }, - // { - // Name: to.Ptr("Standard_B2s"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B2s"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_B2s"), - // }, - // }, - // { - // Name: to.Ptr("Standard_B2ms"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B2ms"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_B2ms"), - // }, - // }, - // { - // Name: to.Ptr("Standard_B4ms"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B4ms"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_B4ms"), - // }, - // }, - // { - // Name: to.Ptr("Standard_B8ms"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B8ms"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_B8ms"), - // }, - // }, - // { - // Name: to.Ptr("Standard_A1_v2"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A1_v2"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_A1_v2"), - // }, - // }, - // { - // Name: to.Ptr("Standard_A2_v2"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A2_v2"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_A2_v2"), - // }, - // }, - // { - // Name: to.Ptr("Standard_A4_v2"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A4_v2"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_A4_v2"), - // }, - // }, - // { - // Name: to.Ptr("Standard_A8_v2"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A8_v2"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_A8_v2"), - // }, - // }, - // { - // Name: to.Ptr("Standard_A2m_v2"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A2m_v2"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_A2m_v2"), - // }, - // }, - // { - // Name: to.Ptr("Standard_A4m_v2"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A4m_v2"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_A4m_v2"), - // }, - // }, - // { - // Name: to.Ptr("Standard_A8m_v2"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A8m_v2"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_A8m_v2"), - // }, - // }, - // { - // Name: to.Ptr("Basic_A0"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A0"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Basic_A0"), - // }, - // }, - // { - // Name: to.Ptr("Basic_A1"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A1"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Basic_A1"), - // }, - // }, - // { - // Name: to.Ptr("Basic_A2"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A2"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Basic_A2"), - // }, - // }, - // { - // Name: to.Ptr("Basic_A3"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A3"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Basic_A3"), - // }, - // }, - // { - // Name: to.Ptr("Basic_A4"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A4"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Basic_A4"), - // }, - // }, - // { - // Name: to.Ptr("Standard_A0"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A0"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_A0"), - // }, - // }}, + // page = armservicefabricmanagedclusters.ManagedUnsupportedVMSizesClientListResponse{ + // ManagedVMSizesResult: armservicefabricmanagedclusters.ManagedVMSizesResult{ + // Value: []*armservicefabricmanagedclusters.ManagedVMSize{ + // { + // Name: to.Ptr("Standard_B1ls1"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B1ls1"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_B1ls1"), + // }, + // }, + // { + // Name: to.Ptr("Standard_B1s"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B1s"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_B1s"), + // }, + // }, + // { + // Name: to.Ptr("Standard_B1ms"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B1ms"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_B1ms"), + // }, + // }, + // { + // Name: to.Ptr("Standard_B2s"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B2s"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_B2s"), + // }, + // }, + // { + // Name: to.Ptr("Standard_B2ms"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B2ms"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_B2ms"), + // }, + // }, + // { + // Name: to.Ptr("Standard_B4ms"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B4ms"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_B4ms"), + // }, + // }, + // { + // Name: to.Ptr("Standard_B8ms"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B8ms"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_B8ms"), + // }, + // }, + // { + // Name: to.Ptr("Standard_A1_v2"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A1_v2"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_A1_v2"), + // }, + // }, + // { + // Name: to.Ptr("Standard_A2_v2"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A2_v2"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_A2_v2"), + // }, + // }, + // { + // Name: to.Ptr("Standard_A4_v2"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A4_v2"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_A4_v2"), + // }, + // }, + // { + // Name: to.Ptr("Standard_A8_v2"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A8_v2"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_A8_v2"), + // }, + // }, + // { + // Name: to.Ptr("Standard_A2m_v2"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A2m_v2"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_A2m_v2"), + // }, + // }, + // { + // Name: to.Ptr("Standard_A4m_v2"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A4m_v2"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_A4m_v2"), + // }, + // }, + // { + // Name: to.Ptr("Standard_A8m_v2"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A8m_v2"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_A8m_v2"), + // }, + // }, + // { + // Name: to.Ptr("Basic_A0"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A0"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Basic_A0"), + // }, + // }, + // { + // Name: to.Ptr("Basic_A1"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A1"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Basic_A1"), + // }, + // }, + // { + // Name: to.Ptr("Basic_A2"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A2"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Basic_A2"), + // }, + // }, + // { + // Name: to.Ptr("Basic_A3"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A3"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Basic_A3"), + // }, + // }, + // { + // Name: to.Ptr("Basic_A4"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Basic_A4"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Basic_A4"), + // }, + // }, + // { + // Name: to.Ptr("Standard_A0"), + // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), + // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_A0"), + // Properties: &armservicefabricmanagedclusters.VMSize{ + // Size: to.Ptr("Standard_A0"), + // }, + // }, + // }, + // }, // } } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/managedUnsupportedVMSizesGet_example.json -func ExampleManagedUnsupportedVMSizesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedUnsupportedVMSizesClient().Get(ctx, "eastus", "Standard_B1ls1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedVMSize = armservicefabricmanagedclusters.ManagedVMSize{ - // Name: to.Ptr("Standard_B1ls1"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/managedVMSizes"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedVMSizes/Standard_B1ls1"), - // Properties: &armservicefabricmanagedclusters.VMSize{ - // Size: to.Ptr("Standard_B1ls1"), - // }, - // } -} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/models.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/models.go index 0b10db19409d..23096f5bee42 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/models.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/models.go @@ -1,19 +1,16 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters import "time" // AddRemoveIncrementalNamedPartitionScalingMechanism - Represents a scaling mechanism for adding or removing named partitions -// of a stateless service. Partition names are in the format '0','1'…'N-1'. +// of a stateless service. Partition names are in the format '0','1'...'N-1'. type AddRemoveIncrementalNamedPartitionScalingMechanism struct { - // REQUIRED; Specifies the mechanism associated with this scaling policy. + // CONSTANT; Specifies the mechanism associated with this scaling policy. + // Field has constant value ServiceScalingMechanismKindAddRemoveIncrementalNamedPartition, any specified value is ignored. Kind *ServiceScalingMechanismKind // REQUIRED; Maximum number of named partitions of the service. @@ -55,11 +52,12 @@ type ApplicationHealthPolicy struct { ConsiderWarningAsError *bool // REQUIRED; The maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to - // 100. The percentage represents the maximum tolerated percentage of deployed applications - // that can be unhealthy before the application is considered in error. This is calculated by dividing the number of unhealthy - // deployed applications over the number of nodes where the application is - // currently deployed on in the cluster. The computation rounds up to tolerate one failure on small numbers of nodes. Default - // percentage is zero. + // 100. + // The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application + // is considered in error. + // This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application + // is currently deployed on in the cluster. + // The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. MaxPercentUnhealthyDeployedApplications *int32 // The health policy used by default to evaluate the health of a service type. @@ -71,36 +69,37 @@ type ApplicationHealthPolicy struct { // ApplicationResource - The application resource. type ApplicationResource struct { + // READ-ONLY; The name of the application resource. + Name *string + // Describes the managed identities for an Azure resource. Identity *ManagedIdentity - // Resource location depends on the parent resource. + // The geo-location where the resource lives Location *string // The application resource properties. Properties *ApplicationResourceProperties - // Azure resource tags. + // Resource tags. Tags map[string]*string - // READ-ONLY; Azure resource identifier. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Azure resource name. - Name *string - - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Azure resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // ApplicationResourceList - The list of application resources. type ApplicationResourceList struct { + // REQUIRED; The ApplicationResource items on this page Value []*ApplicationResource - // READ-ONLY; URL to get the next set of application list results if there are any. + // The link to the next page of items NextLink *string } @@ -115,8 +114,8 @@ type ApplicationResourceProperties struct { // Describes the policy for a monitored application upgrade. UpgradePolicy *ApplicationUpgradePolicy - // The version of the application type as defined in the application manifest. This name must be the full Arm Resource ID - // for the referenced application type version. + // The version of the application type as defined in the application manifest. + // This name must be the full Arm Resource ID for the referenced application type version. Version *string // READ-ONLY; The current deployment or provisioning state, which only appears in the response @@ -125,33 +124,34 @@ type ApplicationResourceProperties struct { // ApplicationTypeResource - The application type name resource type ApplicationTypeResource struct { - // Resource location depends on the parent resource. - Location *string - // The application type name properties Properties *ApplicationTypeResourceProperties - // Azure resource tags. + // READ-ONLY; The name of the application type name resource. + Name *string + + // The geo-location where the resource lives + Location *string + + // Resource tags. Tags map[string]*string - // READ-ONLY; Azure resource identifier. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Azure resource name. - Name *string - - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Azure resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // ApplicationTypeResourceList - The list of application type names. type ApplicationTypeResourceList struct { + // REQUIRED; The ApplicationTypeResource items on this page Value []*ApplicationTypeResource - // READ-ONLY; URL to get the next set of application type list results if there are any. + // The link to the next page of items NextLink *string } @@ -169,34 +169,35 @@ type ApplicationTypeUpdateParameters struct { // ApplicationTypeVersionResource - An application type version resource for the specified application type name resource. type ApplicationTypeVersionResource struct { - // Resource location depends on the parent resource. - Location *string - // The properties of the application type version resource. Properties *ApplicationTypeVersionResourceProperties - // Azure resource tags. + // READ-ONLY; The application type version. + Name *string + + // The geo-location where the resource lives + Location *string + + // Resource tags. Tags map[string]*string - // READ-ONLY; Azure resource identifier. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Azure resource name. - Name *string - - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Azure resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // ApplicationTypeVersionResourceList - The list of application type version resources for the specified application type // name resource. type ApplicationTypeVersionResourceList struct { + // REQUIRED; The ApplicationTypeVersionResource items on this page Value []*ApplicationTypeVersionResource - // READ-ONLY; URL to get the next set of application type version list results if there are any. + // The link to the next page of items NextLink *string } @@ -222,7 +223,7 @@ type ApplicationTypeVersionsCleanupPolicy struct { MaxUnusedVersionsToKeep *int32 } -// ApplicationUpdateParameters - Application update request +// ApplicationUpdateParameters - Application update request. type ApplicationUpdateParameters struct { // Application update parameters Tags map[string]*string @@ -238,8 +239,8 @@ type ApplicationUpgradePolicy struct { ForceRestart *bool // Duration in seconds, to wait before a stateless instance is closed, to allow the active requests to drain gracefully. This - // would be effective when the instance is closing during the - // application/cluster upgrade, only for those instances which have a non-zero delay duration configured in the service description. + // would be effective when the instance is closing during the application/cluster upgrade, only for those instances which + // have a non-zero delay duration configured in the service description. InstanceCloseDelayDuration *int64 // Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters @@ -253,12 +254,13 @@ type ApplicationUpgradePolicy struct { UpgradeMode *RollingUpgradeMode // The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected - // issues. When this timeout expires, processing of the upgrade domain will - // proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values - // are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). + // issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. + // The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + // 32-bit integer). Unit is in seconds. UpgradeReplicaSetCheckTimeout *int64 } +// ApplicationUserAssignedIdentity - User assigned identity for the application. type ApplicationUserAssignedIdentity struct { // REQUIRED; The friendly name of user assigned identity. Name *string @@ -285,7 +287,8 @@ type AvailableOperationDisplay struct { // AveragePartitionLoadScalingTrigger - Represents a scaling trigger related to an average load of a metric/resource of a // partition. type AveragePartitionLoadScalingTrigger struct { - // REQUIRED; Specifies the trigger associated with this scaling policy. + // CONSTANT; Specifies the trigger associated with this scaling policy. + // Field has constant value ServiceScalingTriggerKindAveragePartitionLoadTrigger, any specified value is ignored. Kind *ServiceScalingTriggerKind // REQUIRED; The lower limit of the load below which a scale in operation should be performed. @@ -311,7 +314,8 @@ func (a *AveragePartitionLoadScalingTrigger) GetScalingTrigger() *ScalingTrigger // AverageServiceLoadScalingTrigger - Represents a scaling policy related to an average load of a metric/resource of a service. type AverageServiceLoadScalingTrigger struct { - // REQUIRED; Specifies the trigger associated with this scaling policy. + // CONSTANT; Specifies the trigger associated with this scaling policy. + // Field has constant value ServiceScalingTriggerKindAverageServiceLoadTrigger, any specified value is ignored. Kind *ServiceScalingTriggerKind // REQUIRED; The lower limit of the load below which a scale in operation should be performed. @@ -328,8 +332,8 @@ type AverageServiceLoadScalingTrigger struct { UpperLoadThreshold *float64 // REQUIRED; Flag determines whether only the load of primary replica should be considered for scaling. If set to true, then - // trigger will only consider the load of primary replicas of stateful service. If set to - // false, trigger will consider load of all replicas. This parameter cannot be set to true for stateless service. + // trigger will only consider the load of primary replicas of stateful service. If set to false, trigger will consider load + // of all replicas. This parameter cannot be set to true for stateless service. UseOnlyPrimaryLoad *bool } @@ -373,21 +377,20 @@ type ClusterHealthPolicy struct { // REQUIRED; The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% // of applications to be unhealthy, this value would be 10. // The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the cluster is - // considered in error. If the percentage is respected but there is at least one - // unhealthy application, the health is evaluated as Warning. This is calculated by dividing the number of unhealthy applications - // over the total number of application instances in the cluster, excluding - // applications of application types that are included in the ApplicationTypeHealthPolicyMap. The computation rounds up to - // tolerate one failure on small numbers of applications. Default percentage is - // zero. + // considered in error. + // If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning. + // This is calculated by dividing the number of unhealthy applications over the total number of application instances in the + // cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap. + // The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero. MaxPercentUnhealthyApplications *int32 // REQUIRED; The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes // to be unhealthy, this value would be 10. // The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster is considered - // in error. If the percentage is respected but there is at least one unhealthy - // node, the health is evaluated as Warning. The percentage is calculated by dividing the number of unhealthy nodes over the - // total number of nodes in the cluster. The computation rounds up to tolerate - // one failure on small numbers of nodes. Default percentage is zero. + // in error. + // If the percentage is respected but there is at least one unhealthy node, the health is evaluated as Warning. + // The percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the cluster. + // The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. // In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate // that. MaxPercentUnhealthyNodes *int32 @@ -418,24 +421,26 @@ type ClusterMonitoringPolicy struct { // ClusterUpgradeDeltaHealthPolicy - Describes the delta health policies for the cluster upgrade. type ClusterUpgradeDeltaHealthPolicy struct { - // REQUIRED; The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. The delta is measured - // between the state of the nodes at the beginning of upgrade and the state of the nodes - // at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion to make sure - // the global state of the cluster is within tolerated limits. + // REQUIRED; The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. + // The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time + // of the health evaluation. + // The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within + // tolerated limits. MaxPercentDeltaUnhealthyNodes *int32 - // The maximum allowed percentage of applications health degradation allowed during cluster upgrades. The delta is measured - // between the state of the applications at the beginning of upgrade and the state - // of the applications at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion - // to make sure the global state of the cluster is within tolerated limits. - // System services are not included in this. NOTE: This value will overwrite the value specified in properties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications + // The maximum allowed percentage of applications health degradation allowed during cluster upgrades. + // The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications + // at the time of the health evaluation. + // The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within + // tolerated limits. System services are not included in this. + // NOTE: This value will overwrite the value specified in properties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications MaxPercentDeltaUnhealthyApplications *int32 - // The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. The delta is - // measured between the state of the upgrade domain nodes at the beginning of - // upgrade and the state of the upgrade domain nodes at the time of the health evaluation. The check is performed after every - // upgrade domain upgrade completion for all completed upgrade domains to make - // sure the state of the upgrade domains is within tolerated limits. + // The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. + // The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade + // domain nodes at the time of the health evaluation. + // The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the + // state of the upgrade domains is within tolerated limits. MaxPercentUpgradeDomainDeltaUnhealthyNodes *int32 } @@ -455,10 +460,10 @@ type ClusterUpgradePolicy struct { MonitoringPolicy *ClusterMonitoringPolicy // The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected - // issues. When this timeout expires, processing of the upgrade domain will - // proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can - // be in either hh:mm:ss or in d.hh:mm:ss.ms format. This value must be between - // 00:00:00 and 49710.06:28:15 (unsigned 32 bit integer for seconds) + // issues. + // When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. + // The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + // This value must be between 00:00:00 and 49710.06:28:15 (unsigned 32 bit integer for seconds) UpgradeReplicaSetCheckTimeout *string } @@ -480,22 +485,95 @@ type ErrorModelError struct { Message *string } +// FaultSimulation - Fault simulation object with status. +type FaultSimulation struct { + // Fault simulation details + Details *FaultSimulationDetails + + // The end time of the fault simulation. + EndTime *time.Time + + // unique identifier for the fault simulation. + SimulationID *string + + // The start time of the fault simulation. + StartTime *time.Time + + // Fault simulation status + Status *FaultSimulationStatus +} + +// FaultSimulationConstraints - Constraints for Fault Simulation action. +type FaultSimulationConstraints struct { + // The absolute expiration timestamp (UTC) after which this fault simulation should be stopped if it's still active. + ExpirationTime *time.Time +} + +// FaultSimulationContent - Parameters for Fault Simulation action. +type FaultSimulationContent struct { + // REQUIRED; The kind of fault to be simulated. + FaultKind *FaultKind + + // Constraints for Fault Simulation action. + Constraints *FaultSimulationConstraints + + // Force the action to go through without any check on the cluster. + Force *bool +} + +// GetFaultSimulationContent implements the FaultSimulationContentClassification interface for type FaultSimulationContent. +func (f *FaultSimulationContent) GetFaultSimulationContent() *FaultSimulationContent { return f } + +// FaultSimulationContentWrapper - Fault Simulation Request for Start action. +type FaultSimulationContentWrapper struct { + // REQUIRED; Parameters for Fault Simulation start action. + Parameters FaultSimulationContentClassification +} + +// FaultSimulationDetails - Details for Fault Simulation. +type FaultSimulationDetails struct { + // unique identifier for the cluster resource. + ClusterID *string + + // List of node type simulations associated with the cluster fault simulation. + NodeTypeFaultSimulation []*NodeTypeFaultSimulation + + // unique identifier for the operation associated with the fault simulation. + OperationID *string + + // Fault simulation parameters. + Parameters FaultSimulationContentClassification +} + +// FaultSimulationIDContent - Parameters for Fault Simulation id. +type FaultSimulationIDContent struct { + // REQUIRED; unique identifier for the fault simulation. + SimulationID *string +} + +// FaultSimulationListResult - Fault simulation list results +type FaultSimulationListResult struct { + // REQUIRED; The FaultSimulation items on this page + Value []*FaultSimulation + + // The link to the next page of items + NextLink *string +} + // FrontendConfiguration - Describes the frontend configurations for the node type. type FrontendConfiguration struct { - // The resource Id of application gateway backend address pool. The format of the resource Id is '/subscriptions//resourceGroups//providers/Microsoft.Network/applicationGateways//backendAddressPools/'. + // The resource Id of application gateway backend address pool. The format of the resource Id is '/subscriptions//resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}'. ApplicationGatewayBackendAddressPoolID *string // The IP address type of this frontend configuration. If omitted the default value is IPv4. IPAddressType *IPAddressType // The resource Id of the Load Balancer backend address pool that the VM instances of the node type are associated with. The - // format of the resource Id is '/subscriptions//resourceGroups/ - // /providers/Microsoft.Network/loadBalancers//backendAddressPools/'. + // format of the resource Id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'. LoadBalancerBackendAddressPoolID *string // The resource Id of the Load Balancer inbound NAT pool that the VM instances of the node type are associated with. The format - // of the resource Id is '/subscriptions//resourceGroups/ - // /providers/Microsoft.Network/loadBalancers//inboundNatPools/'. + // of the resource Id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}'. LoadBalancerInboundNatPoolID *string } @@ -505,18 +583,15 @@ type IPConfiguration struct { Name *string // Specifies an array of references to backend address pools of application gateways. A node type can reference backend address - // pools of multiple application gateways. Multiple node types cannot use the - // same application gateway. + // pools of multiple application gateways. Multiple node types cannot use the same application gateway. ApplicationGatewayBackendAddressPools []*SubResource // Specifies an array of references to backend address pools of load balancers. A node type can reference backend address - // pools of one public and one internal load balancer. Multiple node types cannot - // use the same basic sku load balancer. + // pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer. LoadBalancerBackendAddressPools []*SubResource // Specifies an array of references to inbound Nat pools of the load balancers. A node type can reference inbound nat pools - // of one public and one internal load balancer. Multiple node types cannot use - // the same basic sku load balancer. + // of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer. LoadBalancerInboundNatPools []*SubResource // Specifies whether the IP configuration's private IP is IPv4 or IPv6. Default is IPv4. @@ -607,7 +682,7 @@ type ManagedAzResiliencyStatus struct { // ManagedCluster - The managed cluster resource type ManagedCluster struct { - // REQUIRED; Azure resource location. + // REQUIRED; The geo-location where the resource lives Location *string // REQUIRED; The sku of the managed cluster @@ -616,22 +691,25 @@ type ManagedCluster struct { // The managed cluster resource properties Properties *ManagedClusterProperties - // Azure resource tags. + // Resource tags. Tags map[string]*string - // READ-ONLY; Azure resource etag. + // READ-ONLY; The name of the cluster resource. + Name *string + + // READ-ONLY; If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. + // Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in + // the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header + // fields.", Etag *string - // READ-ONLY; Azure resource identifier. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Azure resource name. - Name *string - - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Azure resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -650,11 +728,13 @@ type ManagedClusterCodeVersionResult struct { Type *string } -// ManagedClusterListResult - Managed Cluster list results +// ManagedClusterListResult - The response of a ManagedCluster list operation. type ManagedClusterListResult struct { - // The URL to use for getting the next set of results. + // REQUIRED; The ManagedCluster items on this page + Value []*ManagedCluster + + // The link to the next page of items NextLink *string - Value []*ManagedCluster } // ManagedClusterProperties - Describes the managed cluster resource properties. @@ -676,8 +756,7 @@ type ManagedClusterProperties struct { AllocatedOutboundPorts *int32 // Setting this to true enables RDP access to the VM. The default NSG rule opens RDP port to Internet which can be overridden - // with custom Network Security Rules. The default value for this setting is - // false. + // with custom Network Security Rules. The default value for this setting is false. AllowRdpAccess *bool // The policy used to clean up unused versions. @@ -699,13 +778,13 @@ type ManagedClusterProperties struct { // Client certificates that are allowed to manage the cluster. Clients []*ClientCertificate - // The Service Fabric runtime version of the cluster. This property is required when clusterUpgradeMode is set to 'Manual'. - // To get list of available Service Fabric versions for new clusters use - // ClusterVersion API [./ClusterVersion.md]. To get the list of available version for existing clusters use availableClusterVersions. + // The Service Fabric runtime version of the cluster. This property is required when **clusterUpgradeMode** is set to 'Manual'. + // To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get + // the list of available version for existing clusters use **availableClusterVersions**. ClusterCodeVersion *string // Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only - // applies when clusterUpgradeMode is set to 'Automatic'. + // applies when **clusterUpgradeMode** is set to 'Automatic'. ClusterUpgradeCadence *ClusterUpgradeCadence // The upgrade mode of the cluster when new Service Fabric runtime version is available. @@ -719,8 +798,7 @@ type ManagedClusterProperties struct { EnableAutoOSUpgrade *bool // If true, token-based authentication is not allowed on the HttpGatewayEndpoint. This is required to support TLS versions - // 1.3 and above. If token-based authentication is used, - // HttpGatewayTokenAuthConnectionPort must be defined. + // 1.3 and above. If token-based authentication is used, HttpGatewayTokenAuthConnectionPort must be defined. EnableHTTPGatewayExclusiveAuthMode *bool // Setting this to true creates IPv6 address space for the default VNet used by the cluster. This setting cannot be changed @@ -760,9 +838,8 @@ type ManagedClusterProperties struct { // Service endpoints for subnets in the cluster. ServiceEndpoints []*ServiceEndpoint - // If specified, the node types for the cluster are created in this subnet instead of the default VNet. The networkSecurityRules - // specified for the cluster are also applied to this subnet. This setting - // cannot be changed once the cluster is created. + // If specified, the node types for the cluster are created in this subnet instead of the default VNet. The **networkSecurityRules** + // specified for the cluster are also applied to this subnet. This setting cannot be changed once the cluster is created. SubnetID *string // The policy to use when upgrading the cluster. @@ -772,6 +849,10 @@ type ManagedClusterProperties struct { // and for such clusters, the subnetId property is required for node types. UseCustomVnet *bool + // The VM image the node types are configured with. This property controls the Service Fabric component packages to be used + // for the cluster. Allowed values are: 'Windows'. The default value is 'Windows'. + VMImage *string + // Indicates if the cluster has zone resiliency. ZonalResiliency *bool @@ -815,7 +896,7 @@ type ManagedClusterVersionDetails struct { OSType *OsType // The date of expiry of support of the version. - SupportExpiryUTC *string + SupportExpiryUTC *time.Time } // ManagedIdentity - Describes the managed identities for an Azure resource. @@ -876,10 +957,10 @@ type ManagedVMSize struct { // ManagedVMSizesResult - Describes the result of the request to list Managed VM Sizes for Service Fabric Managed Clusters. type ManagedVMSizesResult struct { - // List of Managed VM Sizes for Service Fabric Managed Clusters. + // REQUIRED; The ManagedVMSize items on this page Value []*ManagedVMSize - // READ-ONLY; URL to get the next set of Managed VM Sizes if there are any. + // The link to the next page of items NextLink *string } @@ -888,7 +969,8 @@ type NamedPartitionScheme struct { // REQUIRED; Array for the names of the partitions. Names []*string - // REQUIRED; Specifies how the service is partitioned. + // CONSTANT; Specifies how the service is partitioned. + // Field has constant value PartitionSchemeNamed, any specified value is ignored. PartitionScheme *PartitionScheme } @@ -911,8 +993,8 @@ type NetworkSecurityRule struct { Name *string // REQUIRED; The priority of the rule. The value can be in the range 1000 to 3000. Values outside this range are reserved - // for Service Fabric ManagerCluster Resource Provider. The priority number must be unique for - // each rule in the collection. The lower the priority number, the higher the priority of the rule. + // for Service Fabric ManagerCluster Resource Provider. The priority number must be unique for each rule in the collection. + // The lower the priority number, the higher the priority of the rule. Priority *int32 // REQUIRED; Network protocol this rule applies to. @@ -922,8 +1004,7 @@ type NetworkSecurityRule struct { Description *string // The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default - // tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also - // be used. + // tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. DestinationAddressPrefix *string // The destination address prefixes. CIDR or destination IP ranges. @@ -936,8 +1017,8 @@ type NetworkSecurityRule struct { DestinationPortRanges []*string // The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', - // 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress - // rule, specifies where network traffic originates from. + // 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates + // from. SourceAddressPrefix *string // The CIDR or source IP ranges. @@ -958,19 +1039,19 @@ type NodeType struct { // The node type sku. SKU *NodeTypeSKU - // Azure resource tags. + // Resource tags. Tags map[string]*string - // READ-ONLY; Azure resource identifier. - ID *string - - // READ-ONLY; Azure resource name. + // READ-ONLY; The name of the node type. Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Azure resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -992,30 +1073,44 @@ type NodeTypeAvailableSKU struct { // READ-ONLY; Provides information about how the node count can be scaled. Capacity *NodeTypeSKUCapacity - // READ-ONLY; The type of resource the sku applies to. - // Value: Microsoft.ServiceFabric/managedClusters/nodeTypes. + // READ-ONLY; The type of resource the sku applies to. Value: Microsoft.ServiceFabric/managedClusters/nodeTypes. ResourceType *string // READ-ONLY; The supported SKU for a for node type. SKU *NodeTypeSupportedSKU } -// NodeTypeListResult - Node type list results -type NodeTypeListResult struct { - // The URL to use for getting the next set of results. - NextLink *string +// NodeTypeFaultSimulation - Node type fault simulation object with status. +type NodeTypeFaultSimulation struct { + // Node type name. + NodeTypeName *string + + // Current or latest asynchronous operation identifier on the node type. + OperationID *string - // The list of node types. + // Current or latest asynchronous operation status on the node type + OperationStatus *SfmcOperationStatus + + // Fault simulation status + Status *FaultSimulationStatus +} + +// NodeTypeListResult - The response of a NodeType list operation. +type NodeTypeListResult struct { + // REQUIRED; The NodeType items on this page Value []*NodeType + + // The link to the next page of items + NextLink *string } // NodeTypeListSKUResult - Node type available sku list results type NodeTypeListSKUResult struct { - // The URL to use for getting the next set of results. - NextLink *string - - // The list of available node type SKUs. + // REQUIRED; The NodeTypeAvailableSku items on this page Value []*NodeTypeAvailableSKU + + // The link to the next page of items + NextLink *string } // NodeTypeNatConfig - Provides information about NAT configuration on the default public Load Balancer for the node type. @@ -1036,11 +1131,8 @@ type NodeTypeProperties struct { // be changed once the node type is created. IsPrimary *bool - // REQUIRED; The number of nodes in the node type. - // Values: - // -1 - Use when auto scale rules are configured or sku.capacity is defined - // 0 - Not supported - // >0 - Use for manual scale. + // REQUIRED; The number of nodes in the node type. **Values:** -1 - Use when auto scale rules are configured or sku.capacity + // is defined 0 - Not supported >0 - Use for manual scale. VMInstanceCount *int32 // Additional managed data disks. @@ -1076,8 +1168,8 @@ type NodeTypeProperties struct { EnableAcceleratedNetworking *bool // Enable or disable the Host Encryption for the virtual machines on the node type. This will enable the encryption for all - // the disks including Resource/Temp disk at host itself. Default: The Encryption - // at host will be disabled unless this property is set to true for the resource. + // the disks including Resource/Temp disk at host itself. Default: The Encryption at host will be disabled unless this property + // is set to true for the resource. EnableEncryptionAtHost *bool // Specifies whether each node is allocated its own public IPv4 address. This is only supported on secondary node types with @@ -1098,8 +1190,7 @@ type NodeTypeProperties struct { EvictionPolicy *EvictionPolicyType // Indicates the node type uses its own frontend configurations instead of the default one for the cluster. This setting can - // only be specified for non-primary node types and can not be added or removed - // after the node type is created. + // only be specified for non-primary node types and can not be added or removed after the node type is created. FrontendConfigurations []*FrontendConfiguration // Specifies the full host group resource Id. This property is used for deploying on azure dedicated hosts. @@ -1130,10 +1221,16 @@ type NodeTypeProperties struct { // run. PlacementProperties map[string]*string - // Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch SecurityType + // Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch and ConfidentialVM + // SecurityType. SecureBootEnabled *bool - // Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported + // Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk + // along with VMGuestState blob and VMGuestStateOnly for encryption of just the VMGuestState blob. Note: It can be set for + // only Confidential VMs. + SecurityEncryptionType *SecurityEncryptionType + + // Specifies the security type of the nodeType. Supported values include Standard, TrustedLaunch and ConfidentialVM. SecurityType *SecurityType // Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when @@ -1147,18 +1244,16 @@ type NodeTypeProperties struct { SubnetID *string // Specifies whether the use public load balancer. If not specified and the node type doesn't have its own frontend configuration, - // it will be attached to the default load balancer. If the node type uses - // its own Load balancer and useDefaultPublicLoadBalancer is true, then the frontend has to be an Internal Load Balancer. - // If the node type uses its own Load balancer and useDefaultPublicLoadBalancer is - // false or not set, then the custom load balancer must include a public load balancer to provide outbound connectivity. + // it will be attached to the default load balancer. If the node type uses its own Load balancer and useDefaultPublicLoadBalancer + // is true, then the frontend has to be an Internal Load Balancer. If the node type uses its own Load balancer and useDefaultPublicLoadBalancer + // is false or not set, then the custom load balancer must include a public load balancer to provide outbound connectivity. UseDefaultPublicLoadBalancer *bool // Indicates whether to use ephemeral os disk. The sku selected on the vmSize property needs to support this feature. UseEphemeralOSDisk *bool // Specifies whether to use the temporary disk for the service fabric data root, in which case no managed data disk will be - // attached and the temporary disk will be used. It is only allowed for stateless - // node types. + // attached and the temporary disk will be used. It is only allowed for stateless node types. UseTempDataDisk *bool // Specifies the gallery applications that should be made available to the underlying VMSS. @@ -1171,10 +1266,9 @@ type NodeTypeProperties struct { VMImageOffer *string // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace - // images. Before you can use a marketplace image from an API, you must - // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click - // Want to deploy programmatically, Get Started ->. Enter any required - // information and then click Save. + // images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure + // portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. + // Enter any required information and then click Save. VMImagePlan *VMImagePlan // The publisher of the Azure Virtual Machines Marketplace image. For example, Canonical or MicrosoftWindowsServer. @@ -1205,6 +1299,9 @@ type NodeTypeProperties struct { // The size of virtual machines in the pool. All virtual machines in a pool are the same size. For example, Standard_D3. VMSize *string + // Setting this to true allows stateless node types to scale out without equal distribution across zones. + ZoneBalance *bool + // Specifies the availability zones where the node type would span across. If the cluster is not spanning across availability // zones, initiates az migration for the cluster. Zones []*string @@ -1215,19 +1312,14 @@ type NodeTypeProperties struct { // NodeTypeSKU - Describes a node type sku. type NodeTypeSKU struct { - // REQUIRED; The number of nodes in the node type. - // If present in request it will override properties.vmInstanceCount. + // REQUIRED; The number of nodes in the node type. If present in request it will override properties.vmInstanceCount. Capacity *int32 - // The sku name. - // Name is internally generated and is used in auto-scale scenarios. - // Property does not allow to be changed to other values than generated. - // To avoid deployment errors please omit the property. + // The sku name. Name is internally generated and is used in auto-scale scenarios. Property does not allow to be changed to + // other values than generated. To avoid deployment errors please omit the property. Name *string - // Specifies the tier of the node type. - // Possible Values: - // Standard + // Specifies the tier of the node type. Possible Values: **Standard** Tier *string } @@ -1251,9 +1343,7 @@ type NodeTypeSupportedSKU struct { // READ-ONLY; The sku name. Name *string - // READ-ONLY; Specifies the tier of the node type. - // Possible Values: - // Standard + // READ-ONLY; Specifies the tier of the node type. Possible Values: **Standard** Tier *string } @@ -1268,10 +1358,10 @@ type NodeTypeUpdateParameters struct { // OperationListResult - Describes the result of the request to list Service Fabric resource provider operations. type OperationListResult struct { - // List of operations supported by the Service Fabric resource provider. + // REQUIRED; The OperationResult items on this page Value []*OperationResult - // READ-ONLY; URL to get the next set of operation list results if there are any. + // The link to the next page of items NextLink *string } @@ -1295,7 +1385,7 @@ type OperationResult struct { // Partition - Describes how the service is partitioned. type Partition struct { - // REQUIRED; Specifies how the service is partitioned. + // REQUIRED PartitionScheme *PartitionScheme } @@ -1305,7 +1395,8 @@ func (p *Partition) GetPartition() *Partition { return p } // PartitionInstanceCountScaleMechanism - Represents a scaling mechanism for adding or removing instances of stateless service // partition. type PartitionInstanceCountScaleMechanism struct { - // REQUIRED; Specifies the mechanism associated with this scaling policy. + // CONSTANT; Specifies the mechanism associated with this scaling policy. + // Field has constant value ServiceScalingMechanismKindScalePartitionInstanceCount, any specified value is ignored. Kind *ServiceScalingMechanismKind // REQUIRED; Maximum number of instances of the partition. @@ -1343,19 +1434,16 @@ type ResourceAzStatus struct { // RollingUpgradeMonitoringPolicy - The policy used for monitoring the application upgrade type RollingUpgradeMonitoringPolicy struct { // REQUIRED; The compensating action to perform when a Monitored upgrade encounters monitoring policy or health policy violations. - // Invalid indicates the failure action is invalid. Rollback specifies that the - // upgrade will start rolling back automatically. Manual indicates that the upgrade will switch to UnmonitoredManual upgrade - // mode. + // Invalid indicates the failure action is invalid. Rollback specifies that the upgrade will start rolling back automatically. + // Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. FailureAction *FailureAction // REQUIRED; The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction - // is executed. It is interpreted as a string representing an ISO 8601 duration with - // following format "hh:mm:ss.fff". + // is executed. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". HealthCheckRetryTimeout *string // REQUIRED; The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next - // upgrade domain. It is interpreted as a string representing an ISO 8601 duration with - // following format "hh:mm:ss.fff". + // upgrade domain. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". HealthCheckStableDuration *string // REQUIRED; The amount of time to wait after completing an upgrade domain before applying health policies. It is interpreted @@ -1363,13 +1451,11 @@ type RollingUpgradeMonitoringPolicy struct { HealthCheckWaitDuration *string // REQUIRED; The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than - // 12 hours. It is interpreted as a string representing an ISO 8601 duration with following - // format "hh:mm:ss.fff". + // 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". UpgradeDomainTimeout *string // REQUIRED; The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than - // 12 hours. It is interpreted as a string representing an ISO 8601 duration with following - // format "hh:mm:ss.fff". + // 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". UpgradeTimeout *string } @@ -1387,7 +1473,7 @@ type SKU struct { // ScalingMechanism - Describes the mechanism for performing a scaling operation. type ScalingMechanism struct { - // REQUIRED; Specifies the mechanism associated with this scaling policy. + // REQUIRED Kind *ServiceScalingMechanismKind } @@ -1405,7 +1491,7 @@ type ScalingPolicy struct { // ScalingTrigger - Describes the trigger for performing a scaling operation. type ScalingTrigger struct { - // REQUIRED; Specifies the trigger associated with this scaling policy. + // REQUIRED Kind *ServiceScalingTriggerKind } @@ -1458,7 +1544,8 @@ type ServicePlacementInvalidDomainPolicy struct { // REQUIRED; The name of the domain that should not be used for placement. DomainName *string - // REQUIRED; The type of placement policy for a service fabric service. Following are the possible values. + // CONSTANT; The type of placement policy for a service fabric service. Following are the possible values. + // Field has constant value ServicePlacementPolicyTypeInvalidDomain, any specified value is ignored. Type *ServicePlacementPolicyType } @@ -1469,9 +1556,11 @@ func (s *ServicePlacementInvalidDomainPolicy) GetServicePlacementPolicy() *Servi } } -// ServicePlacementNonPartiallyPlaceServicePolicy +// ServicePlacementNonPartiallyPlaceServicePolicy - The type of placement policy for a service fabric service. Following are +// the possible values. type ServicePlacementNonPartiallyPlaceServicePolicy struct { - // REQUIRED; The type of placement policy for a service fabric service. Following are the possible values. + // CONSTANT; undefinedField has constant value ServicePlacementPolicyTypeNonPartiallyPlaceService, any specified value is + // ignored. Type *ServicePlacementPolicyType } @@ -1484,7 +1573,7 @@ func (s *ServicePlacementNonPartiallyPlaceServicePolicy) GetServicePlacementPoli // ServicePlacementPolicy - Describes the policy to be used for placement of a Service Fabric service. type ServicePlacementPolicy struct { - // REQUIRED; The type of placement policy for a service fabric service. Following are the possible values. + // REQUIRED Type *ServicePlacementPolicyType } @@ -1492,17 +1581,19 @@ type ServicePlacementPolicy struct { func (s *ServicePlacementPolicy) GetServicePlacementPolicy() *ServicePlacementPolicy { return s } // ServicePlacementPreferPrimaryDomainPolicy - Describes the policy to be used for placement of a Service Fabric service where -// the service's Primary replicas should optimally be placed in a particular domain. -// This placement policy is usually used with fault domains in scenarios where the Service Fabric cluster is geographically -// distributed in order to indicate that a service's primary replica should be -// located in a particular fault domain, which in geo-distributed scenarios usually aligns with regional or datacenter boundaries. -// Note that since this is an optimization it is possible that the Primary -// replica may not end up located in this domain due to failures, capacity limits, or other constraints. +// the service's +// Primary replicas should optimally be placed in a particular domain. +// This placement policy is usually used with fault domains in scenarios where the Service Fabric +// cluster is geographically distributed in order to indicate that a service's primary replica should +// be located in a particular fault domain, which in geo-distributed scenarios usually aligns with regional +// or datacenter boundaries. Note that since this is an optimization it is possible that the Primary replica +// may not end up located in this domain due to failures, capacity limits, or other constraints. type ServicePlacementPreferPrimaryDomainPolicy struct { // REQUIRED; The name of the domain that should used for placement as per this policy. DomainName *string - // REQUIRED; The type of placement policy for a service fabric service. Following are the possible values. + // CONSTANT; The type of placement policy for a service fabric service. Following are the possible values. + // Field has constant value ServicePlacementPolicyTypePreferredPrimaryDomain, any specified value is ignored. Type *ServicePlacementPolicyType } @@ -1514,17 +1605,20 @@ func (s *ServicePlacementPreferPrimaryDomainPolicy) GetServicePlacementPolicy() } // ServicePlacementRequireDomainDistributionPolicy - Describes the policy to be used for placement of a Service Fabric service -// where two replicas from the same partition should never be placed in the same fault or upgrade domain. -// While this is not common it can expose the service to an increased risk of concurrent failures due to unplanned outages -// or other cases of subsequent/concurrent failures. As an example, consider a case -// where replicas are deployed across different data center, with one replica per location. In the event that one of the datacenters -// goes offline, normally the replica that was placed in that datacenter -// will be packed into one of the remaining datacenters. If this is not desirable then this policy should be set. +// where two replicas +// from the same partition should never be placed in the same fault or upgrade domain. +// While this is not common it can expose the service to an increased risk of concurrent failures +// due to unplanned outages or other cases of subsequent/concurrent failures. As an example, consider +// a case where replicas are deployed across different data center, with one replica per location. +// In the event that one of the datacenters goes offline, normally the replica that was placed in that +// datacenter will be packed into one of the remaining datacenters. If this is not desirable then this +// policy should be set. type ServicePlacementRequireDomainDistributionPolicy struct { // REQUIRED; The name of the domain that should used for placement as per this policy. DomainName *string - // REQUIRED; The type of placement policy for a service fabric service. Following are the possible values. + // CONSTANT; The type of placement policy for a service fabric service. Following are the possible values. + // Field has constant value ServicePlacementPolicyTypeRequiredDomainDistribution, any specified value is ignored. Type *ServicePlacementPolicyType } @@ -1541,7 +1635,8 @@ type ServicePlacementRequiredDomainPolicy struct { // REQUIRED; The name of the domain that should used for placement as per this policy. DomainName *string - // REQUIRED; The type of placement policy for a service fabric service. Following are the possible values. + // CONSTANT; The type of placement policy for a service fabric service. Following are the possible values. + // Field has constant value ServicePlacementPolicyTypeRequiredDomain, any specified value is ignored. Type *ServicePlacementPolicyType } @@ -1554,33 +1649,34 @@ func (s *ServicePlacementRequiredDomainPolicy) GetServicePlacementPolicy() *Serv // ServiceResource - The service resource. type ServiceResource struct { - // Resource location depends on the parent resource. - Location *string - // The service resource properties. Properties ServiceResourcePropertiesClassification - // Azure resource tags. + // READ-ONLY; The name of the service resource in the format of {applicationName}~{serviceName}. + Name *string + + // The geo-location where the resource lives + Location *string + + // Resource tags. Tags map[string]*string - // READ-ONLY; Azure resource identifier. + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; Azure resource name. - Name *string - - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Azure resource type. + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // ServiceResourceList - The list of service resources. type ServiceResourceList struct { + // REQUIRED; The ServiceResource items on this page Value []*ServiceResource - // READ-ONLY; URL to get the next set of service list results if there are any. + // The link to the next page of items NextLink *string } @@ -1602,17 +1698,17 @@ type ServiceResourceProperties struct { DefaultMoveCost *MoveCost // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting - // a service to particular nodes based on the service requirements. For - // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + // a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType + // is blue specify the following: "NodeColor == blue)". PlacementConstraints *string // Scaling policies for this service. ScalingPolicies []*ScalingPolicy // Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service - // endpoints for application layer protocols (e.g., HTTP). When updating - // serviceDnsName, old name may be temporarily resolvable. However, rely on new name. When removing serviceDnsName, removed - // name may temporarily be resolvable. Do not rely on the name being unresolvable. + // endpoints for application layer protocols (e.g., HTTP). + // When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. + // When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. ServiceDNSName *string // The service load metrics is given as an array of ServiceLoadMetric objects. @@ -1637,26 +1733,28 @@ func (s *ServiceResourceProperties) GetServiceResourceProperties() *ServiceResou type ServiceTypeHealthPolicy struct { // REQUIRED; The maximum allowed percentage of unhealthy partitions per service. // The percentage represents the maximum tolerated percentage of partitions that can be unhealthy before the service is considered - // in error. If the percentage is respected but there is at least one - // unhealthy partition, the health is evaluated as Warning. The percentage is calculated by dividing the number of unhealthy - // partitions over the total number of partitions in the service. The computation - // rounds up to tolerate one failure on small numbers of partitions. + // in error. + // If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. + // The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the + // service. + // The computation rounds up to tolerate one failure on small numbers of partitions. MaxPercentUnhealthyPartitionsPerService *int32 // REQUIRED; The maximum allowed percentage of unhealthy replicas per partition. // The percentage represents the maximum tolerated percentage of replicas that can be unhealthy before the partition is considered - // in error. If the percentage is respected but there is at least one - // unhealthy replica, the health is evaluated as Warning. The percentage is calculated by dividing the number of unhealthy - // replicas over the total number of replicas in the partition. The computation - // rounds up to tolerate one failure on small numbers of replicas. + // in error. + // If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. + // The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. + // The computation rounds up to tolerate one failure on small numbers of replicas. MaxPercentUnhealthyReplicasPerPartition *int32 // REQUIRED; The maximum allowed percentage of unhealthy services. // The percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is - // considered in error. If the percentage is respected but there is at least one - // unhealthy service, the health is evaluated as Warning. This is calculated by dividing the number of unhealthy services - // of the specific service type over the total number of services of the specific - // service type. The computation rounds up to tolerate one failure on small numbers of services. + // considered in error. + // If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. + // This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services + // of the specific service type. + // The computation rounds up to tolerate one failure on small numbers of services. MaxPercentUnhealthyServices *int32 } @@ -1684,9 +1782,10 @@ type SettingsSectionDescription struct { Parameters []*SettingsParameterDescription } -// SingletonPartitionScheme +// SingletonPartitionScheme - Describes the partition scheme of a singleton-partitioned, or non-partitioned service. type SingletonPartitionScheme struct { - // REQUIRED; Specifies how the service is partitioned. + // CONSTANT; Specifies how the service is partitioned. + // Field has constant value PartitionSchemeSingleton, any specified value is ignored. PartitionScheme *PartitionScheme } @@ -1702,7 +1801,8 @@ type StatefulServiceProperties struct { // REQUIRED; Describes how the service is partitioned. PartitionDescription PartitionClassification - // REQUIRED; The kind of service (Stateless or Stateful). + // CONSTANT; The kind of service (Stateless or Stateful). + // Field has constant value ServiceKindStateful, any specified value is ignored. ServiceKind *ServiceKind // REQUIRED; The name of the service type @@ -1722,8 +1822,8 @@ type StatefulServiceProperties struct { MinReplicaSetSize *int32 // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting - // a service to particular nodes based on the service requirements. For - // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + // a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType + // is blue specify the following: "NodeColor == blue)". PlacementConstraints *string // The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". @@ -1736,9 +1836,9 @@ type StatefulServiceProperties struct { ScalingPolicies []*ScalingPolicy // Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service - // endpoints for application layer protocols (e.g., HTTP). When updating - // serviceDnsName, old name may be temporarily resolvable. However, rely on new name. When removing serviceDnsName, removed - // name may temporarily be resolvable. Do not rely on the name being unresolvable. + // endpoints for application layer protocols (e.g., HTTP). + // When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. + // When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. ServiceDNSName *string // The service load metrics is given as an array of ServiceLoadMetric objects. @@ -1789,7 +1889,8 @@ type StatelessServiceProperties struct { // REQUIRED; Describes how the service is partitioned. PartitionDescription PartitionClassification - // REQUIRED; The kind of service (Stateless or Stateful). + // CONSTANT; The kind of service (Stateless or Stateful). + // Field has constant value ServiceKindStateless, any specified value is ignored. ServiceKind *ServiceKind // REQUIRED; The name of the service type @@ -1802,31 +1903,30 @@ type StatelessServiceProperties struct { DefaultMoveCost *MoveCost // MinInstanceCount is the minimum number of instances that must be up to meet the EnsureAvailability safety check during - // operations like upgrade or deactivate node. The actual number that is used is - // max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during - // MinInstanceCount computation -1 is first converted into the number of nodes on - // which the instances are allowed to be placed according to the placement constraints on the service. + // operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 + // * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstanceCount computation -1 is first converted into + // the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. MinInstanceCount *int32 // MinInstancePercentage is the minimum percentage of InstanceCount that must be up to meet the EnsureAvailability safety - // check during operations like upgrade or deactivate node. The actual number that - // is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to - // -1, during MinInstancePercentage computation, -1 is first converted into the - // number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. + // check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( + // MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstancePercentage computation, + // -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement + // constraints on the service. MinInstancePercentage *int32 // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting - // a service to particular nodes based on the service requirements. For - // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + // a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType + // is blue specify the following: "NodeColor == blue)". PlacementConstraints *string // Scaling policies for this service. ScalingPolicies []*ScalingPolicy // Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service - // endpoints for application layer protocols (e.g., HTTP). When updating - // serviceDnsName, old name may be temporarily resolvable. However, rely on new name. When removing serviceDnsName, removed - // name may temporarily be resolvable. Do not rely on the name being unresolvable. + // endpoints for application layer protocols (e.g., HTTP). + // When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. + // When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. ServiceDNSName *string // The service load metrics is given as an array of ServiceLoadMetric objects. @@ -1893,16 +1993,16 @@ type SystemData struct { CreatedBy *string // The type of identity that created the resource. - CreatedByType *string + CreatedByType *CreatedByType - // The timestamp of resource last modification (UTC). + // The timestamp of resource last modification (UTC) LastModifiedAt *time.Time // The identity that last modified the resource. LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *string + LastModifiedByType *CreatedByType } // UniformInt64RangePartitionScheme - Describes a partitioning scheme where an integer range is allocated evenly across a @@ -1911,13 +2011,16 @@ type UniformInt64RangePartitionScheme struct { // REQUIRED; The number of partitions. Count *int32 - // REQUIRED; The upper bound of the partition key range that should be split between the partition ‘Count’ + // REQUIRED; The upper bound of the partition key range that + // should be split between the partition ‘Count’ HighKey *int64 - // REQUIRED; The lower bound of the partition key range that should be split between the partition ‘Count’ + // REQUIRED; The lower bound of the partition key range that + // should be split between the partition ‘Count’ LowKey *int64 - // REQUIRED; Specifies how the service is partitioned. + // CONSTANT; Specifies how the service is partitioned. + // Field has constant value PartitionSchemeUniformInt64Range, any specified value is ignored. PartitionScheme *PartitionScheme } @@ -1928,6 +2031,7 @@ func (u *UniformInt64RangePartitionScheme) GetPartition() *Partition { } } +// UserAssignedIdentity - User assigned identity. type UserAssignedIdentity struct { // READ-ONLY; The client id of user assigned identity. ClientID *string @@ -1938,8 +2042,7 @@ type UserAssignedIdentity struct { // VMApplication - Specifies the gallery application that should be made available to the underlying VMSS. type VMApplication struct { - // REQUIRED; Specifies the GalleryApplicationVersion resource id on the form of - // /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. + // REQUIRED; Specifies the GalleryApplicationVersion resource id on the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}. PackageReferenceID *string // Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided. @@ -1960,10 +2063,9 @@ type VMApplication struct { } // VMImagePlan - Specifies information about the marketplace image used to create the virtual machine. This element is only -// used for marketplace images. Before you can use a marketplace image from an API, you must -// enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click -// Want to deploy programmatically, Get Started ->. Enter any required -// information and then click Save. +// used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic +// use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, +// Get Started. Enter any required information and then click Save. type VMImagePlan struct { // The plan ID. Name *string @@ -1981,8 +2083,7 @@ type VMImagePlan struct { // VMManagedIdentity - Identities for the virtual machine scale set under the node type. type VMManagedIdentity struct { // The list of user identities associated with the virtual machine scale set under the node type. Each entry will be an ARM - // resource ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + // resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities []*string } @@ -2007,8 +2108,7 @@ type VMSSExtensionProperties struct { TypeHandlerVersion *string // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, - // however, the extension will not upgrade minor versions unless redeployed, even - // with this property set to true. + // however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. AutoUpgradeMinorVersion *bool // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension @@ -2020,13 +2120,13 @@ type VMSSExtensionProperties struct { ForceUpdateTag *string // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any + ProtectedSettings *VMSSExtensionPropertiesProtectedSettings // Collection of extension names after which this extension needs to be provisioned. ProvisionAfterExtensions []*string // Json formatted public settings for the extension. - Settings any + Settings *VMSSExtensionPropertiesSettings // Indicates the setup order for the extension. SetupOrder []*VmssExtensionSetupOrder @@ -2035,6 +2135,12 @@ type VMSSExtensionProperties struct { ProvisioningState *string } +type VMSSExtensionPropertiesProtectedSettings struct { +} + +type VMSSExtensionPropertiesSettings struct { +} + // VMSize - VM Sizes properties. type VMSize struct { // READ-ONLY; VM Size name. @@ -2045,15 +2151,13 @@ type VMSize struct { // the VM. type VaultCertificate struct { // REQUIRED; For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. - // The specified certificate store is implicitly in the LocalMachine account. - // For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name .crt for the X509 - // certificate file and .prv for private key. Both of these files are .pem - // formatted. + // The specified certificate store is implicitly in the LocalMachine account. For Linux VMs, the certificate file is placed + // under the /var/lib/waagent directory, with the file name {UppercaseThumbprint}.crt for the X509 certificate file and {UppercaseThumbprint}.prv + // for private key. Both of these files are .pem formatted. CertificateStore *string // REQUIRED; This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the - // Key Vault, see Add a key or secret to the key vault - // [https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add]. + // Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). CertificateURL *string } @@ -2078,7 +2182,31 @@ type VmssDataDisk struct { DiskType *DiskType // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and - // therefore must be unique for each data disk attached to a VM. Lun 0 is reserved for the - // service fabric data disk. + // therefore must be unique for each data disk attached to a VM. Lun 0 is reserved for the service fabric data disk. Lun *int32 } + +// ZoneFaultSimulationContent - Parameters for Zone Fault Simulation action. +type ZoneFaultSimulationContent struct { + // CONSTANT; The kind of fault simulation. + // Field has constant value FaultKindZone, any specified value is ignored. + FaultKind *FaultKind + + // Constraints for Fault Simulation action. + Constraints *FaultSimulationConstraints + + // Force the action to go through without any check on the cluster. + Force *bool + + // Indicates the zones of the fault simulation. + Zones []*string +} + +// GetFaultSimulationContent implements the FaultSimulationContentClassification interface for type ZoneFaultSimulationContent. +func (z *ZoneFaultSimulationContent) GetFaultSimulationContent() *FaultSimulationContent { + return &FaultSimulationContent{ + Constraints: z.Constraints, + FaultKind: z.FaultKind, + Force: z.Force, + } +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/models_serde.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/models_serde.go index 8b9fe9146daa..4ab148c3166e 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/models_serde.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/models_serde.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -1090,6 +1086,235 @@ func (e *ErrorModelError) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FaultSimulation. +func (f FaultSimulation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "details", f.Details) + populateDateTimeRFC3339(objectMap, "endTime", f.EndTime) + populate(objectMap, "simulationId", f.SimulationID) + populateDateTimeRFC3339(objectMap, "startTime", f.StartTime) + populate(objectMap, "status", f.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FaultSimulation. +func (f *FaultSimulation) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "details": + err = unpopulate(val, "Details", &f.Details) + delete(rawMsg, key) + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &f.EndTime) + delete(rawMsg, key) + case "simulationId": + err = unpopulate(val, "SimulationID", &f.SimulationID) + delete(rawMsg, key) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &f.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &f.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FaultSimulationConstraints. +func (f FaultSimulationConstraints) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "expirationTime", f.ExpirationTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FaultSimulationConstraints. +func (f *FaultSimulationConstraints) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationTime": + err = unpopulateDateTimeRFC3339(val, "ExpirationTime", &f.ExpirationTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FaultSimulationContent. +func (f FaultSimulationContent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "constraints", f.Constraints) + populate(objectMap, "faultKind", f.FaultKind) + populate(objectMap, "force", f.Force) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FaultSimulationContent. +func (f *FaultSimulationContent) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "constraints": + err = unpopulate(val, "Constraints", &f.Constraints) + delete(rawMsg, key) + case "faultKind": + err = unpopulate(val, "FaultKind", &f.FaultKind) + delete(rawMsg, key) + case "force": + err = unpopulate(val, "Force", &f.Force) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FaultSimulationContentWrapper. +func (f FaultSimulationContentWrapper) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "parameters", f.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FaultSimulationContentWrapper. +func (f *FaultSimulationContentWrapper) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "parameters": + f.Parameters, err = unmarshalFaultSimulationContentClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FaultSimulationDetails. +func (f FaultSimulationDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clusterId", f.ClusterID) + populate(objectMap, "nodeTypeFaultSimulation", f.NodeTypeFaultSimulation) + populate(objectMap, "operationId", f.OperationID) + populate(objectMap, "parameters", f.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FaultSimulationDetails. +func (f *FaultSimulationDetails) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clusterId": + err = unpopulate(val, "ClusterID", &f.ClusterID) + delete(rawMsg, key) + case "nodeTypeFaultSimulation": + err = unpopulate(val, "NodeTypeFaultSimulation", &f.NodeTypeFaultSimulation) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &f.OperationID) + delete(rawMsg, key) + case "parameters": + f.Parameters, err = unmarshalFaultSimulationContentClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FaultSimulationIDContent. +func (f FaultSimulationIDContent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "simulationId", f.SimulationID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FaultSimulationIDContent. +func (f *FaultSimulationIDContent) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "simulationId": + err = unpopulate(val, "SimulationID", &f.SimulationID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FaultSimulationListResult. +func (f FaultSimulationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FaultSimulationListResult. +func (f *FaultSimulationListResult) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FrontendConfiguration. func (f FrontendConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1546,6 +1771,7 @@ func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "subnetId", m.SubnetID) populate(objectMap, "upgradeDescription", m.UpgradeDescription) populate(objectMap, "useCustomVnet", m.UseCustomVnet) + populate(objectMap, "VMImage", m.VMImage) populate(objectMap, "zonalResiliency", m.ZonalResiliency) populate(objectMap, "zonalUpdateMode", m.ZonalUpdateMode) return json.Marshal(objectMap) @@ -1677,6 +1903,9 @@ func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error { case "useCustomVnet": err = unpopulate(val, "UseCustomVnet", &m.UseCustomVnet) delete(rawMsg, key) + case "VMImage": + err = unpopulate(val, "VMImage", &m.VMImage) + delete(rawMsg, key) case "zonalResiliency": err = unpopulate(val, "ZonalResiliency", &m.ZonalResiliency) delete(rawMsg, key) @@ -1723,7 +1952,7 @@ func (m ManagedClusterVersionDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clusterCodeVersion", m.ClusterCodeVersion) populate(objectMap, "osType", m.OSType) - populate(objectMap, "supportExpiryUtc", m.SupportExpiryUTC) + populateDateTimeRFC3339(objectMap, "supportExpiryUtc", m.SupportExpiryUTC) return json.Marshal(objectMap) } @@ -1743,7 +1972,7 @@ func (m *ManagedClusterVersionDetails) UnmarshalJSON(data []byte) error { err = unpopulate(val, "OSType", &m.OSType) delete(rawMsg, key) case "supportExpiryUtc": - err = unpopulate(val, "SupportExpiryUTC", &m.SupportExpiryUTC) + err = unpopulateDateTimeRFC3339(val, "SupportExpiryUTC", &m.SupportExpiryUTC) delete(rawMsg, key) } if err != nil { @@ -2144,6 +2373,45 @@ func (n *NodeTypeAvailableSKU) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NodeTypeFaultSimulation. +func (n NodeTypeFaultSimulation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nodeTypeName", n.NodeTypeName) + populate(objectMap, "operationId", n.OperationID) + populate(objectMap, "operationStatus", n.OperationStatus) + populate(objectMap, "status", n.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NodeTypeFaultSimulation. +func (n *NodeTypeFaultSimulation) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nodeTypeName": + err = unpopulate(val, "NodeTypeName", &n.NodeTypeName) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &n.OperationID) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &n.OperationStatus) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &n.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NodeTypeListResult. func (n NodeTypeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2272,6 +2540,7 @@ func (n NodeTypeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "placementProperties", n.PlacementProperties) populate(objectMap, "provisioningState", n.ProvisioningState) populate(objectMap, "secureBootEnabled", n.SecureBootEnabled) + populate(objectMap, "securityEncryptionType", n.SecurityEncryptionType) populate(objectMap, "securityType", n.SecurityType) populate(objectMap, "serviceArtifactReferenceId", n.ServiceArtifactReferenceID) populate(objectMap, "spotRestoreTimeout", n.SpotRestoreTimeout) @@ -2293,6 +2562,7 @@ func (n NodeTypeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "vmSetupActions", n.VMSetupActions) populate(objectMap, "vmSharedGalleryImageId", n.VMSharedGalleryImageID) populate(objectMap, "vmSize", n.VMSize) + populate(objectMap, "zoneBalance", n.ZoneBalance) populate(objectMap, "zones", n.Zones) return json.Marshal(objectMap) } @@ -2390,6 +2660,9 @@ func (n *NodeTypeProperties) UnmarshalJSON(data []byte) error { case "secureBootEnabled": err = unpopulate(val, "SecureBootEnabled", &n.SecureBootEnabled) delete(rawMsg, key) + case "securityEncryptionType": + err = unpopulate(val, "SecurityEncryptionType", &n.SecurityEncryptionType) + delete(rawMsg, key) case "securityType": err = unpopulate(val, "SecurityType", &n.SecurityType) delete(rawMsg, key) @@ -2453,6 +2726,9 @@ func (n *NodeTypeProperties) UnmarshalJSON(data []byte) error { case "vmSize": err = unpopulate(val, "VMSize", &n.VMSize) delete(rawMsg, key) + case "zoneBalance": + err = unpopulate(val, "ZoneBalance", &n.ZoneBalance) + delete(rawMsg, key) case "zones": err = unpopulate(val, "Zones", &n.Zones) delete(rawMsg, key) @@ -2677,7 +2953,7 @@ func (o *OperationResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Partition. func (p Partition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["partitionScheme"] = p.PartitionScheme + populate(objectMap, "partitionScheme", p.PartitionScheme) return json.Marshal(objectMap) } @@ -2883,7 +3159,7 @@ func (s *SKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScalingMechanism. func (s ScalingMechanism) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["kind"] = s.Kind + populate(objectMap, "kind", s.Kind) return json.Marshal(objectMap) } @@ -2941,7 +3217,7 @@ func (s *ScalingPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScalingTrigger. func (s ScalingTrigger) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["kind"] = s.Kind + populate(objectMap, "kind", s.Kind) return json.Marshal(objectMap) } @@ -3131,7 +3407,7 @@ func (s *ServicePlacementNonPartiallyPlaceServicePolicy) UnmarshalJSON(data []by // MarshalJSON implements the json.Marshaller interface for type ServicePlacementPolicy. func (s ServicePlacementPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["type"] = s.Type + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -3340,7 +3616,7 @@ func (s ServiceResourceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "scalingPolicies", s.ScalingPolicies) populate(objectMap, "serviceDnsName", s.ServiceDNSName) - objectMap["serviceKind"] = s.ServiceKind + populate(objectMap, "serviceKind", s.ServiceKind) populate(objectMap, "serviceLoadMetrics", s.ServiceLoadMetrics) populate(objectMap, "servicePackageActivationMode", s.ServicePackageActivationMode) populate(objectMap, "servicePlacementPolicies", s.ServicePlacementPolicies) @@ -4071,11 +4347,11 @@ func (v VMSSExtensionProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) populate(objectMap, "forceUpdateTag", v.ForceUpdateTag) - populateAny(objectMap, "protectedSettings", v.ProtectedSettings) + populate(objectMap, "protectedSettings", v.ProtectedSettings) populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions) populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "publisher", v.Publisher) - populateAny(objectMap, "settings", v.Settings) + populate(objectMap, "settings", v.Settings) populate(objectMap, "setupOrder", v.SetupOrder) populate(objectMap, "type", v.Type) populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) @@ -4260,22 +4536,51 @@ func (v *VmssDataDisk) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v +// MarshalJSON implements the json.Marshaller interface for type ZoneFaultSimulationContent. +func (z ZoneFaultSimulationContent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "constraints", z.Constraints) + objectMap["faultKind"] = FaultKindZone + populate(objectMap, "force", z.Force) + populate(objectMap, "zones", z.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ZoneFaultSimulationContent. +func (z *ZoneFaultSimulationContent) 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", z, err) } + for key, val := range rawMsg { + var err error + switch key { + case "constraints": + err = unpopulate(val, "Constraints", &z.Constraints) + delete(rawMsg, key) + case "faultKind": + err = unpopulate(val, "FaultKind", &z.FaultKind) + delete(rawMsg, key) + case "force": + err = unpopulate(val, "Force", &z.Force) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &z.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + } + return nil } -func populateAny(m map[string]any, k string, v any) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { m[k] = nil - } else { + } else if !reflect.ValueOf(v).IsNil() { m[k] = v } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypes_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypes_client.go index 5f488291cfa6..5b7ddafba503 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypes_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypes_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type NodeTypesClient struct { } // NewNodeTypesClient creates a new instance of NodeTypesClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNodeTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NodeTypesClient, error) { @@ -46,8 +42,8 @@ func NewNodeTypesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Create or update a Service Fabric node type of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - nodeTypeName - The name of the node type. // - parameters - The node type resource. @@ -60,8 +56,7 @@ func (client *NodeTypesClient) BeginCreateOrUpdate(ctx context.Context, resource return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -74,7 +69,7 @@ func (client *NodeTypesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Create or update a Service Fabric node type of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *NodeTypesClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeType, options *NodeTypesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "NodeTypesClient.BeginCreateOrUpdate" @@ -97,7 +92,7 @@ func (client *NodeTypesClient) createOrUpdate(ctx context.Context, resourceGroup } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *NodeTypesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeType, options *NodeTypesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *NodeTypesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeType, _ *NodeTypesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -120,9 +115,98 @@ func (client *NodeTypesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDeallocate - Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a shutdown +// on the VMs and release them from the cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - nodeTypeName - The name of the node type. +// - parameters - parameters for deallocate action. +// - options - NodeTypesClientBeginDeallocateOptions contains the optional parameters for the NodeTypesClient.BeginDeallocate +// method. +func (client *NodeTypesClient) BeginDeallocate(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginDeallocateOptions) (*runtime.Poller[NodeTypesClientDeallocateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deallocate(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientDeallocateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NodeTypesClientDeallocateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Deallocate - Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a shutdown on the +// VMs and release them from the cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *NodeTypesClient) deallocate(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginDeallocateOptions) (*http.Response, error) { + var err error + const operationName = "NodeTypesClient.BeginDeallocate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deallocateCreateRequest(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deallocateCreateRequest creates the Deallocate request. +func (client *NodeTypesClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, _ *NodeTypesClientBeginDeallocateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deallocate" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if nodeTypeName == "" { + return nil, errors.New("parameter nodeTypeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nodeTypeName}", url.PathEscape(nodeTypeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -132,8 +216,8 @@ func (client *NodeTypesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete a Service Fabric node type of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - nodeTypeName - The name of the node type. // - options - NodeTypesClientBeginDeleteOptions contains the optional parameters for the NodeTypesClient.BeginDelete method. @@ -144,8 +228,7 @@ func (client *NodeTypesClient) BeginDelete(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -158,7 +241,7 @@ func (client *NodeTypesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Delete a Service Fabric node type of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *NodeTypesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, options *NodeTypesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NodeTypesClient.BeginDelete" @@ -173,7 +256,7 @@ func (client *NodeTypesClient) deleteOperation(ctx context.Context, resourceGrou if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -181,7 +264,7 @@ func (client *NodeTypesClient) deleteOperation(ctx context.Context, resourceGrou } // deleteCreateRequest creates the Delete request. -func (client *NodeTypesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, options *NodeTypesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *NodeTypesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, _ *NodeTypesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -204,7 +287,7 @@ func (client *NodeTypesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,8 +297,8 @@ func (client *NodeTypesClient) deleteCreateRequest(ctx context.Context, resource // VMs and removes the state from the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - nodeTypeName - The name of the node type. // - parameters - parameters for delete action. @@ -228,8 +311,7 @@ func (client *NodeTypesClient) BeginDeleteNode(ctx context.Context, resourceGrou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientDeleteNodeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -243,7 +325,7 @@ func (client *NodeTypesClient) BeginDeleteNode(ctx context.Context, resourceGrou // and removes the state from the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *NodeTypesClient) deleteNode(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginDeleteNodeOptions) (*http.Response, error) { var err error const operationName = "NodeTypesClient.BeginDeleteNode" @@ -258,7 +340,7 @@ func (client *NodeTypesClient) deleteNode(ctx context.Context, resourceGroupName if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -266,7 +348,7 @@ func (client *NodeTypesClient) deleteNode(ctx context.Context, resourceGroupName } // deleteNodeCreateRequest creates the DeleteNode request. -func (client *NodeTypesClient) deleteNodeCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginDeleteNodeOptions) (*policy.Request, error) { +func (client *NodeTypesClient) deleteNodeCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, _ *NodeTypesClientBeginDeleteNodeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -289,9 +371,10 @@ func (client *NodeTypesClient) deleteNodeCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -301,8 +384,8 @@ func (client *NodeTypesClient) deleteNodeCreateRequest(ctx context.Context, reso // Get - Get a Service Fabric node type of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - nodeTypeName - The name of the node type. // - options - NodeTypesClientGetOptions contains the optional parameters for the NodeTypesClient.Get method. @@ -329,7 +412,7 @@ func (client *NodeTypesClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *NodeTypesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, options *NodeTypesClientGetOptions) (*policy.Request, error) { +func (client *NodeTypesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, _ *NodeTypesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -352,7 +435,7 @@ func (client *NodeTypesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,10 +450,85 @@ func (client *NodeTypesClient) getHandleResponse(resp *http.Response) (NodeTypes return result, nil } +// GetFaultSimulation - Gets a fault simulation by the simulationId. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - nodeTypeName - The name of the node type. +// - parameters - parameter with fault simulation id. +// - options - NodeTypesClientGetFaultSimulationOptions contains the optional parameters for the NodeTypesClient.GetFaultSimulation +// method. +func (client *NodeTypesClient) GetFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters FaultSimulationIDContent, options *NodeTypesClientGetFaultSimulationOptions) (NodeTypesClientGetFaultSimulationResponse, error) { + var err error + const operationName = "NodeTypesClient.GetFaultSimulation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getFaultSimulationCreateRequest(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return NodeTypesClientGetFaultSimulationResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NodeTypesClientGetFaultSimulationResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NodeTypesClientGetFaultSimulationResponse{}, err + } + resp, err := client.getFaultSimulationHandleResponse(httpResp) + return resp, err +} + +// getFaultSimulationCreateRequest creates the GetFaultSimulation request. +func (client *NodeTypesClient) getFaultSimulationCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters FaultSimulationIDContent, _ *NodeTypesClientGetFaultSimulationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/getFaultSimulation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if nodeTypeName == "" { + return nil, errors.New("parameter nodeTypeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nodeTypeName}", url.PathEscape(nodeTypeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// getFaultSimulationHandleResponse handles the GetFaultSimulation response. +func (client *NodeTypesClient) getFaultSimulationHandleResponse(resp *http.Response) (NodeTypesClientGetFaultSimulationResponse, error) { + result := NodeTypesClientGetFaultSimulationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FaultSimulation); err != nil { + return NodeTypesClientGetFaultSimulationResponse{}, err + } + return result, nil +} + // NewListByManagedClustersPager - Gets all Node types of the specified managed cluster. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - options - NodeTypesClientListByManagedClustersOptions contains the optional parameters for the NodeTypesClient.NewListByManagedClustersPager // method. @@ -398,16 +556,16 @@ func (client *NodeTypesClient) NewListByManagedClustersPager(resourceGroupName s } // listByManagedClustersCreateRequest creates the ListByManagedClusters request. -func (client *NodeTypesClient) listByManagedClustersCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *NodeTypesClientListByManagedClustersOptions) (*policy.Request, error) { +func (client *NodeTypesClient) listByManagedClustersCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *NodeTypesClientListByManagedClustersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if clusterName == "" { return nil, errors.New("parameter clusterName cannot be empty") } @@ -417,7 +575,7 @@ func (client *NodeTypesClient) listByManagedClustersCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -432,12 +590,169 @@ func (client *NodeTypesClient) listByManagedClustersHandleResponse(resp *http.Re return result, nil } +// NewListFaultSimulationPager - Gets the list of recent fault simulations for the node type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - nodeTypeName - The name of the node type. +// - options - NodeTypesClientListFaultSimulationOptions contains the optional parameters for the NodeTypesClient.NewListFaultSimulationPager +// method. +func (client *NodeTypesClient) NewListFaultSimulationPager(resourceGroupName string, clusterName string, nodeTypeName string, options *NodeTypesClientListFaultSimulationOptions) *runtime.Pager[NodeTypesClientListFaultSimulationResponse] { + return runtime.NewPager(runtime.PagingHandler[NodeTypesClientListFaultSimulationResponse]{ + More: func(page NodeTypesClientListFaultSimulationResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NodeTypesClientListFaultSimulationResponse) (NodeTypesClientListFaultSimulationResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NodeTypesClient.NewListFaultSimulationPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listFaultSimulationCreateRequest(ctx, resourceGroupName, clusterName, nodeTypeName, options) + }, nil) + if err != nil { + return NodeTypesClientListFaultSimulationResponse{}, err + } + return client.listFaultSimulationHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listFaultSimulationCreateRequest creates the ListFaultSimulation request. +func (client *NodeTypesClient) listFaultSimulationCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, _ *NodeTypesClientListFaultSimulationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/listFaultSimulation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if nodeTypeName == "" { + return nil, errors.New("parameter nodeTypeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nodeTypeName}", url.PathEscape(nodeTypeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listFaultSimulationHandleResponse handles the ListFaultSimulation response. +func (client *NodeTypesClient) listFaultSimulationHandleResponse(resp *http.Response) (NodeTypesClientListFaultSimulationResponse, error) { + result := NodeTypesClientListFaultSimulationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FaultSimulationListResult); err != nil { + return NodeTypesClientListFaultSimulationResponse{}, err + } + return result, nil +} + +// BeginRedeploy - Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut down on +// the VMs, move them to a new node, and power them back on. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - nodeTypeName - The name of the node type. +// - parameters - parameters for redeploy action. +// - options - NodeTypesClientBeginRedeployOptions contains the optional parameters for the NodeTypesClient.BeginRedeploy method. +func (client *NodeTypesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginRedeployOptions) (*runtime.Poller[NodeTypesClientRedeployResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.redeploy(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientRedeployResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NodeTypesClientRedeployResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Redeploy - Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut down on the VMs, +// move them to a new node, and power them back on. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *NodeTypesClient) redeploy(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginRedeployOptions) (*http.Response, error) { + var err error + const operationName = "NodeTypesClient.BeginRedeploy" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.redeployCreateRequest(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// redeployCreateRequest creates the Redeploy request. +func (client *NodeTypesClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, _ *NodeTypesClientBeginRedeployOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/redeploy" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if nodeTypeName == "" { + return nil, errors.New("parameter nodeTypeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nodeTypeName}", url.PathEscape(nodeTypeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + // BeginReimage - Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the // VMs and activate the nodes back again. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - nodeTypeName - The name of the node type. // - parameters - parameters for reimage action. @@ -449,8 +764,7 @@ func (client *NodeTypesClient) BeginReimage(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientReimageResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -464,7 +778,7 @@ func (client *NodeTypesClient) BeginReimage(ctx context.Context, resourceGroupNa // activate the nodes back again. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *NodeTypesClient) reimage(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginReimageOptions) (*http.Response, error) { var err error const operationName = "NodeTypesClient.BeginReimage" @@ -479,7 +793,7 @@ func (client *NodeTypesClient) reimage(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -487,7 +801,7 @@ func (client *NodeTypesClient) reimage(ctx context.Context, resourceGroupName st } // reimageCreateRequest creates the Reimage request. -func (client *NodeTypesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginReimageOptions) (*policy.Request, error) { +func (client *NodeTypesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, _ *NodeTypesClientBeginReimageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -510,9 +824,10 @@ func (client *NodeTypesClient) reimageCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -523,8 +838,8 @@ func (client *NodeTypesClient) reimageCreateRequest(ctx context.Context, resourc // VMs and activate the nodes back again. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - nodeTypeName - The name of the node type. // - parameters - parameters for restart action. @@ -536,8 +851,7 @@ func (client *NodeTypesClient) BeginRestart(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientRestartResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -551,7 +865,7 @@ func (client *NodeTypesClient) BeginRestart(ctx context.Context, resourceGroupNa // activate the nodes back again. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *NodeTypesClient) restart(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "NodeTypesClient.BeginRestart" @@ -566,7 +880,7 @@ func (client *NodeTypesClient) restart(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -574,7 +888,7 @@ func (client *NodeTypesClient) restart(ctx context.Context, resourceGroupName st } // restartCreateRequest creates the Restart request. -func (client *NodeTypesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginRestartOptions) (*policy.Request, error) { +func (client *NodeTypesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, _ *NodeTypesClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -597,9 +911,269 @@ func (client *NodeTypesClient) restartCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginStart - Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if needed and +// activate them. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - nodeTypeName - The name of the node type. +// - parameters - parameters for start action. +// - options - NodeTypesClientBeginStartOptions contains the optional parameters for the NodeTypesClient.BeginStart method. +func (client *NodeTypesClient) BeginStart(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginStartOptions) (*runtime.Poller[NodeTypesClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NodeTypesClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Start - Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if needed and activate +// them. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *NodeTypesClient) start(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, options *NodeTypesClientBeginStartOptions) (*http.Response, error) { + var err error + const operationName = "NodeTypesClient.BeginStart" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startCreateRequest(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startCreateRequest creates the Start request. +func (client *NodeTypesClient) startCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeActionParameters, _ *NodeTypesClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/start" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if nodeTypeName == "" { + return nil, errors.New("parameter nodeTypeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nodeTypeName}", url.PathEscape(nodeTypeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginStartFaultSimulation - Starts a fault simulation on the node type. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - nodeTypeName - The name of the node type. +// - parameters - parameters describing the fault simulation. +// - options - NodeTypesClientBeginStartFaultSimulationOptions contains the optional parameters for the NodeTypesClient.BeginStartFaultSimulation +// method. +func (client *NodeTypesClient) BeginStartFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters FaultSimulationContentWrapper, options *NodeTypesClientBeginStartFaultSimulationOptions) (*runtime.Poller[NodeTypesClientStartFaultSimulationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startFaultSimulation(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientStartFaultSimulationResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NodeTypesClientStartFaultSimulationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StartFaultSimulation - Starts a fault simulation on the node type. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *NodeTypesClient) startFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters FaultSimulationContentWrapper, options *NodeTypesClientBeginStartFaultSimulationOptions) (*http.Response, error) { + var err error + const operationName = "NodeTypesClient.BeginStartFaultSimulation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startFaultSimulationCreateRequest(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startFaultSimulationCreateRequest creates the StartFaultSimulation request. +func (client *NodeTypesClient) startFaultSimulationCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters FaultSimulationContentWrapper, _ *NodeTypesClientBeginStartFaultSimulationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/startFaultSimulation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if nodeTypeName == "" { + return nil, errors.New("parameter nodeTypeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nodeTypeName}", url.PathEscape(nodeTypeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginStopFaultSimulation - Stops a fault simulation on the node type. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the cluster resource. +// - nodeTypeName - The name of the node type. +// - parameters - parameter with fault simulation id. +// - options - NodeTypesClientBeginStopFaultSimulationOptions contains the optional parameters for the NodeTypesClient.BeginStopFaultSimulation +// method. +func (client *NodeTypesClient) BeginStopFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters FaultSimulationIDContent, options *NodeTypesClientBeginStopFaultSimulationOptions) (*runtime.Poller[NodeTypesClientStopFaultSimulationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopFaultSimulation(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientStopFaultSimulationResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NodeTypesClientStopFaultSimulationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// StopFaultSimulation - Stops a fault simulation on the node type. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *NodeTypesClient) stopFaultSimulation(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters FaultSimulationIDContent, options *NodeTypesClientBeginStopFaultSimulationOptions) (*http.Response, error) { + var err error + const operationName = "NodeTypesClient.BeginStopFaultSimulation" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.stopFaultSimulationCreateRequest(ctx, resourceGroupName, clusterName, nodeTypeName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// stopFaultSimulationCreateRequest creates the StopFaultSimulation request. +func (client *NodeTypesClient) stopFaultSimulationCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters FaultSimulationIDContent, _ *NodeTypesClientBeginStopFaultSimulationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/stopFaultSimulation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if nodeTypeName == "" { + return nil, errors.New("parameter nodeTypeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nodeTypeName}", url.PathEscape(nodeTypeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -609,8 +1183,8 @@ func (client *NodeTypesClient) restartCreateRequest(ctx context.Context, resourc // BeginUpdate - Update the configuration of a node type of a given managed cluster, only updating tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - nodeTypeName - The name of the node type. // - parameters - The parameters to update the node type configuration. @@ -622,8 +1196,7 @@ func (client *NodeTypesClient) BeginUpdate(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NodeTypesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -636,7 +1209,7 @@ func (client *NodeTypesClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Update the configuration of a node type of a given managed cluster, only updating tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *NodeTypesClient) update(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeUpdateParameters, options *NodeTypesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "NodeTypesClient.BeginUpdate" @@ -659,7 +1232,7 @@ func (client *NodeTypesClient) update(ctx context.Context, resourceGroupName str } // updateCreateRequest creates the Update request. -func (client *NodeTypesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeUpdateParameters, options *NodeTypesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *NodeTypesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, parameters NodeTypeUpdateParameters, _ *NodeTypesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -682,9 +1255,10 @@ func (client *NodeTypesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypes_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypes_client_example_test.go index 1241516ad586..26d60cc3fa52 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypes_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypes_client_example_test.go @@ -1,308 +1,363 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeListOperation_example.json -func ExampleNodeTypesClient_NewListByManagedClustersPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNodeTypesClient().NewListByManagedClustersPager("resRg", "myCluster", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NodeTypeListResult = armservicefabricmanagedclusters.NodeTypeListResult{ - // Value: []*armservicefabricmanagedclusters.NodeType{ - // { - // Name: to.Ptr("FE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/FE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // }, - // DataDiskSizeGB: to.Ptr[int32](100), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // IsPrimary: to.Ptr(true), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // }, - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2016-Datacenter"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](5), - // VMSize: to.Ptr("Standard_D2"), - // }, - // SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ - // Name: to.Ptr("Standard_P0"), - // Capacity: to.Ptr[int32](5), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // }, - // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ - // { - // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), - // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ - // Type: to.Ptr("GenevaMonitoring"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // Publisher: to.Ptr("Microsoft.Azure.Geneva"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("2.0"), - // }, - // }}, - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](10), - // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ - // { - // SourceVault: &armservicefabricmanagedclusters.SubResource{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), - // }, - // VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ - // { - // CertificateStore: to.Ptr("My"), - // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), - // }}, - // }}, - // VMSize: to.Ptr("Standard_DS3"), - // }, - // SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ - // Name: to.Ptr("Standard_S0"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/RestartNodes_example.json -func ExampleNodeTypesClient_BeginRestart() { +// Generated from example definition: 2025-03-01-preview/NodeTypePutOperationAutoScale_example.json +func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithAutoScaleParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginRestart(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ - Nodes: []*string{ - to.Ptr("BE_0"), - to.Ptr("BE_3")}, + poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ + Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + Capacities: map[string]*string{ + "ClientConnections": to.Ptr("65536"), + }, + DataDiskSizeGB: to.Ptr[int32](200), + DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), + IsPrimary: to.Ptr(false), + IsStateless: to.Ptr(true), + MultiplePlacementGroups: to.Ptr(true), + PlacementProperties: map[string]*string{ + "HasSSD": to.Ptr("true"), + "NodeColor": to.Ptr("green"), + "SomeProperty": to.Ptr("5"), + }, + VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ + { + Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), + Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ + Type: to.Ptr("GenevaMonitoring"), + AutoUpgradeMinorVersion: to.Ptr(true), + Publisher: to.Ptr("Microsoft.Azure.Geneva"), + Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{}, + TypeHandlerVersion: to.Ptr("2.0"), + }, + }, + }, + VMImageOffer: to.Ptr("WindowsServer"), + VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), + VMImageVersion: to.Ptr("latest"), + VMInstanceCount: to.Ptr[int32](-1), + VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ + UserAssignedIdentities: []*string{ + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"), + }, + }, + VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ + { + SourceVault: &armservicefabricmanagedclusters.SubResource{ + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), + }, + VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ + { + CertificateStore: to.Ptr("My"), + CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), + }, + }, + }, + }, + VMSize: to.Ptr("Standard_DS3"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // "ClientConnections": to.Ptr("65536"), + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(true), + // MultiplePlacementGroups: to.Ptr(true), + // PlacementProperties: map[string]*string{ + // "HasSSD": to.Ptr("true"), + // "NodeColor": to.Ptr("green"), + // "SomeProperty": to.Ptr("5"), + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ + // { + // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), + // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ + // Type: to.Ptr("GenevaMonitoring"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // ForceUpdateTag: to.Ptr("v.1.0"), + // Publisher: to.Ptr("Microsoft.Azure.Geneva"), + // Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{ + // }, + // TypeHandlerVersion: to.Ptr("2.0"), + // }, + // }, + // }, + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](10), + // VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ + // UserAssignedIdentities: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"), + // }, + // }, + // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ + // { + // SourceVault: &armservicefabricmanagedclusters.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), + // }, + // VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ + // { + // CertificateStore: to.Ptr("My"), + // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), + // }, + // }, + // }, + // }, + // VMSize: to.Ptr("Standard_DS3"), + // }, + // SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ + // Name: to.Ptr("Standard_S2"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ReimageNodes_UD_example.json -func ExampleNodeTypesClient_BeginReimage_reimageAllNodesByUpgradeDomain() { +// Generated from example definition: 2025-03-01-preview/NodeTypePutOperationCustomImage_example.json +func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithCustomVMImage() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginReimage(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ - UpdateType: to.Ptr(armservicefabricmanagedclusters.UpdateTypeByUpgradeDomain), + poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ + Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + DataDiskSizeGB: to.Ptr[int32](200), + IsPrimary: to.Ptr(false), + VMImageResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"), + VMInstanceCount: to.Ptr[int32](10), + VMSize: to.Ptr("Standard_D3"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // VMImageResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"), + // VMInstanceCount: to.Ptr[int32](10), + // VMSize: to.Ptr("Standard_D3"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ReimageNodes_example.json -func ExampleNodeTypesClient_BeginReimage_reimageNodes() { +// Generated from example definition: 2025-03-01-preview/NodeTypePutOperationCustomSharedGalleriesImage_example.json +func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithSharedGalleriesCustomVMImage() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginReimage(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ - Nodes: []*string{ - to.Ptr("BE_0"), - to.Ptr("BE_3")}, + poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ + Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + DataDiskSizeGB: to.Ptr[int32](200), + IsPrimary: to.Ptr(false), + VMInstanceCount: to.Ptr[int32](10), + VMSharedGalleryImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"), + VMSize: to.Ptr("Standard_D3"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // VMInstanceCount: to.Ptr[int32](10), + // VMSharedGalleryImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"), + // VMSize: to.Ptr("Standard_D3"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/DeleteNodes_example.json -func ExampleNodeTypesClient_BeginDeleteNode() { +// Generated from example definition: 2025-03-01-preview/NodeTypePutOperationDedicatedHost_example.json +func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithDedicatedHosts() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginDeleteNode(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ - Nodes: []*string{ - to.Ptr("BE_0"), - to.Ptr("BE_3")}, + poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ + Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + Capacities: map[string]*string{}, + DataDiskSizeGB: to.Ptr[int32](200), + DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup"), + IsPrimary: to.Ptr(false), + PlacementProperties: map[string]*string{}, + VMImageOffer: to.Ptr("WindowsServer"), + VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + VMImageSKU: to.Ptr("2019-Datacenter"), + VMImageVersion: to.Ptr("latest"), + VMInstanceCount: to.Ptr[int32](10), + VMSize: to.Ptr("Standard_D8s_v3"), + Zones: []*string{ + to.Ptr("1"), + }, + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeGetOperation_example.json -func ExampleNodeTypesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNodeTypesClient().Get(ctx, "resRg", "myCluster", "FE", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("FE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/FE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ + // res = armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup"), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2019-Datacenter"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](10), + // VMSize: to.Ptr("Standard_D8s_v3"), + // Zones: []*string{ + // to.Ptr("1"), + // }, // }, - // DataDiskSizeGB: to.Ptr[int32](100), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // IsPrimary: to.Ptr(true), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ + // Tags: map[string]*string{ // }, - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2016-Datacenter"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](5), - // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ - // { - // SourceVault: &armservicefabricmanagedclusters.SubResource{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), - // }, - // VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ - // { - // CertificateStore: to.Ptr("My"), - // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), - // }}, - // }}, - // VMSize: to.Ptr("Standard_D2"), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationAutoScale_example.json -func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithAutoScaleParameters() { +// Generated from example definition: 2025-03-01-preview/NodeTypePutOperationStateless_example.json +func ExampleNodeTypesClient_BeginCreateOrUpdate_putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - Capacities: map[string]*string{ - "ClientConnections": to.Ptr("65536"), - }, - DataDiskSizeGB: to.Ptr[int32](200), - DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), + EnableEncryptionAtHost: to.Ptr(true), IsPrimary: to.Ptr(false), IsStateless: to.Ptr(true), MultiplePlacementGroups: to.Ptr(true), - PlacementProperties: map[string]*string{ - "HasSSD": to.Ptr("true"), - "NodeColor": to.Ptr("green"), - "SomeProperty": to.Ptr("5"), - }, + UseTempDataDisk: to.Ptr(true), VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ { Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), @@ -310,32 +365,17 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithAutoScaleParamet Type: to.Ptr("GenevaMonitoring"), AutoUpgradeMinorVersion: to.Ptr(true), Publisher: to.Ptr("Microsoft.Azure.Geneva"), - Settings: map[string]any{}, + Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{}, TypeHandlerVersion: to.Ptr("2.0"), }, - }}, + }, + }, VMImageOffer: to.Ptr("WindowsServer"), VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), VMImageVersion: to.Ptr("latest"), - VMInstanceCount: to.Ptr[int32](-1), - VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ - UserAssignedIdentities: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")}, - }, - VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ - { - SourceVault: &armservicefabricmanagedclusters.SubResource{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), - }, - VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ - { - CertificateStore: to.Ptr("My"), - CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), - }}, - }}, - VMSize: to.Ptr("Standard_DS3"), + VMInstanceCount: to.Ptr[int32](10), + VMSize: to.Ptr("Standard_DS3"), }, }, nil) if err != nil { @@ -348,79 +388,123 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithAutoScaleParamet // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // "ClientConnections": to.Ptr("65536"), - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(true), - // MultiplePlacementGroups: to.Ptr(true), - // PlacementProperties: map[string]*string{ - // "HasSSD": to.Ptr("true"), - // "NodeColor": to.Ptr("green"), - // "SomeProperty": to.Ptr("5"), - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ - // { - // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), - // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ - // Type: to.Ptr("GenevaMonitoring"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ForceUpdateTag: to.Ptr("v.1.0"), - // Publisher: to.Ptr("Microsoft.Azure.Geneva"), - // Settings: map[string]any{ + // res = armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // EnableEncryptionAtHost: to.Ptr(true), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(true), + // MultiplePlacementGroups: to.Ptr(true), + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // UseTempDataDisk: to.Ptr(true), + // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ + // { + // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), + // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ + // Type: to.Ptr("GenevaMonitoring"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // Publisher: to.Ptr("Microsoft.Azure.Geneva"), + // Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{ + // }, + // TypeHandlerVersion: to.Ptr("2.0"), // }, - // TypeHandlerVersion: to.Ptr("2.0"), // }, - // }}, - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](10), - // VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ - // UserAssignedIdentities: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")}, // }, - // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ - // { - // SourceVault: &armservicefabricmanagedclusters.SubResource{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), - // }, - // VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ - // { - // CertificateStore: to.Ptr("My"), - // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), - // }}, - // }}, + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](10), // VMSize: to.Ptr("Standard_DS3"), // }, - // SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ - // Name: to.Ptr("Standard_S2"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-03-01-preview/NodeTypePutOperationVmImagePlan_example.json +func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithVMImagePlan() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ + Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + DataDiskSizeGB: to.Ptr[int32](200), + IsPrimary: to.Ptr(false), + VMImageOffer: to.Ptr("windows_2022_test"), + VMImagePlan: &armservicefabricmanagedclusters.VMImagePlan{ + Name: to.Ptr("win_2022_test_20_10_gen2"), + Product: to.Ptr("windows_2022_test"), + Publisher: to.Ptr("testpublisher"), + }, + VMImagePublisher: to.Ptr("testpublisher"), + VMImageSKU: to.Ptr("win_2022_test_20_10_gen2"), + VMImageVersion: to.Ptr("latest"), + VMInstanceCount: to.Ptr[int32](10), + VMSize: to.Ptr("Standard_D3"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // VMImageOffer: to.Ptr("windows_2022_test"), + // VMImagePlan: &armservicefabricmanagedclusters.VMImagePlan{ + // Name: to.Ptr("win_2022_test_20_10_gen2"), + // Product: to.Ptr("windows_2022_test"), + // Publisher: to.Ptr("testpublisher"), + // }, + // VMImagePublisher: to.Ptr("testpublisher"), + // VMImageSKU: to.Ptr("win_2022_test_20_10_gen2"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](10), + // VMSize: to.Ptr("Standard_D3"), + // }, + // Tags: map[string]*string{ // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_max.json +// Generated from example definition: 2025-03-01-preview/NodeTypePutOperation_example_max.json func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -438,7 +522,8 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter DiskSizeGB: to.Ptr[int32](150), DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), Lun: to.Ptr[int32](2), - }}, + }, + }, AdditionalNetworkInterfaceConfigurations: []*armservicefabricmanagedclusters.AdditionalNetworkInterfaceConfiguration{ { Name: to.Ptr("nic-1"), @@ -452,15 +537,18 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter ApplicationGatewayBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{ { ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"), - }}, + }, + }, LoadBalancerBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{ { ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"), - }}, + }, + }, LoadBalancerInboundNatPools: []*armservicefabricmanagedclusters.SubResource{ { ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"), - }}, + }, + }, PrivateIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PrivateIPAddressVersionIPv4), PublicIPAddressConfiguration: &armservicefabricmanagedclusters.IPConfigurationPublicIPAddressConfiguration{ Name: to.Ptr("publicip-1"), @@ -468,14 +556,17 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter { IPTagType: to.Ptr("RoutingPreference"), Tag: to.Ptr("Internet"), - }}, + }, + }, PublicIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PublicIPAddressVersionIPv4), }, Subnet: &armservicefabricmanagedclusters.SubResource{ ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), }, - }}, - }}, + }, + }, + }, + }, Capacities: map[string]*string{ "ClientConnections": to.Ptr("65536"), }, @@ -495,7 +586,8 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter ApplicationGatewayBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"), LoadBalancerBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"), LoadBalancerInboundNatPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"), - }}, + }, + }, IsPrimary: to.Ptr(false), IsSpotVM: to.Ptr(true), IsStateless: to.Ptr(true), @@ -507,7 +599,8 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter "SomeProperty": to.Ptr("5"), }, SecureBootEnabled: to.Ptr(true), - SecurityType: to.Ptr(armservicefabricmanagedclusters.SecurityTypeTrustedLaunch), + SecurityType: to.Ptr(armservicefabricmanagedclusters.SecurityTypeConfidentialVM), + SecurityEncryptionType: to.Ptr(armservicefabricmanagedclusters.SecurityEncryptionTypeDiskWithVMGuestState), ServiceArtifactReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile"), SpotRestoreTimeout: to.Ptr("PT30M"), SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), @@ -521,7 +614,8 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter PackageReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0"), TreatFailureAsDeploymentFailure: to.Ptr(false), VMGalleryTags: to.Ptr("{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}"), - }}, + }, + }, VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ { Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), @@ -531,12 +625,14 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter EnableAutomaticUpgrade: to.Ptr(true), ForceUpdateTag: to.Ptr("v.1.0"), Publisher: to.Ptr("Microsoft.Azure.Geneva"), - Settings: map[string]any{}, + Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{}, SetupOrder: []*armservicefabricmanagedclusters.VmssExtensionSetupOrder{ - to.Ptr(armservicefabricmanagedclusters.VmssExtensionSetupOrderBeforeSFRuntime)}, + to.Ptr(armservicefabricmanagedclusters.VmssExtensionSetupOrderBeforeSFRuntime), + }, TypeHandlerVersion: to.Ptr("2.0"), }, - }}, + }, + }, VMImageOffer: to.Ptr("WindowsServer"), VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), @@ -545,7 +641,8 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ UserAssignedIdentities: []*string{ to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")}, + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"), + }, }, VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ { @@ -556,11 +653,14 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter { CertificateStore: to.Ptr("My"), CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), - }}, - }}, + }, + }, + }, + }, VMSetupActions: []*armservicefabricmanagedclusters.VMSetupAction{ to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableContainers), - to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableHyperV)}, + to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableHyperV), + }, VMSize: to.Ptr("Standard_DS3"), }, }, nil) @@ -574,125 +674,136 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // AdditionalDataDisks: []*armservicefabricmanagedclusters.VmssDataDisk{ - // { - // DiskLetter: to.Ptr("F"), - // DiskSizeGB: to.Ptr[int32](256), - // DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // Lun: to.Ptr[int32](1), - // }, - // { - // DiskLetter: to.Ptr("G"), - // DiskSizeGB: to.Ptr[int32](150), - // DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), - // Lun: to.Ptr[int32](2), - // }}, - // AdditionalNetworkInterfaceConfigurations: []*armservicefabricmanagedclusters.AdditionalNetworkInterfaceConfiguration{ - // { - // Name: to.Ptr("nic-1"), - // DscpConfiguration: &armservicefabricmanagedclusters.SubResource{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"), + // res = armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // AdditionalDataDisks: []*armservicefabricmanagedclusters.VmssDataDisk{ + // { + // DiskLetter: to.Ptr("F"), + // DiskSizeGB: to.Ptr[int32](256), + // DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // Lun: to.Ptr[int32](1), + // }, + // { + // DiskLetter: to.Ptr("G"), + // DiskSizeGB: to.Ptr[int32](150), + // DiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), + // Lun: to.Ptr[int32](2), // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // IPConfigurations: []*armservicefabricmanagedclusters.IPConfiguration{ - // { - // Name: to.Ptr("ipconfig-1"), - // ApplicationGatewayBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"), - // }}, - // LoadBalancerBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"), - // }}, - // LoadBalancerInboundNatPools: []*armservicefabricmanagedclusters.SubResource{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"), - // }}, - // PrivateIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PrivateIPAddressVersionIPv4), - // PublicIPAddressConfiguration: &armservicefabricmanagedclusters.IPConfigurationPublicIPAddressConfiguration{ - // Name: to.Ptr("publicip-1"), - // IPTags: []*armservicefabricmanagedclusters.IPTag{ + // }, + // AdditionalNetworkInterfaceConfigurations: []*armservicefabricmanagedclusters.AdditionalNetworkInterfaceConfiguration{ + // { + // Name: to.Ptr("nic-1"), + // DscpConfiguration: &armservicefabricmanagedclusters.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"), + // }, + // EnableAcceleratedNetworking: to.Ptr(true), + // IPConfigurations: []*armservicefabricmanagedclusters.IPConfiguration{ + // { + // Name: to.Ptr("ipconfig-1"), + // ApplicationGatewayBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{ // { - // IPTagType: to.Ptr("RoutingPreference"), - // Tag: to.Ptr("Internet"), - // }}, - // PublicIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PublicIPAddressVersionIPv4), - // }, - // Subnet: &armservicefabricmanagedclusters.SubResource{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armservicefabricmanagedclusters.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armservicefabricmanagedclusters.SubResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PrivateIPAddressVersionIPv4), + // PublicIPAddressConfiguration: &armservicefabricmanagedclusters.IPConfigurationPublicIPAddressConfiguration{ + // Name: to.Ptr("publicip-1"), + // IPTags: []*armservicefabricmanagedclusters.IPTag{ + // { + // IPTagType: to.Ptr("RoutingPreference"), + // Tag: to.Ptr("Internet"), + // }, + // }, + // PublicIPAddressVersion: to.Ptr(armservicefabricmanagedclusters.PublicIPAddressVersionIPv4), + // }, + // Subnet: &armservicefabricmanagedclusters.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // }, // }, - // }}, - // }}, - // Capacities: map[string]*string{ - // "ClientConnections": to.Ptr("65536"), - // }, - // DataDiskLetter: to.Ptr("S"), - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), - // DscpConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"), - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableEncryptionAtHost: to.Ptr(true), - // EnableNodePublicIP: to.Ptr(true), - // EnableNodePublicIPv6: to.Ptr(true), - // EnableOverProvisioning: to.Ptr(false), - // EvictionPolicy: to.Ptr(armservicefabricmanagedclusters.EvictionPolicyTypeDeallocate), - // FrontendConfigurations: []*armservicefabricmanagedclusters.FrontendConfiguration{ - // { - // ApplicationGatewayBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"), - // LoadBalancerBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"), - // LoadBalancerInboundNatPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"), - // }}, - // IsPrimary: to.Ptr(false), - // IsSpotVM: to.Ptr(true), - // IsStateless: to.Ptr(true), - // MultiplePlacementGroups: to.Ptr(true), - // NatGatewayID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway"), - // PlacementProperties: map[string]*string{ - // "HasSSD": to.Ptr("true"), - // "NodeColor": to.Ptr("green"), - // "SomeProperty": to.Ptr("5"), - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // SecureBootEnabled: to.Ptr(true), - // SecurityType: to.Ptr(armservicefabricmanagedclusters.SecurityTypeTrustedLaunch), - // ServiceArtifactReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile"), - // SpotRestoreTimeout: to.Ptr("PT30M"), - // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // UseDefaultPublicLoadBalancer: to.Ptr(true), - // UseEphemeralOSDisk: to.Ptr(true), - // VMApplications: []*armservicefabricmanagedclusters.VMApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/containername/blobname"), - // EnableAutomaticUpgrade: to.Ptr(true), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0"), - // TreatFailureAsDeploymentFailure: to.Ptr(false), - // VMGalleryTags: to.Ptr("{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}"), - // }}, - // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ - // { - // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), - // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ - // Type: to.Ptr("GenevaMonitoring"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("v.1.0"), - // Publisher: to.Ptr("Microsoft.Azure.Geneva"), - // Settings: map[string]any{ // }, - // SetupOrder: []*armservicefabricmanagedclusters.VmssExtensionSetupOrder{ - // to.Ptr(armservicefabricmanagedclusters.VmssExtensionSetupOrderBeforeSFRuntime)}, + // }, + // }, + // Capacities: map[string]*string{ + // "ClientConnections": to.Ptr("65536"), + // }, + // DataDiskLetter: to.Ptr("S"), + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), + // DscpConfigurationID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"), + // EnableAcceleratedNetworking: to.Ptr(true), + // EnableEncryptionAtHost: to.Ptr(true), + // EnableNodePublicIP: to.Ptr(true), + // EnableNodePublicIPv6: to.Ptr(true), + // EnableOverProvisioning: to.Ptr(false), + // EvictionPolicy: to.Ptr(armservicefabricmanagedclusters.EvictionPolicyTypeDeallocate), + // FrontendConfigurations: []*armservicefabricmanagedclusters.FrontendConfiguration{ + // { + // ApplicationGatewayBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"), + // LoadBalancerBackendAddressPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"), + // LoadBalancerInboundNatPoolID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"), + // }, + // }, + // IsPrimary: to.Ptr(false), + // IsSpotVM: to.Ptr(true), + // IsStateless: to.Ptr(true), + // MultiplePlacementGroups: to.Ptr(true), + // NatGatewayID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway"), + // PlacementProperties: map[string]*string{ + // "HasSSD": to.Ptr("true"), + // "NodeColor": to.Ptr("green"), + // "SomeProperty": to.Ptr("5"), + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // SecureBootEnabled: to.Ptr(true), + // SecurityType: to.Ptr(armservicefabricmanagedclusters.SecurityTypeConfidentialVM), + // SecurityEncryptionType: to.Ptr(armservicefabricmanagedclusters.SecurityEncryptionTypeDiskWithVMGuestState), + // ServiceArtifactReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile"), + // SpotRestoreTimeout: to.Ptr("PT30M"), + // SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + // UseDefaultPublicLoadBalancer: to.Ptr(true), + // UseEphemeralOSDisk: to.Ptr(true), + // VMApplications: []*armservicefabricmanagedclusters.VMApplication{ + // { + // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/containername/blobname"), + // EnableAutomaticUpgrade: to.Ptr(true), + // Order: to.Ptr[int32](1), + // PackageReferenceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0"), + // TreatFailureAsDeploymentFailure: to.Ptr(false), + // VMGalleryTags: to.Ptr("{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}"), + // }, + // }, + // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ + // { + // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), + // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ + // Type: to.Ptr("GenevaMonitoring"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // ForceUpdateTag: to.Ptr("v.1.0"), + // Publisher: to.Ptr("Microsoft.Azure.Geneva"), + // Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{ + // }, + // SetupOrder: []*armservicefabricmanagedclusters.VmssExtensionSetupOrder{ + // to.Ptr(armservicefabricmanagedclusters.VmssExtensionSetupOrderBeforeSFRuntime), + // }, // TypeHandlerVersion: to.Ptr("2.0"), // }, - // }}, + // }, + // }, // VMImageOffer: to.Ptr("WindowsServer"), // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), @@ -701,427 +812,512 @@ func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMaximumParameter // VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ // UserAssignedIdentities: []*string{ // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2")}, + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2"), + // }, + // }, + // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ + // { + // SourceVault: &armservicefabricmanagedclusters.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), + // }, + // VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ + // { + // CertificateStore: to.Ptr("My"), + // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), + // }, + // }, // }, - // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ - // { - // SourceVault: &armservicefabricmanagedclusters.SubResource{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), + // }, + // VMSetupActions: []*armservicefabricmanagedclusters.VMSetupAction{ + // to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableContainers), + // to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableHyperV), + // }, + // VMSize: to.Ptr("Standard_DS3"), + // Zones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-03-01-preview/NodeTypePutOperation_example_min.json +func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMinimumParameters() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ + Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + DataDiskSizeGB: to.Ptr[int32](200), + IsPrimary: to.Ptr(false), + VMImageOffer: to.Ptr("WindowsServer"), + VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), + VMImageVersion: to.Ptr("latest"), + VMInstanceCount: to.Ptr[int32](10), + VMSize: to.Ptr("Standard_D3"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.NodeTypesClientCreateOrUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateCreating), + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](10), + // VMSize: to.Ptr("Standard_D3"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-03-01-preview/DeallocateNodes_example.json +func ExampleNodeTypesClient_BeginDeallocate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNodeTypesClient().BeginDeallocate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ + Nodes: []*string{ + to.Ptr("BE_0"), + to.Ptr("BE_1"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-03-01-preview/NodeTypeDeleteOperation_example.json +func ExampleNodeTypesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNodeTypesClient().BeginDelete(ctx, "resRg", "myCluster", "BE", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-03-01-preview/DeleteNodes_example.json +func ExampleNodeTypesClient_BeginDeleteNode() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNodeTypesClient().BeginDeleteNode(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ + Nodes: []*string{ + to.Ptr("BE_0"), + to.Ptr("BE_3"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-03-01-preview/NodeTypeGetOperation_example.json +func ExampleNodeTypesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNodeTypesClient().Get(ctx, "resRg", "myCluster", "FE", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.NodeTypesClientGetResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("FE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/FE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // }, + // DataDiskSizeGB: to.Ptr[int32](100), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // IsPrimary: to.Ptr(true), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // }, + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2016-Datacenter"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](5), + // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ + // { + // SourceVault: &armservicefabricmanagedclusters.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), + // }, + // VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ + // { + // CertificateStore: to.Ptr("My"), + // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), // }, - // VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ - // { - // CertificateStore: to.Ptr("My"), - // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), - // }}, - // }}, - // VMSetupActions: []*armservicefabricmanagedclusters.VMSetupAction{ - // to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableContainers), - // to.Ptr(armservicefabricmanagedclusters.VMSetupActionEnableHyperV)}, - // VMSize: to.Ptr("Standard_DS3"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, // }, - // } + // }, + // }, + // VMSize: to.Ptr("Standard_D2"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // } +} + +// Generated from example definition: 2025-03-01-preview/NodeTypeListOperation_example.json +func ExampleNodeTypesClient_NewListByManagedClustersPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNodeTypesClient().NewListByManagedClustersPager("resRg", "myCluster", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armservicefabricmanagedclusters.NodeTypesClientListByManagedClustersResponse{ + // NodeTypeListResult: armservicefabricmanagedclusters.NodeTypeListResult{ + // NextLink: to.Ptr("http://examplelink.com"), + // Value: []*armservicefabricmanagedclusters.NodeType{ + // { + // Name: to.Ptr("FE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/FE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // }, + // DataDiskSizeGB: to.Ptr[int32](100), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // IsPrimary: to.Ptr(true), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // }, + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2016-Datacenter"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](5), + // VMSize: to.Ptr("Standard_D2"), + // }, + // SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ + // Name: to.Ptr("Standard_P0"), + // Capacity: to.Ptr[int32](5), + // Tier: to.Ptr("Standard"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // { + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypePremiumLRS), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // }, + // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ + // { + // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), + // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ + // Type: to.Ptr("GenevaMonitoring"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // Publisher: to.Ptr("Microsoft.Azure.Geneva"), + // Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{ + // }, + // TypeHandlerVersion: to.Ptr("2.0"), + // }, + // }, + // }, + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](10), + // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ + // { + // SourceVault: &armservicefabricmanagedclusters.SubResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), + // }, + // VaultCertificates: []*armservicefabricmanagedclusters.VaultCertificate{ + // { + // CertificateStore: to.Ptr("My"), + // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), + // }, + // }, + // }, + // }, + // VMSize: to.Ptr("Standard_DS3"), + // }, + // SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ + // Name: to.Ptr("Standard_S0"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // Tags: map[string]*string{ + // }, + // }, + // }, + // }, + // } + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_min.json -func ExampleNodeTypesClient_BeginCreateOrUpdate_putANodeTypeWithMinimumParameters() { +// Generated from example definition: 2025-03-01-preview/RedeployNodes_UD_example.json +func ExampleNodeTypesClient_BeginRedeploy_redeployAllNodesByUpgradeDomain() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ - Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - DataDiskSizeGB: to.Ptr[int32](200), - IsPrimary: to.Ptr(false), - VMImageOffer: to.Ptr("WindowsServer"), - VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), - VMImageVersion: to.Ptr("latest"), - VMInstanceCount: to.Ptr[int32](10), - VMSize: to.Ptr("Standard_D3"), - }, + poller, err := clientFactory.NewNodeTypesClient().BeginRedeploy(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ + UpdateType: to.Ptr(armservicefabricmanagedclusters.UpdateTypeByUpgradeDomain), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](10), - // VMSize: to.Ptr("Standard_D3"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationStateless_example.json -func ExampleNodeTypesClient_BeginCreateOrUpdate_putAnStatelessNodeTypeWithTemporaryDiskForServiceFabric() { +// Generated from example definition: 2025-03-01-preview/RedeployNodes_example.json +func ExampleNodeTypesClient_BeginRedeploy_redeployNodes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ - Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - EnableEncryptionAtHost: to.Ptr(true), - IsPrimary: to.Ptr(false), - IsStateless: to.Ptr(true), - MultiplePlacementGroups: to.Ptr(true), - UseTempDataDisk: to.Ptr(true), - VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ - { - Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), - Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ - Type: to.Ptr("GenevaMonitoring"), - AutoUpgradeMinorVersion: to.Ptr(true), - Publisher: to.Ptr("Microsoft.Azure.Geneva"), - Settings: map[string]any{}, - TypeHandlerVersion: to.Ptr("2.0"), - }, - }}, - VMImageOffer: to.Ptr("WindowsServer"), - VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), - VMImageVersion: to.Ptr("latest"), - VMInstanceCount: to.Ptr[int32](10), - VMSize: to.Ptr("Standard_DS3"), + poller, err := clientFactory.NewNodeTypesClient().BeginRedeploy(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ + Nodes: []*string{ + to.Ptr("BE_0"), + to.Ptr("BE_1"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // EnableEncryptionAtHost: to.Ptr(true), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(true), - // MultiplePlacementGroups: to.Ptr(true), - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // UseTempDataDisk: to.Ptr(true), - // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ - // { - // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), - // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ - // Type: to.Ptr("GenevaMonitoring"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // Publisher: to.Ptr("Microsoft.Azure.Geneva"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("2.0"), - // }, - // }}, - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](10), - // VMSize: to.Ptr("Standard_DS3"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomImage_example.json -func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithCustomVmImage() { +// Generated from example definition: 2025-03-01-preview/ReimageNodes_UD_example.json +func ExampleNodeTypesClient_BeginReimage_reimageAllNodesByUpgradeDomain() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ - Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - DataDiskSizeGB: to.Ptr[int32](200), - IsPrimary: to.Ptr(false), - VMImageResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"), - VMInstanceCount: to.Ptr[int32](10), - VMSize: to.Ptr("Standard_D3"), - }, + poller, err := clientFactory.NewNodeTypesClient().BeginReimage(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ + UpdateType: to.Ptr(armservicefabricmanagedclusters.UpdateTypeByUpgradeDomain), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // VMImageResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"), - // VMInstanceCount: to.Ptr[int32](10), - // VMSize: to.Ptr("Standard_D3"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json -func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithDedicatedHosts() { +// Generated from example definition: 2025-03-01-preview/ReimageNodes_example.json +func ExampleNodeTypesClient_BeginReimage_reimageNodes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ - Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - Capacities: map[string]*string{}, - DataDiskSizeGB: to.Ptr[int32](200), - DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup"), - IsPrimary: to.Ptr(false), - PlacementProperties: map[string]*string{}, - VMImageOffer: to.Ptr("WindowsServer"), - VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - VMImageSKU: to.Ptr("2019-Datacenter"), - VMImageVersion: to.Ptr("latest"), - VMInstanceCount: to.Ptr[int32](10), - VMSize: to.Ptr("Standard_D8s_v3"), - Zones: []*string{ - to.Ptr("1")}, + poller, err := clientFactory.NewNodeTypesClient().BeginReimage(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ + Nodes: []*string{ + to.Ptr("BE_0"), + to.Ptr("BE_3"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup"), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2019-Datacenter"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](10), - // VMSize: to.Ptr("Standard_D8s_v3"), - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json -func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithSharedGalleriesCustomVmImage() { +// Generated from example definition: 2025-03-01-preview/RestartNodes_example.json +func ExampleNodeTypesClient_BeginRestart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ - Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - DataDiskSizeGB: to.Ptr[int32](200), - IsPrimary: to.Ptr(false), - VMInstanceCount: to.Ptr[int32](10), - VMSharedGalleryImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"), - VMSize: to.Ptr("Standard_D3"), + poller, err := clientFactory.NewNodeTypesClient().BeginRestart(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ + Nodes: []*string{ + to.Ptr("BE_0"), + to.Ptr("BE_3"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // VMInstanceCount: to.Ptr[int32](10), - // VMSharedGalleryImageID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"), - // VMSize: to.Ptr("Standard_D3"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json -func ExampleNodeTypesClient_BeginCreateOrUpdate_putNodeTypeWithVmImagePlan() { +// Generated from example definition: 2025-03-01-preview/StartNodes_example.json +func ExampleNodeTypesClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewNodeTypesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeType{ - Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - DataDiskSizeGB: to.Ptr[int32](200), - IsPrimary: to.Ptr(false), - VMImageOffer: to.Ptr("windows_2022_test"), - VMImagePlan: &armservicefabricmanagedclusters.VMImagePlan{ - Name: to.Ptr("win_2022_test_20_10_gen2"), - Product: to.Ptr("windows_2022_test"), - Publisher: to.Ptr("testpublisher"), - }, - VMImagePublisher: to.Ptr("testpublisher"), - VMImageSKU: to.Ptr("win_2022_test_20_10_gen2"), - VMImageVersion: to.Ptr("latest"), - VMInstanceCount: to.Ptr[int32](10), - VMSize: to.Ptr("Standard_D3"), + poller, err := clientFactory.NewNodeTypesClient().BeginStart(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeActionParameters{ + Nodes: []*string{ + to.Ptr("BE_0"), + to.Ptr("BE_1"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // VMImageOffer: to.Ptr("windows_2022_test"), - // VMImagePlan: &armservicefabricmanagedclusters.VMImagePlan{ - // Name: to.Ptr("win_2022_test_20_10_gen2"), - // Product: to.Ptr("windows_2022_test"), - // Publisher: to.Ptr("testpublisher"), - // }, - // VMImagePublisher: to.Ptr("testpublisher"), - // VMImageSKU: to.Ptr("win_2022_test_20_10_gen2"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](10), - // VMSize: to.Ptr("Standard_D3"), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePatchOperation_example.json -func ExampleNodeTypesClient_BeginUpdate_patchANodeType() { +// Generated from example definition: 2025-03-01-preview/NodeTypePatchOperationAutoScale_example.json +func ExampleNodeTypesClient_BeginUpdate_patchANodeTypeWhileAutoScaling() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewNodeTypesClient().BeginUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeUpdateParameters{ + SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ + Name: to.Ptr("Standard_S0"), + Capacity: to.Ptr[int32](10), + Tier: to.Ptr("Standard"), + }, Tags: map[string]*string{ "a": to.Ptr("b"), }, @@ -1136,47 +1332,47 @@ func ExampleNodeTypesClient_BeginUpdate_patchANodeType() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // "ClientConnections": to.Ptr("65536"), - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // "HasSSD": to.Ptr("true"), - // "NodeColor": to.Ptr("green"), - // "SomeProperty": to.Ptr("5"), - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ - // { - // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), - // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ - // Type: to.Ptr("GenevaMonitoring"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // Publisher: to.Ptr("Microsoft.Azure.Geneva"), - // Settings: map[string]any{ + // res = armservicefabricmanagedclusters.NodeTypesClientUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // "ClientConnections": to.Ptr("65536"), + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // "HasSSD": to.Ptr("true"), + // "NodeColor": to.Ptr("green"), + // "SomeProperty": to.Ptr("5"), + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ + // { + // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), + // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ + // Type: to.Ptr("GenevaMonitoring"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // Publisher: to.Ptr("Microsoft.Azure.Geneva"), + // Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{ + // }, + // TypeHandlerVersion: to.Ptr("2.0"), // }, - // TypeHandlerVersion: to.Ptr("2.0"), // }, - // }}, - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](10), - // VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ - // UserAssignedIdentities: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity")}, + // }, + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](10), + // VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ + // UserAssignedIdentities: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), + // }, // }, // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ // { @@ -1187,30 +1383,36 @@ func ExampleNodeTypesClient_BeginUpdate_patchANodeType() { // { // CertificateStore: to.Ptr("My"), // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), - // }}, - // }}, + // }, + // }, + // }, + // }, // VMSize: to.Ptr("Standard_D3"), // }, - // } + // SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ + // Name: to.Ptr("Standard_S0"), + // Capacity: to.Ptr[int32](10), + // Tier: to.Ptr("Standard"), + // }, + // Tags: map[string]*string{ + // "a": to.Ptr("b"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePatchOperationAutoScale_example.json -func ExampleNodeTypesClient_BeginUpdate_patchANodeTypeWhileAutoScaling() { +// Generated from example definition: 2025-03-01-preview/NodeTypePatchOperation_example.json +func ExampleNodeTypesClient_BeginUpdate_patchANodeType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewNodeTypesClient().BeginUpdate(ctx, "resRg", "myCluster", "BE", armservicefabricmanagedclusters.NodeTypeUpdateParameters{ - SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ - Name: to.Ptr("Standard_S0"), - Capacity: to.Ptr[int32](10), - Tier: to.Ptr("Standard"), - }, Tags: map[string]*string{ "a": to.Ptr("b"), }, @@ -1225,47 +1427,47 @@ func ExampleNodeTypesClient_BeginUpdate_patchANodeTypeWhileAutoScaling() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NodeType = armservicefabricmanagedclusters.NodeType{ - // Name: to.Ptr("BE"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ - // Capacities: map[string]*string{ - // "ClientConnections": to.Ptr("65536"), - // }, - // DataDiskSizeGB: to.Ptr[int32](200), - // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), - // IsPrimary: to.Ptr(false), - // IsStateless: to.Ptr(false), - // PlacementProperties: map[string]*string{ - // "HasSSD": to.Ptr("true"), - // "NodeColor": to.Ptr("green"), - // "SomeProperty": to.Ptr("5"), - // }, - // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), - // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ - // { - // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), - // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ - // Type: to.Ptr("GenevaMonitoring"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // Publisher: to.Ptr("Microsoft.Azure.Geneva"), - // Settings: map[string]any{ + // res = armservicefabricmanagedclusters.NodeTypesClientUpdateResponse{ + // NodeType: &armservicefabricmanagedclusters.NodeType{ + // Name: to.Ptr("BE"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedClusters/myCluster/nodeTypes/BE"), + // Properties: &armservicefabricmanagedclusters.NodeTypeProperties{ + // Capacities: map[string]*string{ + // "ClientConnections": to.Ptr("65536"), + // }, + // DataDiskSizeGB: to.Ptr[int32](200), + // DataDiskType: to.Ptr(armservicefabricmanagedclusters.DiskTypeStandardSSDLRS), + // IsPrimary: to.Ptr(false), + // IsStateless: to.Ptr(false), + // PlacementProperties: map[string]*string{ + // "HasSSD": to.Ptr("true"), + // "NodeColor": to.Ptr("green"), + // "SomeProperty": to.Ptr("5"), + // }, + // ProvisioningState: to.Ptr(armservicefabricmanagedclusters.ManagedResourceProvisioningStateSucceeded), + // VMExtensions: []*armservicefabricmanagedclusters.VMSSExtension{ + // { + // Name: to.Ptr("Microsoft.Azure.Geneva.GenevaMonitoring"), + // Properties: &armservicefabricmanagedclusters.VMSSExtensionProperties{ + // Type: to.Ptr("GenevaMonitoring"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // Publisher: to.Ptr("Microsoft.Azure.Geneva"), + // Settings: &armservicefabricmanagedclusters.VMSSExtensionPropertiesSettings{ + // }, + // TypeHandlerVersion: to.Ptr("2.0"), // }, - // TypeHandlerVersion: to.Ptr("2.0"), // }, - // }}, - // VMImageOffer: to.Ptr("WindowsServer"), - // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), - // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), - // VMImageVersion: to.Ptr("latest"), - // VMInstanceCount: to.Ptr[int32](10), - // VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ - // UserAssignedIdentities: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity")}, + // }, + // VMImageOffer: to.Ptr("WindowsServer"), + // VMImagePublisher: to.Ptr("MicrosoftWindowsServer"), + // VMImageSKU: to.Ptr("2016-Datacenter-Server-Core"), + // VMImageVersion: to.Ptr("latest"), + // VMInstanceCount: to.Ptr[int32](10), + // VMManagedIdentity: &armservicefabricmanagedclusters.VMManagedIdentity{ + // UserAssignedIdentities: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), + // }, // }, // VMSecrets: []*armservicefabricmanagedclusters.VaultSecretGroup{ // { @@ -1276,35 +1478,15 @@ func ExampleNodeTypesClient_BeginUpdate_patchANodeTypeWhileAutoScaling() { // { // CertificateStore: to.Ptr("My"), // CertificateURL: to.Ptr("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), - // }}, - // }}, + // }, + // }, + // }, + // }, // VMSize: to.Ptr("Standard_D3"), // }, - // SKU: &armservicefabricmanagedclusters.NodeTypeSKU{ - // Name: to.Ptr("Standard_S0"), - // Capacity: to.Ptr[int32](10), - // Tier: to.Ptr("Standard"), + // Tags: map[string]*string{ + // "a": to.Ptr("b"), // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeDeleteOperation_example.json -func ExampleNodeTypesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNodeTypesClient().BeginDelete(ctx, "resRg", "myCluster", "BE", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } + // }, + // } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypeskus_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypeskus_client.go index 1c7a17024e5a..528928b5bad3 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypeskus_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypeskus_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type NodeTypeSKUsClient struct { } // NewNodeTypeSKUsClient creates a new instance of NodeTypeSKUsClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNodeTypeSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NodeTypeSKUsClient, error) { @@ -45,8 +41,8 @@ func NewNodeTypeSKUsClient(subscriptionID string, credential azcore.TokenCredent // NewListPager - Get a Service Fabric node type supported SKUs. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - nodeTypeName - The name of the node type. // - options - NodeTypeSKUsClientListOptions contains the optional parameters for the NodeTypeSKUsClient.NewListPager method. @@ -74,7 +70,7 @@ func (client *NodeTypeSKUsClient) NewListPager(resourceGroupName string, cluster } // listCreateRequest creates the List request. -func (client *NodeTypeSKUsClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, options *NodeTypeSKUsClientListOptions) (*policy.Request, error) { +func (client *NodeTypeSKUsClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, nodeTypeName string, _ *NodeTypeSKUsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/skus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -97,7 +93,7 @@ func (client *NodeTypeSKUsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypeskus_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypeskus_client_example_test.go index b70d078f51b1..3b08d0fb8552 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypeskus_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/nodetypeskus_client_example_test.go @@ -1,30 +1,24 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeSkusListOperation_example.json +// Generated from example definition: 2025-03-01-preview/NodeTypeSkusListOperation_example.json func ExampleNodeTypeSKUsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,60 +33,64 @@ func ExampleNodeTypeSKUsClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NodeTypeListSKUResult = armservicefabricmanagedclusters.NodeTypeListSKUResult{ - // Value: []*armservicefabricmanagedclusters.NodeTypeAvailableSKU{ - // { - // Capacity: &armservicefabricmanagedclusters.NodeTypeSKUCapacity{ - // Default: to.Ptr[int32](1), - // Maximum: to.Ptr[int32](100), - // Minimum: to.Ptr[int32](1), - // ScaleType: to.Ptr(armservicefabricmanagedclusters.NodeTypeSKUScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // SKU: &armservicefabricmanagedclusters.NodeTypeSupportedSKU{ - // Name: to.Ptr("Standard_S0"), - // Tier: to.Ptr("Standard"), + // page = armservicefabricmanagedclusters.NodeTypeSKUsClientListResponse{ + // NodeTypeListSKUResult: armservicefabricmanagedclusters.NodeTypeListSKUResult{ + // NextLink: to.Ptr("http://examplelink.com"), + // Value: []*armservicefabricmanagedclusters.NodeTypeAvailableSKU{ + // { + // Capacity: &armservicefabricmanagedclusters.NodeTypeSKUCapacity{ + // Default: to.Ptr[int32](1), + // Maximum: to.Ptr[int32](100), + // Minimum: to.Ptr[int32](1), + // ScaleType: to.Ptr(armservicefabricmanagedclusters.NodeTypeSKUScaleTypeAutomatic), + // }, + // ResourceType: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // SKU: &armservicefabricmanagedclusters.NodeTypeSupportedSKU{ + // Name: to.Ptr("Standard_S0"), + // Tier: to.Ptr("Standard"), + // }, // }, - // }, - // { - // Capacity: &armservicefabricmanagedclusters.NodeTypeSKUCapacity{ - // Default: to.Ptr[int32](3), - // Maximum: to.Ptr[int32](300), - // Minimum: to.Ptr[int32](3), - // ScaleType: to.Ptr(armservicefabricmanagedclusters.NodeTypeSKUScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // SKU: &armservicefabricmanagedclusters.NodeTypeSupportedSKU{ - // Name: to.Ptr("Standard_S1"), - // Tier: to.Ptr("Standard"), + // { + // Capacity: &armservicefabricmanagedclusters.NodeTypeSKUCapacity{ + // Default: to.Ptr[int32](3), + // Maximum: to.Ptr[int32](300), + // Minimum: to.Ptr[int32](3), + // ScaleType: to.Ptr(armservicefabricmanagedclusters.NodeTypeSKUScaleTypeAutomatic), + // }, + // ResourceType: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // SKU: &armservicefabricmanagedclusters.NodeTypeSupportedSKU{ + // Name: to.Ptr("Standard_S1"), + // Tier: to.Ptr("Standard"), + // }, // }, - // }, - // { - // Capacity: &armservicefabricmanagedclusters.NodeTypeSKUCapacity{ - // Default: to.Ptr[int32](1), - // Maximum: to.Ptr[int32](1000), - // Minimum: to.Ptr[int32](1), - // ScaleType: to.Ptr(armservicefabricmanagedclusters.NodeTypeSKUScaleTypeAutomatic), + // { + // Capacity: &armservicefabricmanagedclusters.NodeTypeSKUCapacity{ + // Default: to.Ptr[int32](1), + // Maximum: to.Ptr[int32](1000), + // Minimum: to.Ptr[int32](1), + // ScaleType: to.Ptr(armservicefabricmanagedclusters.NodeTypeSKUScaleTypeAutomatic), + // }, + // ResourceType: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // SKU: &armservicefabricmanagedclusters.NodeTypeSupportedSKU{ + // Name: to.Ptr("Standard_S2"), + // Tier: to.Ptr("Standard"), + // }, // }, - // ResourceType: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // SKU: &armservicefabricmanagedclusters.NodeTypeSupportedSKU{ - // Name: to.Ptr("Standard_S2"), - // Tier: to.Ptr("Standard"), + // { + // Capacity: &armservicefabricmanagedclusters.NodeTypeSKUCapacity{ + // Default: to.Ptr[int32](3), + // Maximum: to.Ptr[int32](1000), + // Minimum: to.Ptr[int32](3), + // ScaleType: to.Ptr(armservicefabricmanagedclusters.NodeTypeSKUScaleTypeAutomatic), + // }, + // ResourceType: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), + // SKU: &armservicefabricmanagedclusters.NodeTypeSupportedSKU{ + // Name: to.Ptr("Standard_S3"), + // Tier: to.Ptr("Standard"), + // }, // }, // }, - // { - // Capacity: &armservicefabricmanagedclusters.NodeTypeSKUCapacity{ - // Default: to.Ptr[int32](3), - // Maximum: to.Ptr[int32](1000), - // Minimum: to.Ptr[int32](3), - // ScaleType: to.Ptr(armservicefabricmanagedclusters.NodeTypeSKUScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("Microsoft.ServiceFabric/managedClusters/nodeTypes"), - // SKU: &armservicefabricmanagedclusters.NodeTypeSupportedSKU{ - // Name: to.Ptr("Standard_S3"), - // Tier: to.Ptr("Standard"), - // }, - // }}, + // }, // } } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationresults_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationresults_client.go index d8309827e980..045d04e2e04f 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationresults_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationresults_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type OperationResultsClient struct { } // NewOperationResultsClient creates a new instance of OperationResultsClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationResultsClient, error) { @@ -43,37 +39,62 @@ func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// Get - Get long running operation result. +// BeginGet - Get long running operation result. +// +// Get long running operation result. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - location - The location for the cluster code versions. This is different from cluster location. +// Generated from API version 2025-03-01-preview +// - location - The name of the Azure region. // - operationID - operation identifier. -// - options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. -func (client *OperationResultsClient) Get(ctx context.Context, location string, operationID string, options *OperationResultsClientGetOptions) (OperationResultsClientGetResponse, error) { +// - options - OperationResultsClientBeginGetOptions contains the optional parameters for the OperationResultsClient.BeginGet +// method. +func (client *OperationResultsClient) BeginGet(ctx context.Context, location string, operationID string, options *OperationResultsClientBeginGetOptions) (*runtime.Poller[OperationResultsClientGetResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.get(ctx, location, operationID, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[OperationResultsClientGetResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[OperationResultsClientGetResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Get - Get long running operation result. +// +// Get long running operation result. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-03-01-preview +func (client *OperationResultsClient) get(ctx context.Context, location string, operationID string, options *OperationResultsClientBeginGetOptions) (*http.Response, error) { var err error - const operationName = "OperationResultsClient.Get" + const operationName = "OperationResultsClient.BeginGet" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.getCreateRequest(ctx, location, operationID, options) if err != nil { - return OperationResultsClientGetResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return OperationResultsClientGetResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return OperationResultsClientGetResponse{}, err + return nil, err } - resp, err := client.getHandleResponse(httpResp) - return resp, err + return httpResp, nil } // getCreateRequest creates the Get request. -func (client *OperationResultsClient) getCreateRequest(ctx context.Context, location string, operationID string, options *OperationResultsClientGetOptions) (*policy.Request, error) { +func (client *OperationResultsClient) getCreateRequest(ctx context.Context, location string, operationID string, _ *OperationResultsClientBeginGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperationResults/{operationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,17 +113,8 @@ func (client *OperationResultsClient) getCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } - -// getHandleResponse handles the Get response. -func (client *OperationResultsClient) getHandleResponse(resp *http.Response) (OperationResultsClientGetResponse, error) { - result := OperationResultsClientGetResponse{} - if val := resp.Header.Get("Location"); val != "" { - result.Location = &val - } - return result, nil -} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationresults_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationresults_client_example_test.go index 7658b9388588..259b99aa75d9 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationresults_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationresults_client_example_test.go @@ -1,35 +1,38 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/Long_running_operation_result.json -func ExampleOperationResultsClient_Get() { +// Generated from example definition: 2025-03-01-preview/OperationResultsGet_example.json +func ExampleOperationResultsClient_BeginGet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewOperationResultsClient().Get(ctx, "eastus", "00000000-0000-0000-0000-000000001234", nil) + poller, err := clientFactory.NewOperationResultsClient().BeginGet(ctx, "eastus", "00000000-0000-0000-0000-000000001234", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.OperationResultsClientGetResponse{ + // } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operations_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operations_client.go index 2771facb6918..d959c8f44903 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operations_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operations_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -37,9 +33,11 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - Get the list of available Service Fabric resource provider API operations. +// NewListPager - Lists all of the available Service Fabric resource provider API operations. +// +// Get the list of available Service Fabric resource provider API operations. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -65,14 +63,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ServiceFabric/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operations_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operations_client_example_test.go index 8fd932c1426b..95139adf45d9 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operations_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operations_client_example_test.go @@ -1,30 +1,24 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/Operations_example.json +// Generated from example definition: 2025-03-01-preview/OperationsList_example.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -39,89 +33,92 @@ func ExampleOperationsClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armservicefabricmanagedclusters.OperationListResult{ - // Value: []*armservicefabricmanagedclusters.OperationResult{ - // { - // Name: to.Ptr("Microsoft.ServiceFabric/managedClusters/read"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Read any Cluster"), - // Operation: to.Ptr("Read Cluster"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("managedClusters"), + // page = armservicefabricmanagedclusters.OperationsClientListResponse{ + // OperationListResult: armservicefabricmanagedclusters.OperationListResult{ + // Value: []*armservicefabricmanagedclusters.OperationResult{ + // { + // Name: to.Ptr("Microsoft.ServiceFabric/managedClusters/read"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("managedClusters"), + // Operation: to.Ptr("Read Cluster"), + // Description: to.Ptr("Read any Cluster"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceFabric/managedClusters/write"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Create or Update any Cluster"), - // Operation: to.Ptr("Create or Update Cluster"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("managedClusters"), + // { + // Name: to.Ptr("Microsoft.ServiceFabric/managedClusters/write"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("managedClusters"), + // Operation: to.Ptr("Create or Update Cluster"), + // Description: to.Ptr("Create or Update any Cluster"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceFabric/managedClusters/delete"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Delete any Cluster"), - // Operation: to.Ptr("Delete Cluster"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("managedClusters"), + // { + // Name: to.Ptr("Microsoft.ServiceFabric/managedClusters/delete"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("managedClusters"), + // Operation: to.Ptr("Delete Cluster"), + // Description: to.Ptr("Delete any Cluster"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/read"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Read any Node type"), - // Operation: to.Ptr("Read Node type"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("nodeTypes"), + // { + // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/read"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("nodeTypes"), + // Operation: to.Ptr("Read Node type"), + // Description: to.Ptr("Read any Node type"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/write"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Create or Update any Node type"), - // Operation: to.Ptr("Create or Update Node type"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("nodeTypes"), + // { + // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/write"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("nodeTypes"), + // Operation: to.Ptr("Create or Update Node type"), + // Description: to.Ptr("Create or Update any Node type"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/delete"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Delete any Node type"), - // Operation: to.Ptr("Delete Node type"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("nodeTypes"), + // { + // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/delete"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("nodeTypes"), + // Operation: to.Ptr("Delete Node type"), + // Description: to.Ptr("Delete any Node type"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/restart/action"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Restart nodes from Node type"), - // Operation: to.Ptr("Restart nodes from Node type"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("nodeTypes"), + // { + // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/restart/action"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("nodeTypes"), + // Operation: to.Ptr("Restart nodes from Node type"), + // Description: to.Ptr("Restart nodes from Node type"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/reimage/action"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Reimage nodes from Node type"), - // Operation: to.Ptr("Reimage nodes from Node type"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("nodeTypes"), + // { + // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/reimage/action"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("nodeTypes"), + // Operation: to.Ptr("Reimage nodes from Node type"), + // Description: to.Ptr("Reimage nodes from Node type"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/deleteNode/action"), - // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ - // Description: to.Ptr("Delete nodes from Node type"), - // Operation: to.Ptr("Delete nodes from Node type"), - // Provider: to.Ptr("Microsoft ServiceFabric"), - // Resource: to.Ptr("nodeTypes"), + // { + // Name: to.Ptr("Microsoft.ServiceFabric/nodeTypes/deleteNode/action"), + // Display: &armservicefabricmanagedclusters.AvailableOperationDisplay{ + // Provider: to.Ptr("Microsoft ServiceFabric"), + // Resource: to.Ptr("nodeTypes"), + // Operation: to.Ptr("Delete nodes from Node type"), + // Description: to.Ptr("Delete nodes from Node type"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationstatus_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationstatus_client.go index 340684ae9b5e..0926c9b2acaa 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationstatus_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationstatus_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type OperationStatusClient struct { } // NewOperationStatusClient creates a new instance of OperationStatusClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationStatusClient, error) { @@ -44,10 +40,12 @@ func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCred } // Get - Get long running operation status. +// +// Get long running operation status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - location - The location for the cluster code versions. This is different from cluster location. +// Generated from API version 2025-03-01-preview +// - location - The name of the Azure region. // - operationID - operation identifier. // - options - OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method. func (client *OperationStatusClient) Get(ctx context.Context, location string, operationID string, options *OperationStatusClientGetOptions) (OperationStatusClientGetResponse, error) { @@ -73,7 +71,7 @@ func (client *OperationStatusClient) Get(ctx context.Context, location string, o } // getCreateRequest creates the Get request. -func (client *OperationStatusClient) getCreateRequest(ctx context.Context, location string, operationID string, options *OperationStatusClientGetOptions) (*policy.Request, error) { +func (client *OperationStatusClient) getCreateRequest(ctx context.Context, location string, operationID string, _ *OperationStatusClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperations/{operationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -92,7 +90,7 @@ func (client *OperationStatusClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationstatus_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationstatus_client_example_test.go index 81525f98a658..9656f35623d0 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationstatus_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/operationstatus_client_example_test.go @@ -1,30 +1,24 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/Long_running_operation_status_failed.json -func ExampleOperationStatusClient_Get_getFailedOperationStatus() { +// Generated from example definition: 2025-03-01-preview/OperationStatusFailed_example.json +func ExampleOperationStatusClient_Get_errorResponseDescribingWhyTheOperationFailed() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -35,27 +29,29 @@ func ExampleOperationStatusClient_Get_getFailedOperationStatus() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongRunningOperationResult = armservicefabricmanagedclusters.LongRunningOperationResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000001234"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-04T00:13:03.279Z"); return t}()), - // Error: &armservicefabricmanagedclusters.ErrorModelError{ - // Code: to.Ptr("-2146233029"), - // Message: to.Ptr("A task was canceled."), + // res = armservicefabricmanagedclusters.OperationStatusClientGetResponse{ + // LongRunningOperationResult: &armservicefabricmanagedclusters.LongRunningOperationResult{ + // Name: to.Ptr("00000000-0000-0000-0000-000000001234"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-03T23:58:02.2501337Z"); return t}()), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-04T00:13:03.2790951Z"); return t}()), + // PercentComplete: to.Ptr[float64](100), + // Status: to.Ptr("Failed"), + // Error: &armservicefabricmanagedclusters.ErrorModelError{ + // Code: to.Ptr("-2146233029"), + // Message: to.Ptr("A task was canceled."), + // }, // }, - // PercentComplete: to.Ptr[float64](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-03T23:58:02.250Z"); return t}()), - // Status: to.Ptr("Failed"), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/Long_running_operation_status_succeeded.json -func ExampleOperationStatusClient_Get_getSucceededOperationResult() { +// Generated from example definition: 2025-03-01-preview/OperationStatusSucceeded_example.json +func ExampleOperationStatusClient_Get_okTheRequestHasSucceeded() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -66,11 +62,13 @@ func ExampleOperationStatusClient_Get_getSucceededOperationResult() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LongRunningOperationResult = armservicefabricmanagedclusters.LongRunningOperationResult{ - // Name: to.Ptr("00000000-0000-0000-0000-000000001234"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-04T00:13:03.279Z"); return t}()), - // PercentComplete: to.Ptr[float64](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-03T23:58:02.250Z"); return t}()), - // Status: to.Ptr("Succeeded"), + // res = armservicefabricmanagedclusters.OperationStatusClientGetResponse{ + // LongRunningOperationResult: &armservicefabricmanagedclusters.LongRunningOperationResult{ + // Name: to.Ptr("00000000-0000-0000-0000-000000001234"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-03T23:58:02.2501337Z"); return t}()), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-04T00:13:03.2790951Z"); return t}()), + // PercentComplete: to.Ptr[float64](100), + // Status: to.Ptr("Succeeded"), + // }, // } } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/options.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/options.go index 738825895ff7..07f7c6b5c081 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/options.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/options.go @@ -1,24 +1,20 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters // ApplicationTypeVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginCreateOrUpdate // method. type ApplicationTypeVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationTypeVersionsClientBeginDeleteOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginDelete // method. type ApplicationTypeVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -41,7 +37,7 @@ type ApplicationTypeVersionsClientUpdateOptions struct { // ApplicationTypesClientBeginDeleteOptions contains the optional parameters for the ApplicationTypesClient.BeginDelete method. type ApplicationTypesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -69,34 +65,34 @@ type ApplicationTypesClientUpdateOptions struct { // ApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdate // method. type ApplicationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete method. type ApplicationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationsClientBeginReadUpgradeOptions contains the optional parameters for the ApplicationsClient.BeginReadUpgrade // method. type ApplicationsClientBeginReadUpgradeOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationsClientBeginResumeUpgradeOptions contains the optional parameters for the ApplicationsClient.BeginResumeUpgrade // method. type ApplicationsClientBeginResumeUpgradeOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationsClientBeginStartRollbackOptions contains the optional parameters for the ApplicationsClient.BeginStartRollback // method. type ApplicationsClientBeginStartRollbackOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -152,16 +148,36 @@ type ManagedClusterVersionClientListOptions struct { // ManagedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClustersClient.BeginCreateOrUpdate // method. type ManagedClustersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete method. type ManagedClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ManagedClustersClientBeginStartFaultSimulationOptions contains the optional parameters for the ManagedClustersClient.BeginStartFaultSimulation +// method. +type ManagedClustersClientBeginStartFaultSimulationOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } +// ManagedClustersClientBeginStopFaultSimulationOptions contains the optional parameters for the ManagedClustersClient.BeginStopFaultSimulation +// method. +type ManagedClustersClientBeginStopFaultSimulationOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ManagedClustersClientGetFaultSimulationOptions contains the optional parameters for the ManagedClustersClient.GetFaultSimulation +// method. +type ManagedClustersClientGetFaultSimulationOptions struct { + // placeholder for future optional parameters +} + // ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. type ManagedClustersClientGetOptions struct { // placeholder for future optional parameters @@ -179,6 +195,12 @@ type ManagedClustersClientListBySubscriptionOptions struct { // placeholder for future optional parameters } +// ManagedClustersClientListFaultSimulationOptions contains the optional parameters for the ManagedClustersClient.NewListFaultSimulationPager +// method. +type ManagedClustersClientListFaultSimulationOptions struct { + // placeholder for future optional parameters +} + // ManagedClustersClientUpdateOptions contains the optional parameters for the ManagedClustersClient.Update method. type ManagedClustersClientUpdateOptions struct { // placeholder for future optional parameters @@ -210,40 +232,77 @@ type NodeTypeSKUsClientListOptions struct { // NodeTypesClientBeginCreateOrUpdateOptions contains the optional parameters for the NodeTypesClient.BeginCreateOrUpdate // method. type NodeTypesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// NodeTypesClientBeginDeallocateOptions contains the optional parameters for the NodeTypesClient.BeginDeallocate method. +type NodeTypesClientBeginDeallocateOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } // NodeTypesClientBeginDeleteNodeOptions contains the optional parameters for the NodeTypesClient.BeginDeleteNode method. type NodeTypesClientBeginDeleteNodeOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // NodeTypesClientBeginDeleteOptions contains the optional parameters for the NodeTypesClient.BeginDelete method. type NodeTypesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// NodeTypesClientBeginRedeployOptions contains the optional parameters for the NodeTypesClient.BeginRedeploy method. +type NodeTypesClientBeginRedeployOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } // NodeTypesClientBeginReimageOptions contains the optional parameters for the NodeTypesClient.BeginReimage method. type NodeTypesClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // NodeTypesClientBeginRestartOptions contains the optional parameters for the NodeTypesClient.BeginRestart method. type NodeTypesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// NodeTypesClientBeginStartFaultSimulationOptions contains the optional parameters for the NodeTypesClient.BeginStartFaultSimulation +// method. +type NodeTypesClientBeginStartFaultSimulationOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// NodeTypesClientBeginStartOptions contains the optional parameters for the NodeTypesClient.BeginStart method. +type NodeTypesClientBeginStartOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// NodeTypesClientBeginStopFaultSimulationOptions contains the optional parameters for the NodeTypesClient.BeginStopFaultSimulation +// method. +type NodeTypesClientBeginStopFaultSimulationOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } // NodeTypesClientBeginUpdateOptions contains the optional parameters for the NodeTypesClient.BeginUpdate method. type NodeTypesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } +// NodeTypesClientGetFaultSimulationOptions contains the optional parameters for the NodeTypesClient.GetFaultSimulation method. +type NodeTypesClientGetFaultSimulationOptions struct { + // placeholder for future optional parameters +} + // NodeTypesClientGetOptions contains the optional parameters for the NodeTypesClient.Get method. type NodeTypesClientGetOptions struct { // placeholder for future optional parameters @@ -255,11 +314,18 @@ type NodeTypesClientListByManagedClustersOptions struct { // placeholder for future optional parameters } -// OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. -type OperationResultsClientGetOptions struct { +// NodeTypesClientListFaultSimulationOptions contains the optional parameters for the NodeTypesClient.NewListFaultSimulationPager +// method. +type NodeTypesClientListFaultSimulationOptions struct { // placeholder for future optional parameters } +// OperationResultsClientBeginGetOptions contains the optional parameters for the OperationResultsClient.BeginGet method. +type OperationResultsClientBeginGetOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + // OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method. type OperationStatusClientGetOptions struct { // placeholder for future optional parameters @@ -272,13 +338,13 @@ type OperationsClientListOptions struct { // ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. type ServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. type ServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/polymorphic_helpers.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/polymorphic_helpers.go index 1f12369f2d37..8bc1f357ac70 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/polymorphic_helpers.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/polymorphic_helpers.go @@ -1,15 +1,32 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters import "encoding/json" +func unmarshalFaultSimulationContentClassification(rawMsg json.RawMessage) (FaultSimulationContentClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b FaultSimulationContentClassification + switch m["faultKind"] { + case string(FaultKindZone): + b = &ZoneFaultSimulationContent{} + default: + b = &FaultSimulationContent{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalPartitionClassification(rawMsg json.RawMessage) (PartitionClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil @@ -20,12 +37,12 @@ func unmarshalPartitionClassification(rawMsg json.RawMessage) (PartitionClassifi } var b PartitionClassification switch m["partitionScheme"] { - case string(PartitionSchemeNamed): - b = &NamedPartitionScheme{} - case string(PartitionSchemeSingleton): - b = &SingletonPartitionScheme{} case string(PartitionSchemeUniformInt64Range): b = &UniformInt64RangePartitionScheme{} + case string(PartitionSchemeSingleton): + b = &SingletonPartitionScheme{} + case string(PartitionSchemeNamed): + b = &NamedPartitionScheme{} default: b = &Partition{} } @@ -93,14 +110,14 @@ func unmarshalServicePlacementPolicyClassification(rawMsg json.RawMessage) (Serv switch m["type"] { case string(ServicePlacementPolicyTypeInvalidDomain): b = &ServicePlacementInvalidDomainPolicy{} - case string(ServicePlacementPolicyTypeNonPartiallyPlaceService): - b = &ServicePlacementNonPartiallyPlaceServicePolicy{} - case string(ServicePlacementPolicyTypePreferredPrimaryDomain): - b = &ServicePlacementPreferPrimaryDomainPolicy{} case string(ServicePlacementPolicyTypeRequiredDomain): b = &ServicePlacementRequiredDomainPolicy{} + case string(ServicePlacementPolicyTypePreferredPrimaryDomain): + b = &ServicePlacementPreferPrimaryDomainPolicy{} case string(ServicePlacementPolicyTypeRequiredDomainDistribution): b = &ServicePlacementRequireDomainDistributionPolicy{} + case string(ServicePlacementPolicyTypeNonPartiallyPlaceService): + b = &ServicePlacementNonPartiallyPlaceServicePolicy{} default: b = &ServicePlacementPolicy{} } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/responses.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/responses.go index 7d1bbbb348e2..425f8504fb24 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/responses.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/responses.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -135,13 +131,11 @@ type ManagedClusterVersionClientGetResponse struct { // ManagedClusterVersionClientListByEnvironmentResponse contains the response from method ManagedClusterVersionClient.ListByEnvironment. type ManagedClusterVersionClientListByEnvironmentResponse struct { - // The list results of the Service Fabric runtime versions. ManagedClusterCodeVersionResultArray []*ManagedClusterCodeVersionResult } // ManagedClusterVersionClientListResponse contains the response from method ManagedClusterVersionClient.List. type ManagedClusterVersionClientListResponse struct { - // The list results of the Service Fabric runtime versions. ManagedClusterCodeVersionResultArray []*ManagedClusterCodeVersionResult } @@ -156,6 +150,12 @@ type ManagedClustersClientDeleteResponse struct { // placeholder for future response values } +// ManagedClustersClientGetFaultSimulationResponse contains the response from method ManagedClustersClient.GetFaultSimulation. +type ManagedClustersClientGetFaultSimulationResponse struct { + // Fault simulation object with status. + FaultSimulation +} + // ManagedClustersClientGetResponse contains the response from method ManagedClustersClient.Get. type ManagedClustersClientGetResponse struct { // The managed cluster resource @@ -164,16 +164,34 @@ type ManagedClustersClientGetResponse struct { // ManagedClustersClientListByResourceGroupResponse contains the response from method ManagedClustersClient.NewListByResourceGroupPager. type ManagedClustersClientListByResourceGroupResponse struct { - // Managed Cluster list results + // The response of a ManagedCluster list operation. ManagedClusterListResult } // ManagedClustersClientListBySubscriptionResponse contains the response from method ManagedClustersClient.NewListBySubscriptionPager. type ManagedClustersClientListBySubscriptionResponse struct { - // Managed Cluster list results + // The response of a ManagedCluster list operation. ManagedClusterListResult } +// ManagedClustersClientListFaultSimulationResponse contains the response from method ManagedClustersClient.NewListFaultSimulationPager. +type ManagedClustersClientListFaultSimulationResponse struct { + // Fault simulation list results + FaultSimulationListResult +} + +// ManagedClustersClientStartFaultSimulationResponse contains the response from method ManagedClustersClient.BeginStartFaultSimulation. +type ManagedClustersClientStartFaultSimulationResponse struct { + // Fault simulation object with status. + FaultSimulation +} + +// ManagedClustersClientStopFaultSimulationResponse contains the response from method ManagedClustersClient.BeginStopFaultSimulation. +type ManagedClustersClientStopFaultSimulationResponse struct { + // Fault simulation object with status. + FaultSimulation +} + // ManagedClustersClientUpdateResponse contains the response from method ManagedClustersClient.Update. type ManagedClustersClientUpdateResponse struct { // The managed cluster resource @@ -210,6 +228,11 @@ type NodeTypesClientCreateOrUpdateResponse struct { NodeType } +// NodeTypesClientDeallocateResponse contains the response from method NodeTypesClient.BeginDeallocate. +type NodeTypesClientDeallocateResponse struct { + // placeholder for future response values +} + // NodeTypesClientDeleteNodeResponse contains the response from method NodeTypesClient.BeginDeleteNode. type NodeTypesClientDeleteNodeResponse struct { // placeholder for future response values @@ -220,6 +243,12 @@ type NodeTypesClientDeleteResponse struct { // placeholder for future response values } +// NodeTypesClientGetFaultSimulationResponse contains the response from method NodeTypesClient.GetFaultSimulation. +type NodeTypesClientGetFaultSimulationResponse struct { + // Fault simulation object with status. + FaultSimulation +} + // NodeTypesClientGetResponse contains the response from method NodeTypesClient.Get. type NodeTypesClientGetResponse struct { // Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. @@ -228,10 +257,21 @@ type NodeTypesClientGetResponse struct { // NodeTypesClientListByManagedClustersResponse contains the response from method NodeTypesClient.NewListByManagedClustersPager. type NodeTypesClientListByManagedClustersResponse struct { - // Node type list results + // The response of a NodeType list operation. NodeTypeListResult } +// NodeTypesClientListFaultSimulationResponse contains the response from method NodeTypesClient.NewListFaultSimulationPager. +type NodeTypesClientListFaultSimulationResponse struct { + // Fault simulation list results + FaultSimulationListResult +} + +// NodeTypesClientRedeployResponse contains the response from method NodeTypesClient.BeginRedeploy. +type NodeTypesClientRedeployResponse struct { + // placeholder for future response values +} + // NodeTypesClientReimageResponse contains the response from method NodeTypesClient.BeginReimage. type NodeTypesClientReimageResponse struct { // placeholder for future response values @@ -242,16 +282,32 @@ type NodeTypesClientRestartResponse struct { // placeholder for future response values } +// NodeTypesClientStartFaultSimulationResponse contains the response from method NodeTypesClient.BeginStartFaultSimulation. +type NodeTypesClientStartFaultSimulationResponse struct { + // Fault simulation object with status. + FaultSimulation +} + +// NodeTypesClientStartResponse contains the response from method NodeTypesClient.BeginStart. +type NodeTypesClientStartResponse struct { + // placeholder for future response values +} + +// NodeTypesClientStopFaultSimulationResponse contains the response from method NodeTypesClient.BeginStopFaultSimulation. +type NodeTypesClientStopFaultSimulationResponse struct { + // Fault simulation object with status. + FaultSimulation +} + // NodeTypesClientUpdateResponse contains the response from method NodeTypesClient.BeginUpdate. type NodeTypesClientUpdateResponse struct { // Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. NodeType } -// OperationResultsClientGetResponse contains the response from method OperationResultsClient.Get. +// OperationResultsClientGetResponse contains the response from method OperationResultsClient.BeginGet. type OperationResultsClientGetResponse struct { - // Location contains the information returned from the Location header response. - Location *string + // placeholder for future response values } // OperationStatusClientGetResponse contains the response from method OperationStatusClient.Get. diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/services_client.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/services_client.go index f0a08811ed9a..3be618d8614b 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/services_client.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/services_client.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -28,7 +24,7 @@ type ServicesClient struct { } // NewServicesClient creates a new instance of ServicesClient with the specified values. -// - subscriptionID - The customer subscription identifier. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error) { @@ -46,8 +42,8 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a Service Fabric managed service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. @@ -61,8 +57,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -75,7 +70,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a Service Fabric managed service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginCreateOrUpdate" @@ -98,8 +93,8 @@ func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupN } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName}" +func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource, _ *ServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -125,9 +120,10 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -137,8 +133,8 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a Service Fabric managed service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. @@ -150,8 +146,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -164,7 +159,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a Service Fabric managed service resource with the specified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview +// Generated from API version 2025-03-01-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginDelete" @@ -179,7 +174,7 @@ func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroup if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -187,8 +182,8 @@ func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName}" +func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, _ *ServicesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -214,7 +209,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,8 +219,8 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. @@ -253,8 +248,8 @@ func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, options *ServicesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName}" +func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, _ *ServicesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -280,7 +275,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,8 +293,8 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListByApplicationsPager - Gets all service resources created or in the process of being created in the Service Fabric // managed application resource. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - options - ServicesClientListByApplicationsOptions contains the optional parameters for the ServicesClient.NewListByApplicationsPager @@ -328,8 +323,8 @@ func (client *ServicesClient) NewListByApplicationsPager(resourceGroupName strin } // listByApplicationsCreateRequest creates the ListByApplications request. -func (client *ServicesClient) listByApplicationsCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ServicesClientListByApplicationsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services" +func (client *ServicesClient) listByApplicationsCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, _ *ServicesClientListByApplicationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -351,7 +346,7 @@ func (client *ServicesClient) listByApplicationsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,8 +364,8 @@ func (client *ServicesClient) listByApplicationsHandleResponse(resp *http.Respon // Update - Updates the tags of a service resource of a given managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-09-01-preview -// - resourceGroupName - The name of the resource group. +// Generated from API version 2025-03-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. // - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. @@ -399,8 +394,8 @@ func (client *ServicesClient) Update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceUpdateParameters, options *ServicesClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName}" +func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceUpdateParameters, _ *ServicesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -426,9 +421,10 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-09-01-preview") + reqQP.Set("api-version", "2025-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/services_client_example_test.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/services_client_example_test.go index d76f8689444a..14994f3cf1bd 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/services_client_example_test.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/services_client_example_test.go @@ -1,90 +1,44 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters_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/servicefabricmanagedclusters/armservicefabricmanagedclusters" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceGetOperation_example.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "resRg", "myCluster", "myApp", "myService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armservicefabricmanagedclusters.ServiceResource{ - // Name: to.Ptr("myService"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), - // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ - // DefaultMoveCost: to.Ptr(armservicefabricmanagedclusters.MoveCostMedium), - // PlacementConstraints: to.Ptr("NodeType==frontend"), - // ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ - // { - // Name: to.Ptr("metric1"), - // Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), - // }}, - // ServicePlacementPolicies: []armservicefabricmanagedclusters.ServicePlacementPolicyClassification{ - // }, - // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ - // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), - // ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), - // ServiceTypeName: to.Ptr("myServiceType"), - // InstanceCount: to.Ptr[int32](5), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServicePutOperation_example_max.json +// Generated from example definition: 2025-03-01-preview/ServicePutOperation_example_max.json func ExampleServicesClient_BeginCreateOrUpdate_putAServiceWithMaximumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myApp", "myService", armservicefabricmanagedclusters.ServiceResource{ Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ CorrelationScheme: []*armservicefabricmanagedclusters.ServiceCorrelation{ { Scheme: to.Ptr(armservicefabricmanagedclusters.ServiceCorrelationSchemeAlignedAffinity), ServiceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1"), - }}, - DefaultMoveCost: to.Ptr(armservicefabricmanagedclusters.MoveCostMedium), + }, + }, + DefaultMoveCost: to.Ptr(armservicefabricmanagedclusters.MoveCostMedium), + InstanceCount: to.Ptr[int32](5), + MinInstanceCount: to.Ptr[int32](3), + MinInstancePercentage: to.Ptr[int32](30), + PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ + PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + }, PlacementConstraints: to.Ptr("NodeType==frontend"), ScalingPolicies: []*armservicefabricmanagedclusters.ScalingPolicy{ { @@ -101,27 +55,27 @@ func ExampleServicesClient_BeginCreateOrUpdate_putAServiceWithMaximumParameters( ScaleInterval: to.Ptr("00:01:00"), UpperLoadThreshold: to.Ptr[float64](8), }, - }}, + }, + }, + ServiceDNSName: to.Ptr("myservicednsname.myApp"), + ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ { Name: to.Ptr("metric1"), DefaultLoad: to.Ptr[int32](3), Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), - }}, + }, + }, + ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), ServicePlacementPolicies: []armservicefabricmanagedclusters.ServicePlacementPolicyClassification{ &armservicefabricmanagedclusters.ServicePlacementNonPartiallyPlaceServicePolicy{ Type: to.Ptr(armservicefabricmanagedclusters.ServicePlacementPolicyTypeNonPartiallyPlaceService), - }}, - PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ - PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + }, }, - ServiceDNSName: to.Ptr("myservicednsname.myApp"), - ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), - ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), - ServiceTypeName: to.Ptr("myServiceType"), - InstanceCount: to.Ptr[int32](5), - MinInstanceCount: to.Ptr[int32](3), - MinInstancePercentage: to.Ptr[int32](30), + ServiceTypeName: to.Ptr("myServiceType"), + }, + Tags: map[string]*string{ + "a": to.Ptr("b"), }, }, nil) if err != nil { @@ -134,82 +88,88 @@ func ExampleServicesClient_BeginCreateOrUpdate_putAServiceWithMaximumParameters( // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armservicefabricmanagedclusters.ServiceResource{ - // Name: to.Ptr("myService"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ - // CorrelationScheme: []*armservicefabricmanagedclusters.ServiceCorrelation{ - // { - // Scheme: to.Ptr(armservicefabricmanagedclusters.ServiceCorrelationSchemeAlignedAffinity), - // ServiceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1"), - // }}, - // DefaultMoveCost: to.Ptr(armservicefabricmanagedclusters.MoveCostMedium), - // PlacementConstraints: to.Ptr("NodeType==frontend"), - // ScalingPolicies: []*armservicefabricmanagedclusters.ScalingPolicy{ - // { - // ScalingMechanism: &armservicefabricmanagedclusters.PartitionInstanceCountScaleMechanism{ - // Kind: to.Ptr(armservicefabricmanagedclusters.ServiceScalingMechanismKindScalePartitionInstanceCount), - // MaxInstanceCount: to.Ptr[int32](9), - // MinInstanceCount: to.Ptr[int32](3), - // ScaleIncrement: to.Ptr[int32](2), + // res = armservicefabricmanagedclusters.ServicesClientCreateOrUpdateResponse{ + // ServiceResource: &armservicefabricmanagedclusters.ServiceResource{ + // Name: to.Ptr("myService"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), + // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ + // CorrelationScheme: []*armservicefabricmanagedclusters.ServiceCorrelation{ + // { + // Scheme: to.Ptr(armservicefabricmanagedclusters.ServiceCorrelationSchemeAlignedAffinity), + // ServiceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1"), + // }, + // }, + // DefaultMoveCost: to.Ptr(armservicefabricmanagedclusters.MoveCostMedium), + // InstanceCount: to.Ptr[int32](5), + // MinInstanceCount: to.Ptr[int32](3), + // MinInstancePercentage: to.Ptr[int32](30), + // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ + // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + // }, + // PlacementConstraints: to.Ptr("NodeType==frontend"), + // ProvisioningState: to.Ptr("Creating"), + // ScalingPolicies: []*armservicefabricmanagedclusters.ScalingPolicy{ + // { + // ScalingMechanism: &armservicefabricmanagedclusters.PartitionInstanceCountScaleMechanism{ + // Kind: to.Ptr(armservicefabricmanagedclusters.ServiceScalingMechanismKindScalePartitionInstanceCount), + // MaxInstanceCount: to.Ptr[int32](9), + // MinInstanceCount: to.Ptr[int32](3), + // ScaleIncrement: to.Ptr[int32](2), + // }, + // ScalingTrigger: &armservicefabricmanagedclusters.AveragePartitionLoadScalingTrigger{ + // Kind: to.Ptr(armservicefabricmanagedclusters.ServiceScalingTriggerKindAveragePartitionLoadTrigger), + // LowerLoadThreshold: to.Ptr[float64](2), + // MetricName: to.Ptr("metricName"), + // ScaleInterval: to.Ptr("00:01:00"), + // UpperLoadThreshold: to.Ptr[float64](8), + // }, // }, - // ScalingTrigger: &armservicefabricmanagedclusters.AveragePartitionLoadScalingTrigger{ - // Kind: to.Ptr(armservicefabricmanagedclusters.ServiceScalingTriggerKindAveragePartitionLoadTrigger), - // LowerLoadThreshold: to.Ptr[float64](2), - // MetricName: to.Ptr("metricName"), - // ScaleInterval: to.Ptr("00:01:00"), - // UpperLoadThreshold: to.Ptr[float64](8), + // }, + // ServiceDNSName: to.Ptr("myservicednsname.myApp"), + // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), + // ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ + // { + // Name: to.Ptr("metric1"), + // DefaultLoad: to.Ptr[int32](3), + // Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), // }, - // }}, - // ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ - // { - // Name: to.Ptr("metric1"), - // DefaultLoad: to.Ptr[int32](3), - // Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), - // }}, - // ServicePlacementPolicies: []armservicefabricmanagedclusters.ServicePlacementPolicyClassification{ - // &armservicefabricmanagedclusters.ServicePlacementNonPartiallyPlaceServicePolicy{ - // Type: to.Ptr(armservicefabricmanagedclusters.ServicePlacementPolicyTypeNonPartiallyPlaceService), - // }}, - // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ - // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + // }, + // ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), + // ServicePlacementPolicies: []armservicefabricmanagedclusters.ServicePlacementPolicyClassification{ + // &armservicefabricmanagedclusters.ServicePlacementNonPartiallyPlaceServicePolicy{ + // Type: to.Ptr(armservicefabricmanagedclusters.ServicePlacementPolicyTypeNonPartiallyPlaceService), + // }, + // }, + // ServiceTypeName: to.Ptr("myServiceType"), + // }, + // Tags: map[string]*string{ + // "a": to.Ptr("b"), // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceDNSName: to.Ptr("myservicednsname.myApp"), - // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), - // ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), - // ServiceTypeName: to.Ptr("myServiceType"), - // InstanceCount: to.Ptr[int32](5), - // MinInstanceCount: to.Ptr[int32](3), - // MinInstancePercentage: to.Ptr[int32](30), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServicePutOperation_example_min.json +// Generated from example definition: 2025-03-01-preview/ServicePutOperation_example_min.json func ExampleServicesClient_BeginCreateOrUpdate_putAServiceWithMinimumParameters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myApp", "myService", armservicefabricmanagedclusters.ServiceResource{ Location: to.Ptr("eastus"), Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ + InstanceCount: to.Ptr[int32](1), PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), }, ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), ServiceTypeName: to.Ptr("myServiceType"), - InstanceCount: to.Ptr[int32](1), }, }, nil) if err != nil { @@ -222,128 +182,100 @@ func ExampleServicesClient_BeginCreateOrUpdate_putAServiceWithMinimumParameters( // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armservicefabricmanagedclusters.ServiceResource{ - // Name: to.Ptr("myService"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), - // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ - // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ - // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + // res = armservicefabricmanagedclusters.ServicesClientCreateOrUpdateResponse{ + // ServiceResource: &armservicefabricmanagedclusters.ServiceResource{ + // Name: to.Ptr("myService"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), + // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ + // InstanceCount: to.Ptr[int32](1), + // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ + // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + // }, + // ProvisioningState: to.Ptr("Creating"), + // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), + // ServiceTypeName: to.Ptr("myServiceType"), // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), - // ServiceTypeName: to.Ptr("myServiceType"), - // InstanceCount: to.Ptr[int32](1), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServicePatchOperation_example.json -func ExampleServicesClient_Update() { +// Generated from example definition: 2025-03-01-preview/ServiceDeleteOperation_example.json +func ExampleServicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewServicesClient().Update(ctx, "resRg", "myCluster", "myApp", "myService", armservicefabricmanagedclusters.ServiceUpdateParameters{ - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - }, nil) + poller, err := clientFactory.NewServicesClient().BeginDelete(ctx, "resRg", "myCluster", "myApp", "myService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armservicefabricmanagedclusters.ServiceResource{ - // Name: to.Ptr("myService"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ - // CorrelationScheme: []*armservicefabricmanagedclusters.ServiceCorrelation{ - // { - // Scheme: to.Ptr(armservicefabricmanagedclusters.ServiceCorrelationSchemeAlignedAffinity), - // ServiceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1"), - // }}, - // DefaultMoveCost: to.Ptr(armservicefabricmanagedclusters.MoveCostMedium), - // PlacementConstraints: to.Ptr("NodeType==frontend"), - // ScalingPolicies: []*armservicefabricmanagedclusters.ScalingPolicy{ - // { - // ScalingMechanism: &armservicefabricmanagedclusters.PartitionInstanceCountScaleMechanism{ - // Kind: to.Ptr(armservicefabricmanagedclusters.ServiceScalingMechanismKindScalePartitionInstanceCount), - // MaxInstanceCount: to.Ptr[int32](9), - // MinInstanceCount: to.Ptr[int32](3), - // ScaleIncrement: to.Ptr[int32](2), - // }, - // ScalingTrigger: &armservicefabricmanagedclusters.AveragePartitionLoadScalingTrigger{ - // Kind: to.Ptr(armservicefabricmanagedclusters.ServiceScalingTriggerKindAveragePartitionLoadTrigger), - // LowerLoadThreshold: to.Ptr[float64](2), - // MetricName: to.Ptr("metricName"), - // ScaleInterval: to.Ptr("00:01:00"), - // UpperLoadThreshold: to.Ptr[float64](8), - // }, - // }}, - // ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ - // { - // Name: to.Ptr("metric1"), - // DefaultLoad: to.Ptr[int32](3), - // Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), - // }}, - // ServicePlacementPolicies: []armservicefabricmanagedclusters.ServicePlacementPolicyClassification{ - // &armservicefabricmanagedclusters.ServicePlacementNonPartiallyPlaceServicePolicy{ - // Type: to.Ptr(armservicefabricmanagedclusters.ServicePlacementPolicyTypeNonPartiallyPlaceService), - // }}, - // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ - // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), - // ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), - // ServiceTypeName: to.Ptr("myServiceType"), - // InstanceCount: to.Ptr[int32](5), - // MinInstanceCount: to.Ptr[int32](3), - // MinInstancePercentage: to.Ptr[int32](30), - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceDeleteOperation_example.json -func ExampleServicesClient_BeginDelete() { +// Generated from example definition: 2025-03-01-preview/ServiceGetOperation_example.json +func ExampleServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewServicesClient().BeginDelete(ctx, "resRg", "myCluster", "myApp", "myService", nil) + res, err := clientFactory.NewServicesClient().Get(ctx, "resRg", "myCluster", "myApp", "myService", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ServicesClientGetResponse{ + // ServiceResource: &armservicefabricmanagedclusters.ServiceResource{ + // Name: to.Ptr("myService"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), + // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ + // DefaultMoveCost: to.Ptr(armservicefabricmanagedclusters.MoveCostMedium), + // InstanceCount: to.Ptr[int32](5), + // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ + // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + // }, + // PlacementConstraints: to.Ptr("NodeType==frontend"), + // ProvisioningState: to.Ptr("Updating"), + // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), + // ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ + // { + // Name: to.Ptr("metric1"), + // Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), + // }, + // }, + // ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), + // ServicePlacementPolicies: []armservicefabricmanagedclusters.ServicePlacementPolicyClassification{ + // }, + // ServiceTypeName: to.Ptr("myServiceType"), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceListOperation_example.json +// Generated from example definition: 2025-03-01-preview/ServiceListOperation_example.json func ExampleServicesClient_NewListByApplicationsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("", cred, nil) + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -358,28 +290,116 @@ func ExampleServicesClient_NewListByApplicationsPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceResourceList = armservicefabricmanagedclusters.ServiceResourceList{ - // Value: []*armservicefabricmanagedclusters.ServiceResource{ - // { - // Name: to.Ptr("myService"), - // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), - // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ - // ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ - // { - // Name: to.Ptr("metric1"), - // Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), - // }}, - // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ - // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + // page = armservicefabricmanagedclusters.ServicesClientListByApplicationsResponse{ + // ServiceResourceList: armservicefabricmanagedclusters.ServiceResourceList{ + // NextLink: to.Ptr("http://examplelink.com"), + // Value: []*armservicefabricmanagedclusters.ServiceResource{ + // { + // Name: to.Ptr("myService"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), + // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ + // InstanceCount: to.Ptr[int32](1), + // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ + // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + // }, + // ProvisioningState: to.Ptr("Updating"), + // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), + // ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ + // { + // Name: to.Ptr("metric1"), + // Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), + // }, + // }, + // ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), + // ServiceTypeName: to.Ptr("myServiceType"), // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), - // ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), - // ServiceTypeName: to.Ptr("myServiceType"), - // InstanceCount: to.Ptr[int32](1), // }, - // }}, + // }, + // }, // } } } + +// Generated from example definition: 2025-03-01-preview/ServicePatchOperation_example.json +func ExampleServicesClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armservicefabricmanagedclusters.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServicesClient().Update(ctx, "resRg", "myCluster", "myApp", "myService", armservicefabricmanagedclusters.ServiceUpdateParameters{ + Tags: map[string]*string{ + "a": to.Ptr("b"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armservicefabricmanagedclusters.ServicesClientUpdateResponse{ + // ServiceResource: &armservicefabricmanagedclusters.ServiceResource{ + // Name: to.Ptr("myService"), + // Type: to.Ptr("Microsoft.ServiceFabric/managedClusters/applications/services"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService"), + // Properties: &armservicefabricmanagedclusters.StatelessServiceProperties{ + // CorrelationScheme: []*armservicefabricmanagedclusters.ServiceCorrelation{ + // { + // Scheme: to.Ptr(armservicefabricmanagedclusters.ServiceCorrelationSchemeAlignedAffinity), + // ServiceName: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1"), + // }, + // }, + // DefaultMoveCost: to.Ptr(armservicefabricmanagedclusters.MoveCostMedium), + // InstanceCount: to.Ptr[int32](5), + // MinInstanceCount: to.Ptr[int32](3), + // MinInstancePercentage: to.Ptr[int32](30), + // PartitionDescription: &armservicefabricmanagedclusters.SingletonPartitionScheme{ + // PartitionScheme: to.Ptr(armservicefabricmanagedclusters.PartitionSchemeSingleton), + // }, + // PlacementConstraints: to.Ptr("NodeType==frontend"), + // ProvisioningState: to.Ptr("Succeeded"), + // ScalingPolicies: []*armservicefabricmanagedclusters.ScalingPolicy{ + // { + // ScalingMechanism: &armservicefabricmanagedclusters.PartitionInstanceCountScaleMechanism{ + // Kind: to.Ptr(armservicefabricmanagedclusters.ServiceScalingMechanismKindScalePartitionInstanceCount), + // MaxInstanceCount: to.Ptr[int32](9), + // MinInstanceCount: to.Ptr[int32](3), + // ScaleIncrement: to.Ptr[int32](2), + // }, + // ScalingTrigger: &armservicefabricmanagedclusters.AveragePartitionLoadScalingTrigger{ + // Kind: to.Ptr(armservicefabricmanagedclusters.ServiceScalingTriggerKindAveragePartitionLoadTrigger), + // LowerLoadThreshold: to.Ptr[float64](2), + // MetricName: to.Ptr("metricName"), + // ScaleInterval: to.Ptr("00:01:00"), + // UpperLoadThreshold: to.Ptr[float64](8), + // }, + // }, + // }, + // ServiceKind: to.Ptr(armservicefabricmanagedclusters.ServiceKindStateless), + // ServiceLoadMetrics: []*armservicefabricmanagedclusters.ServiceLoadMetric{ + // { + // Name: to.Ptr("metric1"), + // DefaultLoad: to.Ptr[int32](3), + // Weight: to.Ptr(armservicefabricmanagedclusters.ServiceLoadMetricWeightLow), + // }, + // }, + // ServicePackageActivationMode: to.Ptr(armservicefabricmanagedclusters.ServicePackageActivationModeSharedProcess), + // ServicePlacementPolicies: []armservicefabricmanagedclusters.ServicePlacementPolicyClassification{ + // &armservicefabricmanagedclusters.ServicePlacementNonPartiallyPlaceServicePolicy{ + // Type: to.Ptr(armservicefabricmanagedclusters.ServicePlacementPolicyTypeNonPartiallyPlaceService), + // }, + // }, + // ServiceTypeName: to.Ptr("myServiceType"), + // }, + // Tags: map[string]*string{ + // "a": to.Ptr("b"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/time_rfc3339.go b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/time_rfc3339.go index 3732877c33f1..1cea8d3b7019 100644 --- a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/time_rfc3339.go +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/time_rfc3339.go @@ -1,10 +1,6 @@ -//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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armservicefabricmanagedclusters @@ -60,6 +56,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/tsp-location.yaml b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/tsp-location.yaml new file mode 100644 index 000000000000..062afa71325d --- /dev/null +++ b/sdk/resourcemanager/servicefabricmanagedclusters/armservicefabricmanagedclusters/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management +commit: b9a8c9e8eb8998a222f126a005d1ab633f1daad9 +repo: Azure/azure-rest-api-specs +additionalDirectories: