diff --git a/globalsearchv2/global_search_v2.go b/globalsearchv2/global_search_v2.go index 7a86cd2f..7737c42b 100644 --- a/globalsearchv2/global_search_v2.go +++ b/globalsearchv2/global_search_v2.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.86.0-bc6f14b3-20240221-193958 + * IBM OpenAPI SDK Code Generator Version: 3.87.0-91c7c775-20240320-213027 */ // Package globalsearchv2 : Operations and models for the GlobalSearchV2 service @@ -37,10 +37,10 @@ import ( // GlobalSearchV2 : Search for resources with the global and shared resource properties repository that is integrated in // the IBM Cloud platform. The search repository stores and searches cloud resources attributes, which categorize or // classify resources. A resource is a physical or logical component that can be created or reserved for an application -// or service instance. They are owned by resource providers, such as Cloud Foundry, IBM Kubernetes Service, or resource -// controller in IBM Cloud. Resources are uniquely identified by a Cloud Resource Name (CRN) or by an IMS ID. The -// properties of a resource include tags and system properties. Both properties are defined in an IBM Cloud billing -// account, and span across many regions. +// or service instance. They are owned by resource providers, such as IBM Kubernetes Service, or resource controller in +// IBM Cloud. Resources are uniquely identified by a Cloud Resource Name (CRN) or by an IMS ID. The properties of a +// resource include tags and system properties. Both properties are defined in an IBM Cloud billing account, and span +// across many regions. // // API Version: 2.0.1 type GlobalSearchV2 struct { @@ -69,22 +69,26 @@ func NewGlobalSearchV2UsingExternalConfig(options *GlobalSearchV2Options) (globa if options.Authenticator == nil { options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "env-auth-error", common.GetComponentInfo()) return } } globalSearch, err = NewGlobalSearchV2(options) + err = core.RepurposeSDKProblem(err, "new-client-error") if err != nil { return } err = globalSearch.Service.ConfigureService(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "client-config-error", common.GetComponentInfo()) return } if options.URL != "" { err = globalSearch.Service.SetServiceURL(options.URL) + err = core.RepurposeSDKProblem(err, "url-set-error") } return } @@ -98,12 +102,14 @@ func NewGlobalSearchV2(options *GlobalSearchV2Options) (service *GlobalSearchV2, baseService, err := core.NewBaseService(serviceOptions) if err != nil { + err = core.SDKErrorf(err, "", "new-base-error", common.GetComponentInfo()) return } if options.URL != "" { err = baseService.SetServiceURL(options.URL) if err != nil { + err = core.SDKErrorf(err, "", "set-url-error", common.GetComponentInfo()) return } } @@ -117,7 +123,7 @@ func NewGlobalSearchV2(options *GlobalSearchV2Options) (service *GlobalSearchV2, // GetServiceURLForRegion returns the service URL to be used for the specified region func GetServiceURLForRegion(region string) (string, error) { - return "", fmt.Errorf("service does not support regional URLs") + return "", core.SDKErrorf(nil, "service does not support regional URLs", "no-regional-support", common.GetComponentInfo()) } // Clone makes a copy of "globalSearch" suitable for processing requests. @@ -132,7 +138,11 @@ func (globalSearch *GlobalSearchV2) Clone() *GlobalSearchV2 { // SetServiceURL sets the service URL func (globalSearch *GlobalSearchV2) SetServiceURL(url string) error { - return globalSearch.Service.SetServiceURL(url) + err := globalSearch.Service.SetServiceURL(url) + if err != nil { + err = core.SDKErrorf(err, "", "url-set-error", common.GetComponentInfo()) + } + return err } // GetServiceURL returns the service URL @@ -167,8 +177,8 @@ func (globalSearch *GlobalSearchV2) DisableRetries() { } // Search : Find instances of resources (v3) -// Find Cloud Foundry resources, IAM-enabled resources, or storage and network resources that run on classic -// infrastructure in a specific account ID. You can apply query strings if necessary. +// Find IAM-enabled resources or storage and network resources that run on classic infrastructure in a specific account +// ID. You can apply query strings if necessary. // // To filter results, you can insert a string by using the Lucene syntax and the query string is parsed into a series of // terms and operators. A term can be a single word or a phrase, in which case the search is performed for all the @@ -184,17 +194,21 @@ func (globalSearch *GlobalSearchV2) DisableRetries() { // `family`, `type`, and `account_id`. You can specify the subset of the fields you want in your request using the // `fields` request body attribute. Set `"fields": ["*"]` to discover the set of fields which are available to request. func (globalSearch *GlobalSearchV2) Search(searchOptions *SearchOptions) (result *ScanResult, response *core.DetailedResponse, err error) { - return globalSearch.SearchWithContext(context.Background(), searchOptions) + result, response, err = globalSearch.SearchWithContext(context.Background(), searchOptions) + err = core.RepurposeSDKProblem(err, "") + return } // SearchWithContext is an alternate form of the Search method which supports a Context parameter func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searchOptions *SearchOptions) (result *ScanResult, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(searchOptions, "searchOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(searchOptions, "searchOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -203,6 +217,7 @@ func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searc builder.EnableGzipCompression = globalSearch.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(globalSearch.Service.Options.URL, `/v3/resources/search`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -222,9 +237,6 @@ func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searc if searchOptions.XCorrelationID != nil { builder.AddHeader("x-correlation-id", fmt.Sprint(*searchOptions.XCorrelationID)) } - if searchOptions.TransactionID != nil { - builder.AddHeader("transaction-id", fmt.Sprint(*searchOptions.TransactionID)) - } if searchOptions.AccountID != nil { builder.AddQuery("account_id", fmt.Sprint(*searchOptions.AccountID)) @@ -266,22 +278,27 @@ func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searc } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = globalSearch.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "search", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalScanResult) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -289,6 +306,9 @@ func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searc return } +func getServiceComponentInfo() *core.ProblemComponent { + return core.NewProblemComponent(DefaultServiceName, "2.0.1") +} // ResultItem : A resource returned in a search result, which is identified by its `crn`. It contains other properties that depend on // the resource type. @@ -338,6 +358,9 @@ func (o *ResultItem) MarshalJSON() (buffer []byte, err error) { m["crn"] = o.CRN } buffer, err = json.Marshal(m) + if err != nil { + err = core.SDKErrorf(err, "", "model-marshal", common.GetComponentInfo()) + } return } @@ -346,6 +369,7 @@ func UnmarshalResultItem(m map[string]json.RawMessage, result interface{}) (err obj := new(ResultItem) err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } delete(m, "crn") @@ -353,7 +377,7 @@ func UnmarshalResultItem(m map[string]json.RawMessage, result interface{}) (err var v interface{} e := core.UnmarshalPrimitive(m, k, &v) if e != nil { - err = e + err = core.SDKErrorf(e, "", "additional-properties-error", common.GetComponentInfo()) return } obj.SetProperty(k, v) @@ -381,14 +405,17 @@ func UnmarshalScanResult(m map[string]json.RawMessage, result interface{}) (err obj := new(ScanResult) err = core.UnmarshalPrimitive(m, "search_cursor", &obj.SearchCursor) if err != nil { + err = core.SDKErrorf(err, "", "search_cursor-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "items", &obj.Items, UnmarshalResultItem) if err != nil { + err = core.SDKErrorf(err, "", "items-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -424,11 +451,6 @@ type SearchOptions struct { // (version 4) UUID. XCorrelationID *string `json:"x-correlation-id,omitempty"` - // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically - // generated with the prefix "gst-". - // Deprecated: this field is deprecated and may be removed in a future release. - TransactionID *string `json:"transaction-id,omitempty"` - // The account ID to filter resources. AccountID *string `json:"account_id,omitempty"` @@ -544,13 +566,6 @@ func (_options *SearchOptions) SetXCorrelationID(xCorrelationID string) *SearchO return _options } -// SetTransactionID : Allow user to set TransactionID -// Deprecated: this method is deprecated and may be removed in a future release. -func (_options *SearchOptions) SetTransactionID(transactionID string) *SearchOptions { - _options.TransactionID = core.StringPtr(transactionID) - return _options -} - // SetAccountID : Allow user to set AccountID func (_options *SearchOptions) SetAccountID(accountID string) *SearchOptions { _options.AccountID = core.StringPtr(accountID) diff --git a/globalsearchv2/global_search_v2_integration_test.go b/globalsearchv2/global_search_v2_integration_test.go index e4facf78..3cd08c91 100644 --- a/globalsearchv2/global_search_v2_integration_test.go +++ b/globalsearchv2/global_search_v2_integration_test.go @@ -26,7 +26,6 @@ import ( "github.com/IBM/go-sdk-core/v5/core" common "github.com/IBM/platform-services-go-sdk/common" "github.com/IBM/platform-services-go-sdk/globalsearchv2" - "github.com/google/uuid" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) @@ -48,8 +47,6 @@ var _ = Describe(`GlobalSearchV2 Integration Tests`, func() { globalSearchService *globalsearchv2.GlobalSearchV2 serviceURL string config map[string]string - - transactionID = uuid.New().String() gstQuery = "GST-sdk*" ) @@ -116,7 +113,6 @@ var _ = Describe(`GlobalSearchV2 Integration Tests`, func() { Query: &gstQuery, Fields: []string{"*"}, SearchCursor: searchCursor, - TransactionID: &transactionID, Limit: &limit, } diff --git a/globalsearchv2/global_search_v2_test.go b/globalsearchv2/global_search_v2_test.go index c8092ddf..f04aeb5e 100644 --- a/globalsearchv2/global_search_v2_test.go +++ b/globalsearchv2/global_search_v2_test.go @@ -177,8 +177,6 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) Expect(req.URL.Query()["timeout"]).To(Equal([]string{fmt.Sprint(int64(0))})) @@ -207,7 +205,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.XRequestID = core.StringPtr("testString") searchOptionsModel.XCorrelationID = core.StringPtr("testString") - searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") searchOptionsModel.Limit = core.Int64Ptr(int64(10)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) @@ -267,8 +264,6 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) Expect(req.URL.Query()["timeout"]).To(Equal([]string{fmt.Sprint(int64(0))})) @@ -302,7 +297,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.XRequestID = core.StringPtr("testString") searchOptionsModel.XCorrelationID = core.StringPtr("testString") - searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") searchOptionsModel.Limit = core.Int64Ptr(int64(10)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) @@ -368,8 +362,6 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(10))})) Expect(req.URL.Query()["timeout"]).To(Equal([]string{fmt.Sprint(int64(0))})) @@ -405,7 +397,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.XRequestID = core.StringPtr("testString") searchOptionsModel.XCorrelationID = core.StringPtr("testString") - searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") searchOptionsModel.Limit = core.Int64Ptr(int64(10)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) @@ -439,7 +430,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.XRequestID = core.StringPtr("testString") searchOptionsModel.XCorrelationID = core.StringPtr("testString") - searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") searchOptionsModel.Limit = core.Int64Ptr(int64(10)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) @@ -487,7 +477,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.XRequestID = core.StringPtr("testString") searchOptionsModel.XCorrelationID = core.StringPtr("testString") - searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") searchOptionsModel.Limit = core.Int64Ptr(int64(10)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) @@ -526,7 +515,6 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SetSearchCursor("testString") searchOptionsModel.SetXRequestID("testString") searchOptionsModel.SetXCorrelationID("testString") - searchOptionsModel.SetTransactionID("testString") searchOptionsModel.SetAccountID("testString") searchOptionsModel.SetLimit(int64(10)) searchOptionsModel.SetTimeout(int64(0)) @@ -543,7 +531,6 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(searchOptionsModel.SearchCursor).To(Equal(core.StringPtr("testString"))) Expect(searchOptionsModel.XRequestID).To(Equal(core.StringPtr("testString"))) Expect(searchOptionsModel.XCorrelationID).To(Equal(core.StringPtr("testString"))) - Expect(searchOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(searchOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(searchOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(10)))) Expect(searchOptionsModel.Timeout).To(Equal(core.Int64Ptr(int64(0)))) diff --git a/globaltaggingv1/global_tagging_v1.go b/globaltaggingv1/global_tagging_v1.go index 6cdbc0ba..563bfe5a 100644 --- a/globaltaggingv1/global_tagging_v1.go +++ b/globaltaggingv1/global_tagging_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.86.0-bc6f14b3-20240221-193958 + * IBM OpenAPI SDK Code Generator Version: 3.87.0-91c7c775-20240320-213027 */ // Package globaltaggingv1 : Operations and models for the GlobalTaggingV1 service @@ -68,22 +68,26 @@ func NewGlobalTaggingV1UsingExternalConfig(options *GlobalTaggingV1Options) (glo if options.Authenticator == nil { options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "env-auth-error", common.GetComponentInfo()) return } } globalTagging, err = NewGlobalTaggingV1(options) + err = core.RepurposeSDKProblem(err, "new-client-error") if err != nil { return } err = globalTagging.Service.ConfigureService(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "client-config-error", common.GetComponentInfo()) return } if options.URL != "" { err = globalTagging.Service.SetServiceURL(options.URL) + err = core.RepurposeSDKProblem(err, "url-set-error") } return } @@ -97,12 +101,14 @@ func NewGlobalTaggingV1(options *GlobalTaggingV1Options) (service *GlobalTagging baseService, err := core.NewBaseService(serviceOptions) if err != nil { + err = core.SDKErrorf(err, "", "new-base-error", common.GetComponentInfo()) return } if options.URL != "" { err = baseService.SetServiceURL(options.URL) if err != nil { + err = core.SDKErrorf(err, "", "set-url-error", common.GetComponentInfo()) return } } @@ -116,7 +122,7 @@ func NewGlobalTaggingV1(options *GlobalTaggingV1Options) (service *GlobalTagging // GetServiceURLForRegion returns the service URL to be used for the specified region func GetServiceURLForRegion(region string) (string, error) { - return "", fmt.Errorf("service does not support regional URLs") + return "", core.SDKErrorf(nil, "service does not support regional URLs", "no-regional-support", common.GetComponentInfo()) } // Clone makes a copy of "globalTagging" suitable for processing requests. @@ -131,7 +137,11 @@ func (globalTagging *GlobalTaggingV1) Clone() *GlobalTaggingV1 { // SetServiceURL sets the service URL func (globalTagging *GlobalTaggingV1) SetServiceURL(url string) error { - return globalTagging.Service.SetServiceURL(url) + err := globalTagging.Service.SetServiceURL(url) + if err != nil { + err = core.SDKErrorf(err, "", "url-set-error", common.GetComponentInfo()) + } + return err } // GetServiceURL returns the service URL @@ -169,13 +179,16 @@ func (globalTagging *GlobalTaggingV1) DisableRetries() { // Lists all tags that are in a billing account. Use the `attached_to` parameter to return the list of tags that are // attached to the specified resource. func (globalTagging *GlobalTaggingV1) ListTags(listTagsOptions *ListTagsOptions) (result *TagList, response *core.DetailedResponse, err error) { - return globalTagging.ListTagsWithContext(context.Background(), listTagsOptions) + result, response, err = globalTagging.ListTagsWithContext(context.Background(), listTagsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTagsWithContext is an alternate form of the ListTags method which supports a Context parameter func (globalTagging *GlobalTaggingV1) ListTagsWithContext(ctx context.Context, listTagsOptions *ListTagsOptions) (result *TagList, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listTagsOptions, "listTagsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -184,6 +197,7 @@ func (globalTagging *GlobalTaggingV1) ListTagsWithContext(ctx context.Context, l builder.EnableGzipCompression = globalTagging.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(globalTagging.Service.Options.URL, `/v3/tags`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -202,9 +216,6 @@ func (globalTagging *GlobalTaggingV1) ListTagsWithContext(ctx context.Context, l if listTagsOptions.XCorrelationID != nil { builder.AddHeader("x-correlation-id", fmt.Sprint(*listTagsOptions.XCorrelationID)) } - if listTagsOptions.TransactionID != nil { - builder.AddHeader("transaction-id", fmt.Sprint(*listTagsOptions.TransactionID)) - } if listTagsOptions.AccountID != nil { builder.AddQuery("account_id", fmt.Sprint(*listTagsOptions.AccountID)) @@ -239,17 +250,21 @@ func (globalTagging *GlobalTaggingV1) ListTagsWithContext(ctx context.Context, l request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = globalTagging.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_tags", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTagList) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -263,17 +278,21 @@ func (globalTagging *GlobalTaggingV1) ListTagsWithContext(ctx context.Context, l // access to tag resources](https://cloud.ibm.com/docs/account?topic=account-access) documentation. `service` and `user` // tags cannot be created upfront. They are created when they are attached for the first time to a resource. func (globalTagging *GlobalTaggingV1) CreateTag(createTagOptions *CreateTagOptions) (result *CreateTagResults, response *core.DetailedResponse, err error) { - return globalTagging.CreateTagWithContext(context.Background(), createTagOptions) + result, response, err = globalTagging.CreateTagWithContext(context.Background(), createTagOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTagWithContext is an alternate form of the CreateTag method which supports a Context parameter func (globalTagging *GlobalTaggingV1) CreateTagWithContext(ctx context.Context, createTagOptions *CreateTagOptions) (result *CreateTagResults, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTagOptions, "createTagOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTagOptions, "createTagOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -282,6 +301,7 @@ func (globalTagging *GlobalTaggingV1) CreateTagWithContext(ctx context.Context, builder.EnableGzipCompression = globalTagging.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(globalTagging.Service.Options.URL, `/v3/tags`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -301,9 +321,6 @@ func (globalTagging *GlobalTaggingV1) CreateTagWithContext(ctx context.Context, if createTagOptions.XCorrelationID != nil { builder.AddHeader("x-correlation-id", fmt.Sprint(*createTagOptions.XCorrelationID)) } - if createTagOptions.TransactionID != nil { - builder.AddHeader("transaction-id", fmt.Sprint(*createTagOptions.TransactionID)) - } if createTagOptions.AccountID != nil { builder.AddQuery("account_id", fmt.Sprint(*createTagOptions.AccountID)) @@ -318,22 +335,27 @@ func (globalTagging *GlobalTaggingV1) CreateTagWithContext(ctx context.Context, } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = globalTagging.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_tag", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalCreateTagResults) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -345,13 +367,16 @@ func (globalTagging *GlobalTaggingV1) CreateTagWithContext(ctx context.Context, // DeleteTagAll : Delete all unused tags // Delete the tags that are not attached to any resource. func (globalTagging *GlobalTaggingV1) DeleteTagAll(deleteTagAllOptions *DeleteTagAllOptions) (result *DeleteTagsResult, response *core.DetailedResponse, err error) { - return globalTagging.DeleteTagAllWithContext(context.Background(), deleteTagAllOptions) + result, response, err = globalTagging.DeleteTagAllWithContext(context.Background(), deleteTagAllOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTagAllWithContext is an alternate form of the DeleteTagAll method which supports a Context parameter func (globalTagging *GlobalTaggingV1) DeleteTagAllWithContext(ctx context.Context, deleteTagAllOptions *DeleteTagAllOptions) (result *DeleteTagsResult, response *core.DetailedResponse, err error) { err = core.ValidateStruct(deleteTagAllOptions, "deleteTagAllOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -360,6 +385,7 @@ func (globalTagging *GlobalTaggingV1) DeleteTagAllWithContext(ctx context.Contex builder.EnableGzipCompression = globalTagging.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(globalTagging.Service.Options.URL, `/v3/tags`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -378,9 +404,6 @@ func (globalTagging *GlobalTaggingV1) DeleteTagAllWithContext(ctx context.Contex if deleteTagAllOptions.XCorrelationID != nil { builder.AddHeader("x-correlation-id", fmt.Sprint(*deleteTagAllOptions.XCorrelationID)) } - if deleteTagAllOptions.TransactionID != nil { - builder.AddHeader("transaction-id", fmt.Sprint(*deleteTagAllOptions.TransactionID)) - } if deleteTagAllOptions.Providers != nil { builder.AddQuery("providers", fmt.Sprint(*deleteTagAllOptions.Providers)) @@ -394,17 +417,21 @@ func (globalTagging *GlobalTaggingV1) DeleteTagAllWithContext(ctx context.Contex request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = globalTagging.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "delete_tag_all", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDeleteTagsResult) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -416,17 +443,21 @@ func (globalTagging *GlobalTaggingV1) DeleteTagAllWithContext(ctx context.Contex // DeleteTag : Delete an unused tag // Delete an existing tag. A tag can be deleted only if it is not attached to any resource. func (globalTagging *GlobalTaggingV1) DeleteTag(deleteTagOptions *DeleteTagOptions) (result *DeleteTagResults, response *core.DetailedResponse, err error) { - return globalTagging.DeleteTagWithContext(context.Background(), deleteTagOptions) + result, response, err = globalTagging.DeleteTagWithContext(context.Background(), deleteTagOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTagWithContext is an alternate form of the DeleteTag method which supports a Context parameter func (globalTagging *GlobalTaggingV1) DeleteTagWithContext(ctx context.Context, deleteTagOptions *DeleteTagOptions) (result *DeleteTagResults, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTagOptions, "deleteTagOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTagOptions, "deleteTagOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -439,6 +470,7 @@ func (globalTagging *GlobalTaggingV1) DeleteTagWithContext(ctx context.Context, builder.EnableGzipCompression = globalTagging.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(globalTagging.Service.Options.URL, `/v3/tags/{tag_name}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -457,9 +489,6 @@ func (globalTagging *GlobalTaggingV1) DeleteTagWithContext(ctx context.Context, if deleteTagOptions.XCorrelationID != nil { builder.AddHeader("x-correlation-id", fmt.Sprint(*deleteTagOptions.XCorrelationID)) } - if deleteTagOptions.TransactionID != nil { - builder.AddHeader("transaction-id", fmt.Sprint(*deleteTagOptions.TransactionID)) - } if deleteTagOptions.Providers != nil { builder.AddQuery("providers", strings.Join(deleteTagOptions.Providers, ",")) @@ -473,17 +502,21 @@ func (globalTagging *GlobalTaggingV1) DeleteTagWithContext(ctx context.Context, request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = globalTagging.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "delete_tag", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalDeleteTagResults) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -496,17 +529,21 @@ func (globalTagging *GlobalTaggingV1) DeleteTagWithContext(ctx context.Context, // Attaches one or more tags to one or more resources. Each resource can have no more than 1000 tags per each 'user' and // 'service' type, and no more than 250 'access' tags (which is the account limit). func (globalTagging *GlobalTaggingV1) AttachTag(attachTagOptions *AttachTagOptions) (result *TagResults, response *core.DetailedResponse, err error) { - return globalTagging.AttachTagWithContext(context.Background(), attachTagOptions) + result, response, err = globalTagging.AttachTagWithContext(context.Background(), attachTagOptions) + err = core.RepurposeSDKProblem(err, "") + return } // AttachTagWithContext is an alternate form of the AttachTag method which supports a Context parameter func (globalTagging *GlobalTaggingV1) AttachTagWithContext(ctx context.Context, attachTagOptions *AttachTagOptions) (result *TagResults, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(attachTagOptions, "attachTagOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(attachTagOptions, "attachTagOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -515,6 +552,7 @@ func (globalTagging *GlobalTaggingV1) AttachTagWithContext(ctx context.Context, builder.EnableGzipCompression = globalTagging.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(globalTagging.Service.Options.URL, `/v3/tags/attach`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -534,9 +572,6 @@ func (globalTagging *GlobalTaggingV1) AttachTagWithContext(ctx context.Context, if attachTagOptions.XCorrelationID != nil { builder.AddHeader("x-correlation-id", fmt.Sprint(*attachTagOptions.XCorrelationID)) } - if attachTagOptions.TransactionID != nil { - builder.AddHeader("transaction-id", fmt.Sprint(*attachTagOptions.TransactionID)) - } if attachTagOptions.AccountID != nil { builder.AddQuery("account_id", fmt.Sprint(*attachTagOptions.AccountID)) @@ -560,22 +595,27 @@ func (globalTagging *GlobalTaggingV1) AttachTagWithContext(ctx context.Context, } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = globalTagging.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "attach_tag", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTagResults) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -587,17 +627,21 @@ func (globalTagging *GlobalTaggingV1) AttachTagWithContext(ctx context.Context, // DetachTag : Detach tags // Detaches one or more tags from one or more resources. func (globalTagging *GlobalTaggingV1) DetachTag(detachTagOptions *DetachTagOptions) (result *TagResults, response *core.DetailedResponse, err error) { - return globalTagging.DetachTagWithContext(context.Background(), detachTagOptions) + result, response, err = globalTagging.DetachTagWithContext(context.Background(), detachTagOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DetachTagWithContext is an alternate form of the DetachTag method which supports a Context parameter func (globalTagging *GlobalTaggingV1) DetachTagWithContext(ctx context.Context, detachTagOptions *DetachTagOptions) (result *TagResults, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(detachTagOptions, "detachTagOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(detachTagOptions, "detachTagOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -606,6 +650,7 @@ func (globalTagging *GlobalTaggingV1) DetachTagWithContext(ctx context.Context, builder.EnableGzipCompression = globalTagging.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(globalTagging.Service.Options.URL, `/v3/tags/detach`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } @@ -625,9 +670,6 @@ func (globalTagging *GlobalTaggingV1) DetachTagWithContext(ctx context.Context, if detachTagOptions.XCorrelationID != nil { builder.AddHeader("x-correlation-id", fmt.Sprint(*detachTagOptions.XCorrelationID)) } - if detachTagOptions.TransactionID != nil { - builder.AddHeader("transaction-id", fmt.Sprint(*detachTagOptions.TransactionID)) - } if detachTagOptions.AccountID != nil { builder.AddQuery("account_id", fmt.Sprint(*detachTagOptions.AccountID)) @@ -648,22 +690,27 @@ func (globalTagging *GlobalTaggingV1) DetachTagWithContext(ctx context.Context, } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = globalTagging.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "detach_tag", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTagResults) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -671,6 +718,9 @@ func (globalTagging *GlobalTaggingV1) DetachTagWithContext(ctx context.Context, return } +func getServiceComponentInfo() *core.ProblemComponent { + return core.NewProblemComponent(DefaultServiceName, "1.2.0") +} // AttachTagOptions : The AttachTag options. type AttachTagOptions struct { @@ -698,11 +748,6 @@ type AttachTagOptions struct { // (version 4) UUID. XCorrelationID *string `json:"x-correlation-id,omitempty"` - // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically - // generated with the prefix "gst-". - // Deprecated: this field is deprecated and may be removed in a future release. - TransactionID *string `json:"transaction-id,omitempty"` - // The ID of the billing account of the tagged resource. It is a required parameter if `tag_type` is set to `service`. // Otherwise, it is inferred from the authorization IAM token. AccountID *string `json:"account_id,omitempty"` @@ -765,13 +810,6 @@ func (_options *AttachTagOptions) SetXCorrelationID(xCorrelationID string) *Atta return _options } -// SetTransactionID : Allow user to set TransactionID -// Deprecated: this method is deprecated and may be removed in a future release. -func (_options *AttachTagOptions) SetTransactionID(transactionID string) *AttachTagOptions { - _options.TransactionID = core.StringPtr(transactionID) - return _options -} - // SetAccountID : Allow user to set AccountID func (_options *AttachTagOptions) SetAccountID(accountID string) *AttachTagOptions { _options.AccountID = core.StringPtr(accountID) @@ -816,11 +854,6 @@ type CreateTagOptions struct { // (version 4) UUID. XCorrelationID *string `json:"x-correlation-id,omitempty"` - // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically - // generated with the prefix "gst-". - // Deprecated: this field is deprecated and may be removed in a future release. - TransactionID *string `json:"transaction-id,omitempty"` - // The ID of the billing account where the tag must be created. AccountID *string `json:"account_id,omitempty"` @@ -862,13 +895,6 @@ func (_options *CreateTagOptions) SetXCorrelationID(xCorrelationID string) *Crea return _options } -// SetTransactionID : Allow user to set TransactionID -// Deprecated: this method is deprecated and may be removed in a future release. -func (_options *CreateTagOptions) SetTransactionID(transactionID string) *CreateTagOptions { - _options.TransactionID = core.StringPtr(transactionID) - return _options -} - // SetAccountID : Allow user to set AccountID func (_options *CreateTagOptions) SetAccountID(accountID string) *CreateTagOptions { _options.AccountID = core.StringPtr(accountID) @@ -898,6 +924,7 @@ func UnmarshalCreateTagResults(m map[string]json.RawMessage, result interface{}) obj := new(CreateTagResults) err = core.UnmarshalModel(m, "results", &obj.Results, UnmarshalCreateTagResultsResultsItem) if err != nil { + err = core.SDKErrorf(err, "", "results-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -918,10 +945,12 @@ func UnmarshalCreateTagResultsResultsItem(m map[string]json.RawMessage, result i obj := new(CreateTagResultsResultsItem) err = core.UnmarshalPrimitive(m, "tag_name", &obj.TagName) if err != nil { + err = core.SDKErrorf(err, "", "tag_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "is_error", &obj.IsError) if err != nil { + err = core.SDKErrorf(err, "", "is_error-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -945,11 +974,6 @@ type DeleteTagAllOptions struct { // (version 4) UUID. XCorrelationID *string `json:"x-correlation-id,omitempty"` - // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically - // generated with the prefix "gst-". - // Deprecated: this field is deprecated and may be removed in a future release. - TransactionID *string `json:"transaction-id,omitempty"` - // Select a provider. Supported values are `ghost` and `ims`. Providers *string `json:"providers,omitempty"` @@ -998,13 +1022,6 @@ func (_options *DeleteTagAllOptions) SetXCorrelationID(xCorrelationID string) *D return _options } -// SetTransactionID : Allow user to set TransactionID -// Deprecated: this method is deprecated and may be removed in a future release. -func (_options *DeleteTagAllOptions) SetTransactionID(transactionID string) *DeleteTagAllOptions { - _options.TransactionID = core.StringPtr(transactionID) - return _options -} - // SetProviders : Allow user to set Providers func (_options *DeleteTagAllOptions) SetProviders(providers string) *DeleteTagAllOptions { _options.Providers = core.StringPtr(providers) @@ -1049,11 +1066,6 @@ type DeleteTagOptions struct { // (version 4) UUID. XCorrelationID *string `json:"x-correlation-id,omitempty"` - // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically - // generated with the prefix "gst-". - // Deprecated: this field is deprecated and may be removed in a future release. - TransactionID *string `json:"transaction-id,omitempty"` - // Select a provider. Supported values are `ghost` and `ims`. To delete tags both in Global Search and Tagging and in // IMS, use `ghost,ims`. Providers []string `json:"providers,omitempty"` @@ -1110,13 +1122,6 @@ func (_options *DeleteTagOptions) SetXCorrelationID(xCorrelationID string) *Dele return _options } -// SetTransactionID : Allow user to set TransactionID -// Deprecated: this method is deprecated and may be removed in a future release. -func (_options *DeleteTagOptions) SetTransactionID(transactionID string) *DeleteTagOptions { - _options.TransactionID = core.StringPtr(transactionID) - return _options -} - // SetProviders : Allow user to set Providers func (_options *DeleteTagOptions) SetProviders(providers []string) *DeleteTagOptions { _options.Providers = providers @@ -1152,6 +1157,7 @@ func UnmarshalDeleteTagResults(m map[string]json.RawMessage, result interface{}) obj := new(DeleteTagResults) err = core.UnmarshalModel(m, "results", &obj.Results, UnmarshalDeleteTagResultsItem) if err != nil { + err = core.SDKErrorf(err, "", "results-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1218,6 +1224,9 @@ func (o *DeleteTagResultsItem) MarshalJSON() (buffer []byte, err error) { m["is_error"] = o.IsError } buffer, err = json.Marshal(m) + if err != nil { + err = core.SDKErrorf(err, "", "model-marshal", common.GetComponentInfo()) + } return } @@ -1226,11 +1235,13 @@ func UnmarshalDeleteTagResultsItem(m map[string]json.RawMessage, result interfac obj := new(DeleteTagResultsItem) err = core.UnmarshalPrimitive(m, "provider", &obj.Provider) if err != nil { + err = core.SDKErrorf(err, "", "provider-error", common.GetComponentInfo()) return } delete(m, "provider") err = core.UnmarshalPrimitive(m, "is_error", &obj.IsError) if err != nil { + err = core.SDKErrorf(err, "", "is_error-error", common.GetComponentInfo()) return } delete(m, "is_error") @@ -1238,7 +1249,7 @@ func UnmarshalDeleteTagResultsItem(m map[string]json.RawMessage, result interfac var v interface{} e := core.UnmarshalPrimitive(m, k, &v) if e != nil { - err = e + err = core.SDKErrorf(e, "", "additional-properties-error", common.GetComponentInfo()) return } obj.SetProperty(k, v) @@ -1264,14 +1275,17 @@ func UnmarshalDeleteTagsResult(m map[string]json.RawMessage, result interface{}) obj := new(DeleteTagsResult) err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "errors", &obj.Errors) if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "items", &obj.Items, UnmarshalDeleteTagsResultItem) if err != nil { + err = core.SDKErrorf(err, "", "items-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1292,10 +1306,12 @@ func UnmarshalDeleteTagsResultItem(m map[string]json.RawMessage, result interfac obj := new(DeleteTagsResultItem) err = core.UnmarshalPrimitive(m, "tag_name", &obj.TagName) if err != nil { + err = core.SDKErrorf(err, "", "tag_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "is_error", &obj.IsError) if err != nil { + err = core.SDKErrorf(err, "", "is_error-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1328,11 +1344,6 @@ type DetachTagOptions struct { // (version 4) UUID. XCorrelationID *string `json:"x-correlation-id,omitempty"` - // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically - // generated with the prefix "gst-". - // Deprecated: this field is deprecated and may be removed in a future release. - TransactionID *string `json:"transaction-id,omitempty"` - // The ID of the billing account of the untagged resource. It is a required parameter if `tag_type` is set to // `service`, otherwise it is inferred from the authorization IAM token. AccountID *string `json:"account_id,omitempty"` @@ -1391,13 +1402,6 @@ func (_options *DetachTagOptions) SetXCorrelationID(xCorrelationID string) *Deta return _options } -// SetTransactionID : Allow user to set TransactionID -// Deprecated: this method is deprecated and may be removed in a future release. -func (_options *DetachTagOptions) SetTransactionID(transactionID string) *DetachTagOptions { - _options.TransactionID = core.StringPtr(transactionID) - return _options -} - // SetAccountID : Allow user to set AccountID func (_options *DetachTagOptions) SetAccountID(accountID string) *DetachTagOptions { _options.AccountID = core.StringPtr(accountID) @@ -1433,11 +1437,6 @@ type ListTagsOptions struct { // (version 4) UUID. XCorrelationID *string `json:"x-correlation-id,omitempty"` - // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically - // generated with the prefix "gst-". - // Deprecated: this field is deprecated and may be removed in a future release. - TransactionID *string `json:"transaction-id,omitempty"` - // The ID of the billing account to list the tags for. If it is not set, then it is taken from the authorization token. // This parameter is required if `tag_type` is set to `service`. AccountID *string `json:"account_id,omitempty"` @@ -1519,13 +1518,6 @@ func (_options *ListTagsOptions) SetXCorrelationID(xCorrelationID string) *ListT return _options } -// SetTransactionID : Allow user to set TransactionID -// Deprecated: this method is deprecated and may be removed in a future release. -func (_options *ListTagsOptions) SetTransactionID(transactionID string) *ListTagsOptions { - _options.TransactionID = core.StringPtr(transactionID) - return _options -} - // SetAccountID : Allow user to set AccountID func (_options *ListTagsOptions) SetAccountID(accountID string) *ListTagsOptions { _options.AccountID = core.StringPtr(accountID) @@ -1607,6 +1599,9 @@ func (*GlobalTaggingV1) NewResource(resourceID string) (_model *Resource, err er ResourceID: core.StringPtr(resourceID), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -1615,10 +1610,12 @@ func UnmarshalResource(m map[string]json.RawMessage, result interface{}) (err er obj := new(Resource) err = core.UnmarshalPrimitive(m, "resource_id", &obj.ResourceID) if err != nil { + err = core.SDKErrorf(err, "", "resource_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1636,6 +1633,7 @@ func UnmarshalTag(m map[string]json.RawMessage, result interface{}) (err error) obj := new(Tag) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1662,18 +1660,22 @@ func UnmarshalTagList(m map[string]json.RawMessage, result interface{}) (err err obj := new(TagList) err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "offset", &obj.Offset) if err != nil { + err = core.SDKErrorf(err, "", "offset-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "items", &obj.Items, UnmarshalTag) if err != nil { + err = core.SDKErrorf(err, "", "items-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1691,6 +1693,7 @@ func UnmarshalTagResults(m map[string]json.RawMessage, result interface{}) (err obj := new(TagResults) err = core.UnmarshalModel(m, "results", &obj.Results, UnmarshalTagResultsItem) if err != nil { + err = core.SDKErrorf(err, "", "results-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -1711,10 +1714,12 @@ func UnmarshalTagResultsItem(m map[string]json.RawMessage, result interface{}) ( obj := new(TagResultsItem) err = core.UnmarshalPrimitive(m, "resource_id", &obj.ResourceID) if err != nil { + err = core.SDKErrorf(err, "", "resource_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "is_error", &obj.IsError) if err != nil { + err = core.SDKErrorf(err, "", "is_error-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) diff --git a/globaltaggingv1/global_tagging_v1_test.go b/globaltaggingv1/global_tagging_v1_test.go index 83020d09..61866c7a 100644 --- a/globaltaggingv1/global_tagging_v1_test.go +++ b/globaltaggingv1/global_tagging_v1_test.go @@ -178,8 +178,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // TODO: Add check for full_data query parameter @@ -206,7 +204,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) listTagsOptionsModel.XRequestID = core.StringPtr("testString") listTagsOptionsModel.XCorrelationID = core.StringPtr("testString") - listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") listTagsOptionsModel.FullData = core.BoolPtr(false) @@ -251,8 +248,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // TODO: Add check for full_data query parameter @@ -284,7 +279,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) listTagsOptionsModel.XRequestID = core.StringPtr("testString") listTagsOptionsModel.XCorrelationID = core.StringPtr("testString") - listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") listTagsOptionsModel.FullData = core.BoolPtr(false) @@ -335,8 +329,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // TODO: Add check for full_data query parameter @@ -370,7 +362,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) listTagsOptionsModel.XRequestID = core.StringPtr("testString") listTagsOptionsModel.XCorrelationID = core.StringPtr("testString") - listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") listTagsOptionsModel.FullData = core.BoolPtr(false) @@ -402,7 +393,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) listTagsOptionsModel.XRequestID = core.StringPtr("testString") listTagsOptionsModel.XCorrelationID = core.StringPtr("testString") - listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") listTagsOptionsModel.FullData = core.BoolPtr(false) @@ -448,7 +438,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) listTagsOptionsModel.XRequestID = core.StringPtr("testString") listTagsOptionsModel.XCorrelationID = core.StringPtr("testString") - listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") listTagsOptionsModel.FullData = core.BoolPtr(false) @@ -488,8 +477,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"access"})) res.Header().Set("Content-type", "application/json") @@ -510,7 +497,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.XRequestID = core.StringPtr("testString") createTagOptionsModel.XCorrelationID = core.StringPtr("testString") - createTagOptionsModel.TransactionID = core.StringPtr("testString") createTagOptionsModel.AccountID = core.StringPtr("testString") createTagOptionsModel.TagType = core.StringPtr("access") createTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -563,8 +549,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"access"})) // Sleep a short time to support a timeout test @@ -590,7 +574,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.XRequestID = core.StringPtr("testString") createTagOptionsModel.XCorrelationID = core.StringPtr("testString") - createTagOptionsModel.TransactionID = core.StringPtr("testString") createTagOptionsModel.AccountID = core.StringPtr("testString") createTagOptionsModel.TagType = core.StringPtr("access") createTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -649,8 +632,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"access"})) // Set mock response @@ -678,7 +659,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.XRequestID = core.StringPtr("testString") createTagOptionsModel.XCorrelationID = core.StringPtr("testString") - createTagOptionsModel.TransactionID = core.StringPtr("testString") createTagOptionsModel.AccountID = core.StringPtr("testString") createTagOptionsModel.TagType = core.StringPtr("access") createTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -703,7 +683,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.XRequestID = core.StringPtr("testString") createTagOptionsModel.XCorrelationID = core.StringPtr("testString") - createTagOptionsModel.TransactionID = core.StringPtr("testString") createTagOptionsModel.AccountID = core.StringPtr("testString") createTagOptionsModel.TagType = core.StringPtr("access") createTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -749,7 +728,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.XRequestID = core.StringPtr("testString") createTagOptionsModel.XCorrelationID = core.StringPtr("testString") - createTagOptionsModel.TransactionID = core.StringPtr("testString") createTagOptionsModel.AccountID = core.StringPtr("testString") createTagOptionsModel.TagType = core.StringPtr("access") createTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -781,8 +759,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["providers"]).To(Equal([]string{"ghost"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -803,7 +779,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) deleteTagAllOptionsModel.XRequestID = core.StringPtr("testString") deleteTagAllOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") deleteTagAllOptionsModel.TagType = core.StringPtr("user") @@ -841,8 +816,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["providers"]).To(Equal([]string{"ghost"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -868,7 +841,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) deleteTagAllOptionsModel.XRequestID = core.StringPtr("testString") deleteTagAllOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") deleteTagAllOptionsModel.TagType = core.StringPtr("user") @@ -912,8 +884,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["providers"]).To(Equal([]string{"ghost"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -941,7 +911,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) deleteTagAllOptionsModel.XRequestID = core.StringPtr("testString") deleteTagAllOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") deleteTagAllOptionsModel.TagType = core.StringPtr("user") @@ -966,7 +935,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) deleteTagAllOptionsModel.XRequestID = core.StringPtr("testString") deleteTagAllOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") deleteTagAllOptionsModel.TagType = core.StringPtr("user") @@ -1005,7 +973,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) deleteTagAllOptionsModel.XRequestID = core.StringPtr("testString") deleteTagAllOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") deleteTagAllOptionsModel.TagType = core.StringPtr("user") @@ -1038,8 +1005,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) res.Header().Set("Content-type", "application/json") @@ -1060,7 +1025,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagOptionsModel.TagName = core.StringPtr("testString") deleteTagOptionsModel.XRequestID = core.StringPtr("testString") deleteTagOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.AccountID = core.StringPtr("testString") deleteTagOptionsModel.TagType = core.StringPtr("user") @@ -1098,8 +1062,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // Sleep a short time to support a timeout test @@ -1125,7 +1087,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagOptionsModel.TagName = core.StringPtr("testString") deleteTagOptionsModel.XRequestID = core.StringPtr("testString") deleteTagOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.AccountID = core.StringPtr("testString") deleteTagOptionsModel.TagType = core.StringPtr("user") @@ -1169,8 +1130,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // Set mock response @@ -1198,7 +1157,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagOptionsModel.TagName = core.StringPtr("testString") deleteTagOptionsModel.XRequestID = core.StringPtr("testString") deleteTagOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.AccountID = core.StringPtr("testString") deleteTagOptionsModel.TagType = core.StringPtr("user") @@ -1224,7 +1182,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagOptionsModel.TagName = core.StringPtr("testString") deleteTagOptionsModel.XRequestID = core.StringPtr("testString") deleteTagOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.AccountID = core.StringPtr("testString") deleteTagOptionsModel.TagType = core.StringPtr("user") @@ -1271,7 +1228,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagOptionsModel.TagName = core.StringPtr("testString") deleteTagOptionsModel.XRequestID = core.StringPtr("testString") deleteTagOptionsModel.XCorrelationID = core.StringPtr("testString") - deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.AccountID = core.StringPtr("testString") deleteTagOptionsModel.TagType = core.StringPtr("user") @@ -1304,8 +1260,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // TODO: Add check for replace query parameter @@ -1334,7 +1288,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.TagNames = []string{"testString"} attachTagOptionsModel.XRequestID = core.StringPtr("testString") attachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") attachTagOptionsModel.Replace = core.BoolPtr(false) @@ -1388,8 +1341,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // TODO: Add check for replace query parameter @@ -1423,7 +1374,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.TagNames = []string{"testString"} attachTagOptionsModel.XRequestID = core.StringPtr("testString") attachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") attachTagOptionsModel.Replace = core.BoolPtr(false) @@ -1483,8 +1433,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // TODO: Add check for replace query parameter @@ -1520,7 +1468,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.TagNames = []string{"testString"} attachTagOptionsModel.XRequestID = core.StringPtr("testString") attachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") attachTagOptionsModel.Replace = core.BoolPtr(false) @@ -1553,7 +1500,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.TagNames = []string{"testString"} attachTagOptionsModel.XRequestID = core.StringPtr("testString") attachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") attachTagOptionsModel.Replace = core.BoolPtr(false) @@ -1607,7 +1553,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.TagNames = []string{"testString"} attachTagOptionsModel.XRequestID = core.StringPtr("testString") attachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") attachTagOptionsModel.Replace = core.BoolPtr(false) @@ -1640,8 +1585,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) res.Header().Set("Content-type", "application/json") @@ -1669,7 +1612,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.TagNames = []string{"testString"} detachTagOptionsModel.XRequestID = core.StringPtr("testString") detachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") detachTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -1722,8 +1664,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // Sleep a short time to support a timeout test @@ -1756,7 +1696,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.TagNames = []string{"testString"} detachTagOptionsModel.XRequestID = core.StringPtr("testString") detachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") detachTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -1815,8 +1754,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.Header["X-Request-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.Header["X-Correlation-Id"]).ToNot(BeNil()) Expect(req.Header["X-Correlation-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) - Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) - Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) // Set mock response @@ -1851,7 +1788,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.TagNames = []string{"testString"} detachTagOptionsModel.XRequestID = core.StringPtr("testString") detachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") detachTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -1883,7 +1819,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.TagNames = []string{"testString"} detachTagOptionsModel.XRequestID = core.StringPtr("testString") detachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") detachTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -1936,7 +1871,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.TagNames = []string{"testString"} detachTagOptionsModel.XRequestID = core.StringPtr("testString") detachTagOptionsModel.XCorrelationID = core.StringPtr("testString") - detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") detachTagOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} @@ -1977,7 +1911,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.SetTagNames([]string{"testString"}) attachTagOptionsModel.SetXRequestID("testString") attachTagOptionsModel.SetXCorrelationID("testString") - attachTagOptionsModel.SetTransactionID("testString") attachTagOptionsModel.SetAccountID("testString") attachTagOptionsModel.SetTagType("user") attachTagOptionsModel.SetReplace(false) @@ -1988,7 +1921,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(attachTagOptionsModel.TagNames).To(Equal([]string{"testString"})) Expect(attachTagOptionsModel.XRequestID).To(Equal(core.StringPtr("testString"))) Expect(attachTagOptionsModel.XCorrelationID).To(Equal(core.StringPtr("testString"))) - Expect(attachTagOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(attachTagOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(attachTagOptionsModel.TagType).To(Equal(core.StringPtr("user"))) Expect(attachTagOptionsModel.Replace).To(Equal(core.BoolPtr(false))) @@ -2001,7 +1933,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel.SetTagNames([]string{"testString"}) createTagOptionsModel.SetXRequestID("testString") createTagOptionsModel.SetXCorrelationID("testString") - createTagOptionsModel.SetTransactionID("testString") createTagOptionsModel.SetAccountID("testString") createTagOptionsModel.SetTagType("access") createTagOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) @@ -2009,7 +1940,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(createTagOptionsModel.TagNames).To(Equal([]string{"testString"})) Expect(createTagOptionsModel.XRequestID).To(Equal(core.StringPtr("testString"))) Expect(createTagOptionsModel.XCorrelationID).To(Equal(core.StringPtr("testString"))) - Expect(createTagOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(createTagOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(createTagOptionsModel.TagType).To(Equal(core.StringPtr("access"))) Expect(createTagOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) @@ -2019,7 +1949,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagAllOptionsModel := globalTaggingService.NewDeleteTagAllOptions() deleteTagAllOptionsModel.SetXRequestID("testString") deleteTagAllOptionsModel.SetXCorrelationID("testString") - deleteTagAllOptionsModel.SetTransactionID("testString") deleteTagAllOptionsModel.SetProviders("ghost") deleteTagAllOptionsModel.SetAccountID("testString") deleteTagAllOptionsModel.SetTagType("user") @@ -2027,7 +1956,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(deleteTagAllOptionsModel).ToNot(BeNil()) Expect(deleteTagAllOptionsModel.XRequestID).To(Equal(core.StringPtr("testString"))) Expect(deleteTagAllOptionsModel.XCorrelationID).To(Equal(core.StringPtr("testString"))) - Expect(deleteTagAllOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(deleteTagAllOptionsModel.Providers).To(Equal(core.StringPtr("ghost"))) Expect(deleteTagAllOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(deleteTagAllOptionsModel.TagType).To(Equal(core.StringPtr("user"))) @@ -2040,7 +1968,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagOptionsModel.SetTagName("testString") deleteTagOptionsModel.SetXRequestID("testString") deleteTagOptionsModel.SetXCorrelationID("testString") - deleteTagOptionsModel.SetTransactionID("testString") deleteTagOptionsModel.SetProviders([]string{"ghost"}) deleteTagOptionsModel.SetAccountID("testString") deleteTagOptionsModel.SetTagType("user") @@ -2049,7 +1976,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(deleteTagOptionsModel.TagName).To(Equal(core.StringPtr("testString"))) Expect(deleteTagOptionsModel.XRequestID).To(Equal(core.StringPtr("testString"))) Expect(deleteTagOptionsModel.XCorrelationID).To(Equal(core.StringPtr("testString"))) - Expect(deleteTagOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(deleteTagOptionsModel.Providers).To(Equal([]string{"ghost"})) Expect(deleteTagOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(deleteTagOptionsModel.TagType).To(Equal(core.StringPtr("user"))) @@ -2072,7 +1998,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.SetTagNames([]string{"testString"}) detachTagOptionsModel.SetXRequestID("testString") detachTagOptionsModel.SetXCorrelationID("testString") - detachTagOptionsModel.SetTransactionID("testString") detachTagOptionsModel.SetAccountID("testString") detachTagOptionsModel.SetTagType("user") detachTagOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) @@ -2082,7 +2007,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(detachTagOptionsModel.TagNames).To(Equal([]string{"testString"})) Expect(detachTagOptionsModel.XRequestID).To(Equal(core.StringPtr("testString"))) Expect(detachTagOptionsModel.XCorrelationID).To(Equal(core.StringPtr("testString"))) - Expect(detachTagOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(detachTagOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(detachTagOptionsModel.TagType).To(Equal(core.StringPtr("user"))) Expect(detachTagOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) @@ -2092,7 +2016,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { listTagsOptionsModel := globalTaggingService.NewListTagsOptions() listTagsOptionsModel.SetXRequestID("testString") listTagsOptionsModel.SetXCorrelationID("testString") - listTagsOptionsModel.SetTransactionID("testString") listTagsOptionsModel.SetAccountID("testString") listTagsOptionsModel.SetTagType("user") listTagsOptionsModel.SetFullData(false) @@ -2107,7 +2030,6 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(listTagsOptionsModel).ToNot(BeNil()) Expect(listTagsOptionsModel.XRequestID).To(Equal(core.StringPtr("testString"))) Expect(listTagsOptionsModel.XCorrelationID).To(Equal(core.StringPtr("testString"))) - Expect(listTagsOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(listTagsOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(listTagsOptionsModel.TagType).To(Equal(core.StringPtr("user"))) Expect(listTagsOptionsModel.FullData).To(Equal(core.BoolPtr(false)))