diff --git a/resourcecontrollerv2/resource_controller_v2.go b/resourcecontrollerv2/resource_controller_v2.go index 94d490e9..d5242564 100644 --- a/resourcecontrollerv2/resource_controller_v2.go +++ b/resourcecontrollerv2/resource_controller_v2.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021, 2022. + * (C) Copyright IBM Corp. 2023. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-f381b8c9-20221101-115055 + * IBM OpenAPI SDK Code Generator Version: 3.72.1-43bf8bf6-20230525-193151 */ // Package resourcecontrollerv2 : Operations and models for the ResourceControllerV2 service @@ -1962,6 +1962,9 @@ func (resourceController *ResourceControllerV2) ListReclamationsWithContext(ctx if listReclamationsOptions.ResourceInstanceID != nil { builder.AddQuery("resource_instance_id", fmt.Sprint(*listReclamationsOptions.ResourceInstanceID)) } + if listReclamationsOptions.ResourceGroupID != nil { + builder.AddQuery("resource_group_id", fmt.Sprint(*listReclamationsOptions.ResourceGroupID)) + } request, err := builder.Build() if err != nil { @@ -2749,6 +2752,9 @@ type ListReclamationsOptions struct { // The GUID of the resource instance. ResourceInstanceID *string `json:"resource_instance_id,omitempty"` + // The ID of the resource group. + ResourceGroupID *string `json:"resource_group_id,omitempty"` + // Allows users to set headers on API requests Headers map[string]string } @@ -2770,6 +2776,12 @@ func (_options *ListReclamationsOptions) SetResourceInstanceID(resourceInstanceI return _options } +// SetResourceGroupID : Allow user to set ResourceGroupID +func (_options *ListReclamationsOptions) SetResourceGroupID(resourceGroupID string) *ListReclamationsOptions { + _options.ResourceGroupID = core.StringPtr(resourceGroupID) + return _options +} + // SetHeaders : Allow user to set Headers func (options *ListReclamationsOptions) SetHeaders(param map[string]string) *ListReclamationsOptions { options.Headers = param @@ -5109,9 +5121,7 @@ func (options *UpdateResourceKeyOptions) SetHeaders(param map[string]string) *Up return options } -// // ResourceInstancesPager can be used to simplify the use of the "ListResourceInstances" method. -// type ResourceInstancesPager struct { hasNext bool options *ListResourceInstancesOptions @@ -5196,9 +5206,7 @@ func (pager *ResourceInstancesPager) GetAll() (allItems []ResourceInstance, err return pager.GetAllWithContext(context.Background()) } -// // ResourceAliasesForInstancePager can be used to simplify the use of the "ListResourceAliasesForInstance" method. -// type ResourceAliasesForInstancePager struct { hasNext bool options *ListResourceAliasesForInstanceOptions @@ -5283,9 +5291,7 @@ func (pager *ResourceAliasesForInstancePager) GetAll() (allItems []ResourceAlias return pager.GetAllWithContext(context.Background()) } -// // ResourceKeysForInstancePager can be used to simplify the use of the "ListResourceKeysForInstance" method. -// type ResourceKeysForInstancePager struct { hasNext bool options *ListResourceKeysForInstanceOptions @@ -5370,9 +5376,7 @@ func (pager *ResourceKeysForInstancePager) GetAll() (allItems []ResourceKey, err return pager.GetAllWithContext(context.Background()) } -// // ResourceKeysPager can be used to simplify the use of the "ListResourceKeys" method. -// type ResourceKeysPager struct { hasNext bool options *ListResourceKeysOptions @@ -5457,9 +5461,7 @@ func (pager *ResourceKeysPager) GetAll() (allItems []ResourceKey, err error) { return pager.GetAllWithContext(context.Background()) } -// // ResourceBindingsPager can be used to simplify the use of the "ListResourceBindings" method. -// type ResourceBindingsPager struct { hasNext bool options *ListResourceBindingsOptions @@ -5544,9 +5546,7 @@ func (pager *ResourceBindingsPager) GetAll() (allItems []ResourceBinding, err er return pager.GetAllWithContext(context.Background()) } -// // ResourceAliasesPager can be used to simplify the use of the "ListResourceAliases" method. -// type ResourceAliasesPager struct { hasNext bool options *ListResourceAliasesOptions @@ -5631,9 +5631,7 @@ func (pager *ResourceAliasesPager) GetAll() (allItems []ResourceAlias, err error return pager.GetAllWithContext(context.Background()) } -// // ResourceBindingsForAliasPager can be used to simplify the use of the "ListResourceBindingsForAlias" method. -// type ResourceBindingsForAliasPager struct { hasNext bool options *ListResourceBindingsForAliasOptions diff --git a/resourcecontrollerv2/resource_controller_v2_examples_test.go b/resourcecontrollerv2/resource_controller_v2_examples_test.go index dfffae6e..789d0f78 100644 --- a/resourcecontrollerv2/resource_controller_v2_examples_test.go +++ b/resourcecontrollerv2/resource_controller_v2_examples_test.go @@ -78,6 +78,7 @@ var _ = Describe(`ResourceControllerV2 Examples Tests`, func() { keyName string = "RcSdkKey1Go" keyUpdateName string = "RcSdkKeyUpdate1Go" targetRegion string = "global" + resourceGroupID string = "testResourceGroupID" ) var shouldSkipTest = func() { @@ -725,7 +726,7 @@ var _ = Describe(`ResourceControllerV2 Examples Tests`, func() { // begin-list_reclamations listReclamationsOptions := resourceControllerService.NewListReclamationsOptions() - listReclamationsOptions = listReclamationsOptions.SetAccountID(accountID) + listReclamationsOptions = listReclamationsOptions.SetResourceGroupID(resourceGroupID) reclamationsList, response, err := resourceControllerService.ListReclamations(listReclamationsOptions) if err != nil { panic(err) diff --git a/resourcecontrollerv2/resource_controller_v2_test.go b/resourcecontrollerv2/resource_controller_v2_test.go index c61e0755..3079448c 100644 --- a/resourcecontrollerv2/resource_controller_v2_test.go +++ b/resourcecontrollerv2/resource_controller_v2_test.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,14 +66,13 @@ var _ = Describe(`ResourceControllerV2`, func() { Context(`Using external config, construct service client instances`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "RESOURCE_CONTROLLER_URL": "https://resourcecontrollerv2/api", + "RESOURCE_CONTROLLER_URL": "https://resourcecontrollerv2/api", "RESOURCE_CONTROLLER_AUTH_TYPE": "noauth", } It(`Create service client using external config successfully`, func() { SetTestEnvironment(testEnvironment) - resourceControllerService, serviceErr := resourcecontrollerv2.NewResourceControllerV2UsingExternalConfig(&resourcecontrollerv2.ResourceControllerV2Options{ - }) + resourceControllerService, serviceErr := resourcecontrollerv2.NewResourceControllerV2UsingExternalConfig(&resourcecontrollerv2.ResourceControllerV2Options{}) Expect(resourceControllerService).ToNot(BeNil()) Expect(serviceErr).To(BeNil()) ClearTestEnvironment(testEnvironment) @@ -102,8 +101,7 @@ var _ = Describe(`ResourceControllerV2`, func() { }) It(`Create service client using external config and set url programatically successfully`, func() { SetTestEnvironment(testEnvironment) - resourceControllerService, serviceErr := resourcecontrollerv2.NewResourceControllerV2UsingExternalConfig(&resourcecontrollerv2.ResourceControllerV2Options{ - }) + resourceControllerService, serviceErr := resourcecontrollerv2.NewResourceControllerV2UsingExternalConfig(&resourcecontrollerv2.ResourceControllerV2Options{}) err := resourceControllerService.SetServiceURL("https://testService/api") Expect(err).To(BeNil()) Expect(resourceControllerService).ToNot(BeNil()) @@ -121,13 +119,12 @@ var _ = Describe(`ResourceControllerV2`, func() { Context(`Using external config, construct service client instances with error: Invalid Auth`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "RESOURCE_CONTROLLER_URL": "https://resourcecontrollerv2/api", + "RESOURCE_CONTROLLER_URL": "https://resourcecontrollerv2/api", "RESOURCE_CONTROLLER_AUTH_TYPE": "someOtherAuth", } SetTestEnvironment(testEnvironment) - resourceControllerService, serviceErr := resourcecontrollerv2.NewResourceControllerV2UsingExternalConfig(&resourcecontrollerv2.ResourceControllerV2Options{ - }) + resourceControllerService, serviceErr := resourcecontrollerv2.NewResourceControllerV2UsingExternalConfig(&resourcecontrollerv2.ResourceControllerV2Options{}) It(`Instantiate service client with error`, func() { Expect(resourceControllerService).To(BeNil()) @@ -138,7 +135,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Context(`Using external config, construct service client instances with error: Invalid URL`, func() { // Map containing environment variables used in testing. var testEnvironment = map[string]string{ - "RESOURCE_CONTROLLER_AUTH_TYPE": "NOAuth", + "RESOURCE_CONTROLLER_AUTH_TYPE": "NOAuth", } SetTestEnvironment(testEnvironment) @@ -462,14 +459,14 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart successfully`, func() { responseObject := new(resourcecontrollerv2.ResourceInstancesList) responseObject.NextURL = core.StringPtr("ibm.com?start=abc-123") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(Equal(core.StringPtr("abc-123"))) }) It(`Invoke GetNextStart without a "NextURL" property in the response`, func() { responseObject := new(resourcecontrollerv2.ResourceInstancesList) - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -477,7 +474,7 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart without any query params in the "NextURL" URL`, func() { responseObject := new(resourcecontrollerv2.ResourceInstancesList) responseObject.NextURL = core.StringPtr("ibm.com") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -515,17 +512,17 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceInstancesOptionsModel := &resourcecontrollerv2.ListResourceInstancesOptions{ - GUID: core.StringPtr("testString"), - Name: core.StringPtr("testString"), + GUID: core.StringPtr("testString"), + Name: core.StringPtr("testString"), ResourceGroupID: core.StringPtr("testString"), - ResourceID: core.StringPtr("testString"), - ResourcePlanID: core.StringPtr("testString"), - Type: core.StringPtr("testString"), - SubType: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - State: core.StringPtr("active"), - UpdatedFrom: core.StringPtr("2021-01-01"), - UpdatedTo: core.StringPtr("2021-01-01"), + ResourceID: core.StringPtr("testString"), + ResourcePlanID: core.StringPtr("testString"), + Type: core.StringPtr("testString"), + SubType: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + State: core.StringPtr("active"), + UpdatedFrom: core.StringPtr("2021-01-01"), + UpdatedTo: core.StringPtr("2021-01-01"), } pager, err := resourceControllerService.NewResourceInstancesPager(listResourceInstancesOptionsModel) @@ -550,17 +547,17 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceInstancesOptionsModel := &resourcecontrollerv2.ListResourceInstancesOptions{ - GUID: core.StringPtr("testString"), - Name: core.StringPtr("testString"), + GUID: core.StringPtr("testString"), + Name: core.StringPtr("testString"), ResourceGroupID: core.StringPtr("testString"), - ResourceID: core.StringPtr("testString"), - ResourcePlanID: core.StringPtr("testString"), - Type: core.StringPtr("testString"), - SubType: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - State: core.StringPtr("active"), - UpdatedFrom: core.StringPtr("2021-01-01"), - UpdatedTo: core.StringPtr("2021-01-01"), + ResourceID: core.StringPtr("testString"), + ResourcePlanID: core.StringPtr("testString"), + Type: core.StringPtr("testString"), + SubType: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + State: core.StringPtr("active"), + UpdatedFrom: core.StringPtr("2021-01-01"), + UpdatedTo: core.StringPtr("2021-01-01"), } pager, err := resourceControllerService.NewResourceInstancesPager(listResourceInstancesOptionsModel) @@ -1637,14 +1634,14 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart successfully`, func() { responseObject := new(resourcecontrollerv2.ResourceAliasesList) responseObject.NextURL = core.StringPtr("ibm.com?start=abc-123") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(Equal(core.StringPtr("abc-123"))) }) It(`Invoke GetNextStart without a "NextURL" property in the response`, func() { responseObject := new(resourcecontrollerv2.ResourceAliasesList) - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -1652,7 +1649,7 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart without any query params in the "NextURL" URL`, func() { responseObject := new(resourcecontrollerv2.ResourceAliasesList) responseObject.NextURL = core.StringPtr("ibm.com") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -1690,7 +1687,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceAliasesForInstanceOptionsModel := &resourcecontrollerv2.ListResourceAliasesForInstanceOptions{ - ID: core.StringPtr("testString"), + ID: core.StringPtr("testString"), Limit: core.Int64Ptr(int64(10)), } @@ -1716,7 +1713,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceAliasesForInstanceOptionsModel := &resourcecontrollerv2.ListResourceAliasesForInstanceOptions{ - ID: core.StringPtr("testString"), + ID: core.StringPtr("testString"), Limit: core.Int64Ptr(int64(10)), } @@ -1962,14 +1959,14 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart successfully`, func() { responseObject := new(resourcecontrollerv2.ResourceKeysList) responseObject.NextURL = core.StringPtr("ibm.com?start=abc-123") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(Equal(core.StringPtr("abc-123"))) }) It(`Invoke GetNextStart without a "NextURL" property in the response`, func() { responseObject := new(resourcecontrollerv2.ResourceKeysList) - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -1977,7 +1974,7 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart without any query params in the "NextURL" URL`, func() { responseObject := new(resourcecontrollerv2.ResourceKeysList) responseObject.NextURL = core.StringPtr("ibm.com") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -2015,7 +2012,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceKeysForInstanceOptionsModel := &resourcecontrollerv2.ListResourceKeysForInstanceOptions{ - ID: core.StringPtr("testString"), + ID: core.StringPtr("testString"), Limit: core.Int64Ptr(int64(10)), } @@ -2041,7 +2038,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceKeysForInstanceOptionsModel := &resourcecontrollerv2.ListResourceKeysForInstanceOptions{ - ID: core.StringPtr("testString"), + ID: core.StringPtr("testString"), Limit: core.Int64Ptr(int64(10)), } @@ -2959,14 +2956,14 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart successfully`, func() { responseObject := new(resourcecontrollerv2.ResourceKeysList) responseObject.NextURL = core.StringPtr("ibm.com?start=abc-123") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(Equal(core.StringPtr("abc-123"))) }) It(`Invoke GetNextStart without a "NextURL" property in the response`, func() { responseObject := new(resourcecontrollerv2.ResourceKeysList) - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -2974,7 +2971,7 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart without any query params in the "NextURL" URL`, func() { responseObject := new(resourcecontrollerv2.ResourceKeysList) responseObject.NextURL = core.StringPtr("ibm.com") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -3012,13 +3009,13 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceKeysOptionsModel := &resourcecontrollerv2.ListResourceKeysOptions{ - GUID: core.StringPtr("testString"), - Name: core.StringPtr("testString"), + GUID: core.StringPtr("testString"), + Name: core.StringPtr("testString"), ResourceGroupID: core.StringPtr("testString"), - ResourceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - UpdatedFrom: core.StringPtr("2021-01-01"), - UpdatedTo: core.StringPtr("2021-01-01"), + ResourceID: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + UpdatedFrom: core.StringPtr("2021-01-01"), + UpdatedTo: core.StringPtr("2021-01-01"), } pager, err := resourceControllerService.NewResourceKeysPager(listResourceKeysOptionsModel) @@ -3043,13 +3040,13 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceKeysOptionsModel := &resourcecontrollerv2.ListResourceKeysOptions{ - GUID: core.StringPtr("testString"), - Name: core.StringPtr("testString"), + GUID: core.StringPtr("testString"), + Name: core.StringPtr("testString"), ResourceGroupID: core.StringPtr("testString"), - ResourceID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - UpdatedFrom: core.StringPtr("2021-01-01"), - UpdatedTo: core.StringPtr("2021-01-01"), + ResourceID: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + UpdatedFrom: core.StringPtr("2021-01-01"), + UpdatedTo: core.StringPtr("2021-01-01"), } pager, err := resourceControllerService.NewResourceKeysPager(listResourceKeysOptionsModel) @@ -4151,14 +4148,14 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart successfully`, func() { responseObject := new(resourcecontrollerv2.ResourceBindingsList) responseObject.NextURL = core.StringPtr("ibm.com?start=abc-123") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(Equal(core.StringPtr("abc-123"))) }) It(`Invoke GetNextStart without a "NextURL" property in the response`, func() { responseObject := new(resourcecontrollerv2.ResourceBindingsList) - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -4166,7 +4163,7 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart without any query params in the "NextURL" URL`, func() { responseObject := new(resourcecontrollerv2.ResourceBindingsList) responseObject.NextURL = core.StringPtr("ibm.com") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -4204,14 +4201,14 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceBindingsOptionsModel := &resourcecontrollerv2.ListResourceBindingsOptions{ - GUID: core.StringPtr("testString"), - Name: core.StringPtr("testString"), + GUID: core.StringPtr("testString"), + Name: core.StringPtr("testString"), ResourceGroupID: core.StringPtr("testString"), - ResourceID: core.StringPtr("testString"), + ResourceID: core.StringPtr("testString"), RegionBindingID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - UpdatedFrom: core.StringPtr("2021-01-01"), - UpdatedTo: core.StringPtr("2021-01-01"), + Limit: core.Int64Ptr(int64(10)), + UpdatedFrom: core.StringPtr("2021-01-01"), + UpdatedTo: core.StringPtr("2021-01-01"), } pager, err := resourceControllerService.NewResourceBindingsPager(listResourceBindingsOptionsModel) @@ -4236,14 +4233,14 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceBindingsOptionsModel := &resourcecontrollerv2.ListResourceBindingsOptions{ - GUID: core.StringPtr("testString"), - Name: core.StringPtr("testString"), + GUID: core.StringPtr("testString"), + Name: core.StringPtr("testString"), ResourceGroupID: core.StringPtr("testString"), - ResourceID: core.StringPtr("testString"), + ResourceID: core.StringPtr("testString"), RegionBindingID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - UpdatedFrom: core.StringPtr("2021-01-01"), - UpdatedTo: core.StringPtr("2021-01-01"), + Limit: core.Int64Ptr(int64(10)), + UpdatedFrom: core.StringPtr("2021-01-01"), + UpdatedTo: core.StringPtr("2021-01-01"), } pager, err := resourceControllerService.NewResourceBindingsPager(listResourceBindingsOptionsModel) @@ -5358,14 +5355,14 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart successfully`, func() { responseObject := new(resourcecontrollerv2.ResourceAliasesList) responseObject.NextURL = core.StringPtr("ibm.com?start=abc-123") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(Equal(core.StringPtr("abc-123"))) }) It(`Invoke GetNextStart without a "NextURL" property in the response`, func() { responseObject := new(resourcecontrollerv2.ResourceAliasesList) - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -5373,7 +5370,7 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart without any query params in the "NextURL" URL`, func() { responseObject := new(resourcecontrollerv2.ResourceAliasesList) responseObject.NextURL = core.StringPtr("ibm.com") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -5411,15 +5408,15 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceAliasesOptionsModel := &resourcecontrollerv2.ListResourceAliasesOptions{ - GUID: core.StringPtr("testString"), - Name: core.StringPtr("testString"), + GUID: core.StringPtr("testString"), + Name: core.StringPtr("testString"), ResourceInstanceID: core.StringPtr("testString"), - RegionInstanceID: core.StringPtr("testString"), - ResourceID: core.StringPtr("testString"), - ResourceGroupID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - UpdatedFrom: core.StringPtr("2021-01-01"), - UpdatedTo: core.StringPtr("2021-01-01"), + RegionInstanceID: core.StringPtr("testString"), + ResourceID: core.StringPtr("testString"), + ResourceGroupID: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + UpdatedFrom: core.StringPtr("2021-01-01"), + UpdatedTo: core.StringPtr("2021-01-01"), } pager, err := resourceControllerService.NewResourceAliasesPager(listResourceAliasesOptionsModel) @@ -5444,15 +5441,15 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceAliasesOptionsModel := &resourcecontrollerv2.ListResourceAliasesOptions{ - GUID: core.StringPtr("testString"), - Name: core.StringPtr("testString"), + GUID: core.StringPtr("testString"), + Name: core.StringPtr("testString"), ResourceInstanceID: core.StringPtr("testString"), - RegionInstanceID: core.StringPtr("testString"), - ResourceID: core.StringPtr("testString"), - ResourceGroupID: core.StringPtr("testString"), - Limit: core.Int64Ptr(int64(10)), - UpdatedFrom: core.StringPtr("2021-01-01"), - UpdatedTo: core.StringPtr("2021-01-01"), + RegionInstanceID: core.StringPtr("testString"), + ResourceID: core.StringPtr("testString"), + ResourceGroupID: core.StringPtr("testString"), + Limit: core.Int64Ptr(int64(10)), + UpdatedFrom: core.StringPtr("2021-01-01"), + UpdatedTo: core.StringPtr("2021-01-01"), } pager, err := resourceControllerService.NewResourceAliasesPager(listResourceAliasesOptionsModel) @@ -6483,14 +6480,14 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart successfully`, func() { responseObject := new(resourcecontrollerv2.ResourceBindingsList) responseObject.NextURL = core.StringPtr("ibm.com?start=abc-123") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(Equal(core.StringPtr("abc-123"))) }) It(`Invoke GetNextStart without a "NextURL" property in the response`, func() { responseObject := new(resourcecontrollerv2.ResourceBindingsList) - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -6498,7 +6495,7 @@ var _ = Describe(`ResourceControllerV2`, func() { It(`Invoke GetNextStart without any query params in the "NextURL" URL`, func() { responseObject := new(resourcecontrollerv2.ResourceBindingsList) responseObject.NextURL = core.StringPtr("ibm.com") - + value, err := responseObject.GetNextStart() Expect(err).To(BeNil()) Expect(value).To(BeNil()) @@ -6536,7 +6533,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceBindingsForAliasOptionsModel := &resourcecontrollerv2.ListResourceBindingsForAliasOptions{ - ID: core.StringPtr("testString"), + ID: core.StringPtr("testString"), Limit: core.Int64Ptr(int64(10)), } @@ -6562,7 +6559,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(resourceControllerService).ToNot(BeNil()) listResourceBindingsForAliasOptionsModel := &resourcecontrollerv2.ListResourceBindingsForAliasOptions{ - ID: core.StringPtr("testString"), + ID: core.StringPtr("testString"), Limit: core.Int64Ptr(int64(10)), } @@ -6589,6 +6586,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(req.Method).To(Equal("GET")) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["resource_instance_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["resource_group_id"]).To(Equal([]string{"testString"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) fmt.Fprint(res, `} this is not valid json {`) @@ -6606,6 +6604,7 @@ var _ = Describe(`ResourceControllerV2`, func() { listReclamationsOptionsModel := new(resourcecontrollerv2.ListReclamationsOptions) listReclamationsOptionsModel.AccountID = core.StringPtr("testString") listReclamationsOptionsModel.ResourceInstanceID = core.StringPtr("testString") + listReclamationsOptionsModel.ResourceGroupID = core.StringPtr("testString") listReclamationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Expect response parsing to fail since we are receiving a text/plain response result, response, operationErr := resourceControllerService.ListReclamations(listReclamationsOptionsModel) @@ -6638,6 +6637,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["resource_instance_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["resource_group_id"]).To(Equal([]string{"testString"})) // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) @@ -6660,6 +6660,7 @@ var _ = Describe(`ResourceControllerV2`, func() { listReclamationsOptionsModel := new(resourcecontrollerv2.ListReclamationsOptions) listReclamationsOptionsModel.AccountID = core.StringPtr("testString") listReclamationsOptionsModel.ResourceInstanceID = core.StringPtr("testString") + listReclamationsOptionsModel.ResourceGroupID = core.StringPtr("testString") listReclamationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -6698,6 +6699,7 @@ var _ = Describe(`ResourceControllerV2`, func() { Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["resource_instance_id"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["resource_group_id"]).To(Equal([]string{"testString"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) @@ -6722,6 +6724,7 @@ var _ = Describe(`ResourceControllerV2`, func() { listReclamationsOptionsModel := new(resourcecontrollerv2.ListReclamationsOptions) listReclamationsOptionsModel.AccountID = core.StringPtr("testString") listReclamationsOptionsModel.ResourceInstanceID = core.StringPtr("testString") + listReclamationsOptionsModel.ResourceGroupID = core.StringPtr("testString") listReclamationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -6743,6 +6746,7 @@ var _ = Describe(`ResourceControllerV2`, func() { listReclamationsOptionsModel := new(resourcecontrollerv2.ListReclamationsOptions) listReclamationsOptionsModel.AccountID = core.StringPtr("testString") listReclamationsOptionsModel.ResourceInstanceID = core.StringPtr("testString") + listReclamationsOptionsModel.ResourceGroupID = core.StringPtr("testString") listReclamationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := resourceControllerService.SetServiceURL("") @@ -6778,6 +6782,7 @@ var _ = Describe(`ResourceControllerV2`, func() { listReclamationsOptionsModel := new(resourcecontrollerv2.ListReclamationsOptions) listReclamationsOptionsModel.AccountID = core.StringPtr("testString") listReclamationsOptionsModel.ResourceInstanceID = core.StringPtr("testString") + listReclamationsOptionsModel.ResourceGroupID = core.StringPtr("testString") listReclamationsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -7272,10 +7277,12 @@ var _ = Describe(`ResourceControllerV2`, func() { listReclamationsOptionsModel := resourceControllerService.NewListReclamationsOptions() listReclamationsOptionsModel.SetAccountID("testString") listReclamationsOptionsModel.SetResourceInstanceID("testString") + listReclamationsOptionsModel.SetResourceGroupID("testString") listReclamationsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(listReclamationsOptionsModel).ToNot(BeNil()) Expect(listReclamationsOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(listReclamationsOptionsModel.ResourceInstanceID).To(Equal(core.StringPtr("testString"))) + Expect(listReclamationsOptionsModel.ResourceGroupID).To(Equal(core.StringPtr("testString"))) Expect(listReclamationsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewListResourceAliasesForInstanceOptions successfully`, func() {