From 9a13c35935521981054f4e4379b852dc9237b788 Mon Sep 17 00:00:00 2001 From: Fabrizio Leoni Date: Wed, 21 Dec 2022 17:21:36 +0100 Subject: [PATCH 1/2] fix(Global Search/Tagging): regenerated services with latest API definition. Signed-off-by: Fabrizio Leoni --- globalsearchv2/global_search_v2.go | 254 ++++++++++++++---- globalsearchv2/global_search_v2_suite_test.go | 2 +- globalsearchv2/global_search_v2_test.go | 76 +++++- globaltaggingv1/global_tagging_v1.go | 221 ++++++++++----- .../global_tagging_v1_suite_test.go | 2 +- globaltaggingv1/global_tagging_v1_test.go | 120 +++++++-- 6 files changed, 534 insertions(+), 141 deletions(-) diff --git a/globalsearchv2/global_search_v2.go b/globalsearchv2/global_search_v2.go index 4ad78777..8946f5e6 100644 --- a/globalsearchv2/global_search_v2.go +++ b/globalsearchv2/global_search_v2.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2022. * * 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: 3.33.0-caf29bd0-20210603-225214 + * IBM OpenAPI SDK Code Generator Version: 3.62.2-e5d4c32b-20221214-193750 */ // Package globalsearchv2 : Operations and models for the GlobalSearchV2 service @@ -34,22 +34,19 @@ import ( common "github.com/IBM/platform-services-go-sdk/common" ) -// GlobalSearchV2 : Search for resources with the global and shared resource properties repository 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 and is owned by resource providers, such as Cloud Foundry, IBM Kubernetes Service, or resource +// 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. // -// Version: 2.0.1 +// API Version: 2.0.1 type GlobalSearchV2 struct { Service *core.BaseService } -// DefaultServiceURL is the default URL to make service requests to. -const DefaultServiceURL = "https://api.global-search-tagging.cloud.ibm.com" - // DefaultServiceName is the default key used to find external configuration information. const DefaultServiceName = "global_search" @@ -92,7 +89,6 @@ func NewGlobalSearchV2UsingExternalConfig(options *GlobalSearchV2Options) (globa // NewGlobalSearchV2 : constructs an instance of GlobalSearchV2 with passed in options. func NewGlobalSearchV2(options *GlobalSearchV2Options) (service *GlobalSearchV2, err error) { serviceOptions := &core.ServiceOptions{ - URL: DefaultServiceURL, Authenticator: options.Authenticator, } @@ -167,20 +163,19 @@ func (globalSearch *GlobalSearchV2) DisableRetries() { } // Search : Find instances of resources (v3) -// Find Cloud Foundry resources, IAM-enabled resources, or storage and network resources running on classic -// infrastructure in a specific account ID. You can apply query strings if necessary. +// 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. // -// To filter results, you can insert a string 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 -// words, in the same order. To filter for a specific value regardless of the property that contains it, type the -// search term without specifying a field. Only resources that belong to the account ID and that are accessible by the -// client are returned. +// 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 +// words, in the same order. To filter for a specific value regardless of the property that contains it, type the search +// term without specifying a field. Only resources that belong to the account ID and that are accessible by the client +// are returned. // -// You must use `/v3/resources/search` when you need to fetch more than `10000` resource items. The -// `/v2/resources/search` prohibits paginating through such a big number. On the first call, the operation returns a -// live cursor on the data that you must use on all the subsequent calls to get the next batch of results until you -// get the empty result set. By default, the fields returned for every resource are "crn", "name", "family", "type", -// and "account_id". You can specify the subset of the fields you want in your request. +// You must use `/v3/resources/search` when you need to fetch more than `10000` resource items. On the first call, the +// operation returns a live cursor on the data that you must use on all the subsequent calls to get the next batch of +// results until you get the empty result set. By default, the fields that are returned for every resource are "crn", +// "name", "family", "type", and "account_id". You can specify the subset of the fields you want in your request. func (globalSearch *GlobalSearchV2) Search(searchOptions *SearchOptions) (result *ScanResult, response *core.DetailedResponse, err error) { return globalSearch.SearchWithContext(context.Background(), searchOptions) } @@ -221,6 +216,9 @@ func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searc if searchOptions.AccountID != nil { builder.AddQuery("account_id", fmt.Sprint(*searchOptions.AccountID)) } + if searchOptions.Boundary != nil { + builder.AddQuery("boundary", fmt.Sprint(*searchOptions.Boundary)) + } if searchOptions.Limit != nil { builder.AddQuery("limit", fmt.Sprint(*searchOptions.Limit)) } @@ -230,6 +228,24 @@ func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searc if searchOptions.Sort != nil { builder.AddQuery("sort", strings.Join(searchOptions.Sort, ",")) } + if searchOptions.IsDeleted != nil { + builder.AddQuery("is_deleted", fmt.Sprint(*searchOptions.IsDeleted)) + } + if searchOptions.IsReclaimed != nil { + builder.AddQuery("is_reclaimed", fmt.Sprint(*searchOptions.IsReclaimed)) + } + if searchOptions.IsPublic != nil { + builder.AddQuery("is_public", fmt.Sprint(*searchOptions.IsPublic)) + } + if searchOptions.ImpersonateUser != nil { + builder.AddQuery("impersonate_user", fmt.Sprint(*searchOptions.ImpersonateUser)) + } + if searchOptions.CanTag != nil { + builder.AddQuery("can_tag", fmt.Sprint(*searchOptions.CanTag)) + } + if searchOptions.IsHidden != nil { + builder.AddQuery("is_hidden", fmt.Sprint(*searchOptions.IsHidden)) + } body := make(map[string]interface{}) if searchOptions.Query != nil { @@ -267,14 +283,17 @@ func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searc return } -// GetSupportedTypes : DEPRECATED. Get all GhoST indices -// Retrieves a list of all GhoST indices. +// GetSupportedTypes : DEPRECATED. Get all GhoST indexes +// Retrieves a list of all GhoST indexes. +// Deprecated: this method is deprecated and may be removed in a future release. func (globalSearch *GlobalSearchV2) GetSupportedTypes(getSupportedTypesOptions *GetSupportedTypesOptions) (result *SupportedTypesList, response *core.DetailedResponse, err error) { return globalSearch.GetSupportedTypesWithContext(context.Background(), getSupportedTypesOptions) } // GetSupportedTypesWithContext is an alternate form of the GetSupportedTypes method which supports a Context parameter +// Deprecated: this method is deprecated and may be removed in a future release. func (globalSearch *GlobalSearchV2) GetSupportedTypesWithContext(ctx context.Context, getSupportedTypesOptions *GetSupportedTypesOptions) (result *SupportedTypesList, response *core.DetailedResponse, err error) { + core.GetLogger().Warn("A deprecated operation has been invoked: GetSupportedTypes") err = core.ValidateStruct(getSupportedTypesOptions, "getSupportedTypesOptions") if err != nil { return @@ -337,10 +356,11 @@ func (options *GetSupportedTypesOptions) SetHeaders(param map[string]string) *Ge return options } -// ResultItem : A resource returned in a search result. +// ResultItem : A resource returned in a search result, which is identified by its `crn`. It contains other properties that depend on +// the resource type. type ResultItem struct { // Resource identifier in CRN format. - CRN *string `json:"crn,omitempty"` + CRN *string `json:"crn" validate:"required"` // Allows users to set arbitrary properties additionalProperties map[string]interface{} @@ -354,6 +374,14 @@ func (o *ResultItem) SetProperty(key string, value interface{}) { o.additionalProperties[key] = value } +// SetProperties allows the user to set a map of arbitrary properties on an instance of ResultItem +func (o *ResultItem) SetProperties(m map[string]interface{}) { + o.additionalProperties = make(map[string]interface{}) + for k, v := range m { + o.additionalProperties[k] = v + } +} + // GetProperty allows the user to retrieve an arbitrary property from an instance of ResultItem func (o *ResultItem) GetProperty(key string) interface{} { return o.additionalProperties[key] @@ -403,13 +431,13 @@ func UnmarshalResultItem(m map[string]json.RawMessage, result interface{}) (err // ScanResult : The search scan response. type ScanResult struct { // The search cursor to use on all calls after the first one. - SearchCursor *string `json:"search_cursor" validate:"required"` + SearchCursor *string `json:"search_cursor,omitempty"` // Value of the limit parameter specified by the user. - Limit *int64 `json:"limit,omitempty"` + Limit *float64 `json:"limit" validate:"required"` - // The array of results. Each item represents a resource. An empty array signals the end of the result set, there are - // no more hits to fetch. + // The array of results. Each item represents a resource. An empty array signals the end of the result set, which means + // there are no more results to fetch. Items []ResultItem `json:"items" validate:"required"` } @@ -435,35 +463,123 @@ func UnmarshalScanResult(m map[string]json.RawMessage, result interface{}) (err // SearchOptions : The Search options. type SearchOptions struct { // The Lucene-formatted query string. Default to '*' if not set. - Query *string + Query *string `json:"query,omitempty"` - // The list of the fields returned by the search. Defaults to all. `crn` is always returned. - Fields []string + // The list of the fields returned by the search. By default, the returned fields are the `account_id`, `name`, `type`, + // `family`, and `crn`. For all queries, `crn` is always returned. + Fields []string `json:"fields,omitempty"` - // An opaque search cursor that is returned on each operation call and that must be set on next call. - SearchCursor *string + // An opaque cursor that is returned on each call and that must be set on the subsequent call to get the next batch of + // items. If the search returns no items, then the search_cursor is not present in the response. + SearchCursor *string `json:"search_cursor,omitempty"` - // An aplhanumeric string that can be used to trace a request across services. If not specified it will be - // automatically generated with the prefix "gst-". - TransactionID *string + // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically + // generated with the prefix "gst-". + TransactionID *string `json:"transaction-id,omitempty"` // The account ID to filter resources. - AccountID *string + AccountID *string `json:"account_id,omitempty"` + + // The boundary where the search performs. This parameter must be set only for the cross-account searches. + Boundary *string `json:"boundary,omitempty"` // The maximum number of hits to return. Defaults to 10. - Limit *int64 + Limit *int64 `json:"limit,omitempty"` - // A search timeout, bounding the search request to be executed within the specified time value and bail with the hits - // accumulated up to that point when expired. Defaults to the system defined timeout. - Timeout *int64 + // A search timeout in milliseconds, bounding the search request to run within the specified time value and bail with + // the hits accumulated up to that point when expired. Defaults to the system defined timeout. + Timeout *int64 `json:"timeout,omitempty"` - // Comma separated properties names used for sorting. - Sort []string + // Comma separated properties names that are used for sorting. + Sort []string `json:"sort,omitempty"` + + // Determines if deleted documents should be included in result set or not. Possible values are false (default), true + // or any. If false, only existing documents are returned; if true, only deleted documents are returned; If any, both + // existing and deleted documents are returned. (_for administrators only_). + IsDeleted *string `json:"is_deleted,omitempty"` + + // Determines if reclaimed documents should be included in result set or not. Possible values are false (default), true + // or any. If false, only not reclaimed documents are returned; if true, only reclaimed documents are returned; If any, + // both reclaimed and not reclaimed documents are returned. + IsReclaimed *string `json:"is_reclaimed,omitempty"` + + // Determines if public resources should be included in result set or not. Possible values are false (default), true or + // any. If false, do not search public resources; if true, search only public resources; If any, search also public + // resources. + IsPublic *string `json:"is_public,omitempty"` + + // The user on whose behalf the search must be performed. Only a GhoST admin can impersonate a user, so be sure you set + // a GhoST admin IAM token in the Authorization header if you set this parameter. (_for administrators only_). + ImpersonateUser *string `json:"impersonate_user,omitempty"` + + // Determines if the result set must return the resources that the user can tag or the resources that the user can view + // (only a GhoST admin can use this parameter). If false (default), only resources user can view are returned; if true, + // only resources that user has permissions for tagging are returned (_for administrators only_). + CanTag *string `json:"can_tag,omitempty"` + + // Determines if the result set must return only the visible resources or not. If false (default), only visible + // resources are returned; if true, only hidden resources are returned; if any, all resources are returned. + IsHidden *string `json:"is_hidden,omitempty"` // Allows users to set headers on API requests Headers map[string]string } +// Constants associated with the SearchOptions.Boundary property. +// The boundary where the search performs. This parameter must be set only for the cross-account searches. +const ( + SearchOptionsBoundaryGlobalConst = "global" + SearchOptionsBoundaryUsRegulatedConst = "us-regulated" +) + +// Constants associated with the SearchOptions.IsDeleted property. +// Determines if deleted documents should be included in result set or not. Possible values are false (default), true or +// any. If false, only existing documents are returned; if true, only deleted documents are returned; If any, both +// existing and deleted documents are returned. (_for administrators only_). +const ( + SearchOptionsIsDeletedAnyConst = "any" + SearchOptionsIsDeletedFalseConst = "false" + SearchOptionsIsDeletedTrueConst = "true" +) + +// Constants associated with the SearchOptions.IsReclaimed property. +// Determines if reclaimed documents should be included in result set or not. Possible values are false (default), true +// or any. If false, only not reclaimed documents are returned; if true, only reclaimed documents are returned; If any, +// both reclaimed and not reclaimed documents are returned. +const ( + SearchOptionsIsReclaimedAnyConst = "any" + SearchOptionsIsReclaimedFalseConst = "false" + SearchOptionsIsReclaimedTrueConst = "true" +) + +// Constants associated with the SearchOptions.IsPublic property. +// Determines if public resources should be included in result set or not. Possible values are false (default), true or +// any. If false, do not search public resources; if true, search only public resources; If any, search also public +// resources. +const ( + SearchOptionsIsPublicAnyConst = "any" + SearchOptionsIsPublicFalseConst = "false" + SearchOptionsIsPublicTrueConst = "true" +) + +// Constants associated with the SearchOptions.CanTag property. +// Determines if the result set must return the resources that the user can tag or the resources that the user can view +// (only a GhoST admin can use this parameter). If false (default), only resources user can view are returned; if true, +// only resources that user has permissions for tagging are returned (_for administrators only_). +const ( + SearchOptionsCanTagFalseConst = "false" + SearchOptionsCanTagTrueConst = "true" +) + +// Constants associated with the SearchOptions.IsHidden property. +// Determines if the result set must return only the visible resources or not. If false (default), only visible +// resources are returned; if true, only hidden resources are returned; if any, all resources are returned. +const ( + SearchOptionsIsHiddenAnyConst = "any" + SearchOptionsIsHiddenFalseConst = "false" + SearchOptionsIsHiddenTrueConst = "true" +) + // NewSearchOptions : Instantiate SearchOptions func (*GlobalSearchV2) NewSearchOptions() *SearchOptions { return &SearchOptions{} @@ -499,6 +615,12 @@ func (_options *SearchOptions) SetAccountID(accountID string) *SearchOptions { return _options } +// SetBoundary : Allow user to set Boundary +func (_options *SearchOptions) SetBoundary(boundary string) *SearchOptions { + _options.Boundary = core.StringPtr(boundary) + return _options +} + // SetLimit : Allow user to set Limit func (_options *SearchOptions) SetLimit(limit int64) *SearchOptions { _options.Limit = core.Int64Ptr(limit) @@ -517,15 +639,51 @@ func (_options *SearchOptions) SetSort(sort []string) *SearchOptions { return _options } +// SetIsDeleted : Allow user to set IsDeleted +func (_options *SearchOptions) SetIsDeleted(isDeleted string) *SearchOptions { + _options.IsDeleted = core.StringPtr(isDeleted) + return _options +} + +// SetIsReclaimed : Allow user to set IsReclaimed +func (_options *SearchOptions) SetIsReclaimed(isReclaimed string) *SearchOptions { + _options.IsReclaimed = core.StringPtr(isReclaimed) + return _options +} + +// SetIsPublic : Allow user to set IsPublic +func (_options *SearchOptions) SetIsPublic(isPublic string) *SearchOptions { + _options.IsPublic = core.StringPtr(isPublic) + return _options +} + +// SetImpersonateUser : Allow user to set ImpersonateUser +func (_options *SearchOptions) SetImpersonateUser(impersonateUser string) *SearchOptions { + _options.ImpersonateUser = core.StringPtr(impersonateUser) + return _options +} + +// SetCanTag : Allow user to set CanTag +func (_options *SearchOptions) SetCanTag(canTag string) *SearchOptions { + _options.CanTag = core.StringPtr(canTag) + return _options +} + +// SetIsHidden : Allow user to set IsHidden +func (_options *SearchOptions) SetIsHidden(isHidden string) *SearchOptions { + _options.IsHidden = core.StringPtr(isHidden) + return _options +} + // SetHeaders : Allow user to set Headers func (options *SearchOptions) SetHeaders(param map[string]string) *SearchOptions { options.Headers = param return options } -// SupportedTypesList : A list of all GhoST indices. +// SupportedTypesList : A list of all GhoST indexes. type SupportedTypesList struct { - // A list of all GhoST indices. + // A list of all GhoST indexes. SupportedTypes []string `json:"supported_types,omitempty"` } diff --git a/globalsearchv2/global_search_v2_suite_test.go b/globalsearchv2/global_search_v2_suite_test.go index e7f6454a..77a8e2a8 100644 --- a/globalsearchv2/global_search_v2_suite_test.go +++ b/globalsearchv2/global_search_v2_suite_test.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2022. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/globalsearchv2/global_search_v2_test.go b/globalsearchv2/global_search_v2_test.go index ffd10ca2..73f7f3a7 100644 --- a/globalsearchv2/global_search_v2_test.go +++ b/globalsearchv2/global_search_v2_test.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2022. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -176,11 +176,18 @@ var _ = Describe(`GlobalSearchV2`, func() { 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()["boundary"]).To(Equal([]string{"global"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) Expect(req.URL.Query()["timeout"]).To(Equal([]string{fmt.Sprint(int64(0))})) + Expect(req.URL.Query()["is_deleted"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_reclaimed"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_public"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["can_tag"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_hidden"]).To(Equal([]string{"false"})) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, `} this is not valid json {`) + fmt.Fprint(res, `} this is not valid json {`) })) }) It(`Invoke Search with error: Operation response processing error`, func() { @@ -198,9 +205,16 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") + searchOptionsModel.Boundary = core.StringPtr("global") searchOptionsModel.Limit = core.Int64Ptr(int64(1)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) searchOptionsModel.Sort = []string{"testString"} + searchOptionsModel.IsDeleted = core.StringPtr("false") + searchOptionsModel.IsReclaimed = core.StringPtr("false") + searchOptionsModel.IsPublic = core.StringPtr("false") + searchOptionsModel.ImpersonateUser = core.StringPtr("testString") + searchOptionsModel.CanTag = core.StringPtr("false") + searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.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 := globalSearchService.Search(searchOptionsModel) @@ -250,8 +264,15 @@ var _ = Describe(`GlobalSearchV2`, func() { 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()["boundary"]).To(Equal([]string{"global"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) Expect(req.URL.Query()["timeout"]).To(Equal([]string{fmt.Sprint(int64(0))})) + Expect(req.URL.Query()["is_deleted"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_reclaimed"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_public"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["can_tag"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_hidden"]).To(Equal([]string{"false"})) // Sleep a short time to support a timeout test time.Sleep(100 * time.Millisecond) @@ -277,9 +298,16 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") + searchOptionsModel.Boundary = core.StringPtr("global") searchOptionsModel.Limit = core.Int64Ptr(int64(1)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) searchOptionsModel.Sort = []string{"testString"} + searchOptionsModel.IsDeleted = core.StringPtr("false") + searchOptionsModel.IsReclaimed = core.StringPtr("false") + searchOptionsModel.IsPublic = core.StringPtr("false") + searchOptionsModel.ImpersonateUser = core.StringPtr("testString") + searchOptionsModel.CanTag = core.StringPtr("false") + searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -335,8 +363,15 @@ var _ = Describe(`GlobalSearchV2`, func() { 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()["boundary"]).To(Equal([]string{"global"})) Expect(req.URL.Query()["limit"]).To(Equal([]string{fmt.Sprint(int64(1))})) Expect(req.URL.Query()["timeout"]).To(Equal([]string{fmt.Sprint(int64(0))})) + Expect(req.URL.Query()["is_deleted"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_reclaimed"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_public"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) + Expect(req.URL.Query()["can_tag"]).To(Equal([]string{"false"})) + Expect(req.URL.Query()["is_hidden"]).To(Equal([]string{"false"})) // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(200) @@ -364,9 +399,16 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") + searchOptionsModel.Boundary = core.StringPtr("global") searchOptionsModel.Limit = core.Int64Ptr(int64(1)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) searchOptionsModel.Sort = []string{"testString"} + searchOptionsModel.IsDeleted = core.StringPtr("false") + searchOptionsModel.IsReclaimed = core.StringPtr("false") + searchOptionsModel.IsPublic = core.StringPtr("false") + searchOptionsModel.ImpersonateUser = core.StringPtr("testString") + searchOptionsModel.CanTag = core.StringPtr("false") + searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -391,9 +433,16 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") + searchOptionsModel.Boundary = core.StringPtr("global") searchOptionsModel.Limit = core.Int64Ptr(int64(1)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) searchOptionsModel.Sort = []string{"testString"} + searchOptionsModel.IsDeleted = core.StringPtr("false") + searchOptionsModel.IsReclaimed = core.StringPtr("false") + searchOptionsModel.IsPublic = core.StringPtr("false") + searchOptionsModel.ImpersonateUser = core.StringPtr("testString") + searchOptionsModel.CanTag = core.StringPtr("false") + searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := globalSearchService.SetServiceURL("") @@ -432,9 +481,16 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SearchCursor = core.StringPtr("testString") searchOptionsModel.TransactionID = core.StringPtr("testString") searchOptionsModel.AccountID = core.StringPtr("testString") + searchOptionsModel.Boundary = core.StringPtr("global") searchOptionsModel.Limit = core.Int64Ptr(int64(1)) searchOptionsModel.Timeout = core.Int64Ptr(int64(0)) searchOptionsModel.Sort = []string{"testString"} + searchOptionsModel.IsDeleted = core.StringPtr("false") + searchOptionsModel.IsReclaimed = core.StringPtr("false") + searchOptionsModel.IsPublic = core.StringPtr("false") + searchOptionsModel.ImpersonateUser = core.StringPtr("testString") + searchOptionsModel.CanTag = core.StringPtr("false") + searchOptionsModel.IsHidden = core.StringPtr("false") searchOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -462,7 +518,7 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(req.Method).To(Equal("GET")) res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, `} this is not valid json {`) + fmt.Fprint(res, `} this is not valid json {`) })) }) It(`Invoke GetSupportedTypes with error: Operation response processing error`, func() { @@ -671,9 +727,16 @@ var _ = Describe(`GlobalSearchV2`, func() { searchOptionsModel.SetSearchCursor("testString") searchOptionsModel.SetTransactionID("testString") searchOptionsModel.SetAccountID("testString") + searchOptionsModel.SetBoundary("global") searchOptionsModel.SetLimit(int64(1)) searchOptionsModel.SetTimeout(int64(0)) searchOptionsModel.SetSort([]string{"testString"}) + searchOptionsModel.SetIsDeleted("false") + searchOptionsModel.SetIsReclaimed("false") + searchOptionsModel.SetIsPublic("false") + searchOptionsModel.SetImpersonateUser("testString") + searchOptionsModel.SetCanTag("false") + searchOptionsModel.SetIsHidden("false") searchOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(searchOptionsModel).ToNot(BeNil()) Expect(searchOptionsModel.Query).To(Equal(core.StringPtr("testString"))) @@ -681,9 +744,16 @@ var _ = Describe(`GlobalSearchV2`, func() { Expect(searchOptionsModel.SearchCursor).To(Equal(core.StringPtr("testString"))) Expect(searchOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(searchOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) + Expect(searchOptionsModel.Boundary).To(Equal(core.StringPtr("global"))) Expect(searchOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(1)))) Expect(searchOptionsModel.Timeout).To(Equal(core.Int64Ptr(int64(0)))) Expect(searchOptionsModel.Sort).To(Equal([]string{"testString"})) + Expect(searchOptionsModel.IsDeleted).To(Equal(core.StringPtr("false"))) + Expect(searchOptionsModel.IsReclaimed).To(Equal(core.StringPtr("false"))) + Expect(searchOptionsModel.IsPublic).To(Equal(core.StringPtr("false"))) + Expect(searchOptionsModel.ImpersonateUser).To(Equal(core.StringPtr("testString"))) + Expect(searchOptionsModel.CanTag).To(Equal(core.StringPtr("false"))) + Expect(searchOptionsModel.IsHidden).To(Equal(core.StringPtr("false"))) Expect(searchOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) }) diff --git a/globaltaggingv1/global_tagging_v1.go b/globaltaggingv1/global_tagging_v1.go index 306fac24..aa0dffb1 100644 --- a/globaltaggingv1/global_tagging_v1.go +++ b/globaltaggingv1/global_tagging_v1.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2022. * * 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: 3.33.0-caf29bd0-20210603-225214 + * IBM OpenAPI SDK Code Generator Version: 3.62.2-e5d4c32b-20221214-193750 */ // Package globaltaggingv1 : Operations and models for the GlobalTaggingV1 service @@ -34,14 +34,14 @@ import ( common "github.com/IBM/platform-services-go-sdk/common" ) -// GlobalTaggingV1 : Manage your tags with the Tagging API in IBM Cloud. You can attach, detach, delete a tag or list -// all tags in your billing account with the Tagging API. The tag name must be unique within a billing account. You can +// GlobalTaggingV1 : Manage your tags with the Tagging API in IBM Cloud. You can attach, detach, delete, or list all of +// the tags in your billing account with the Tagging API. The tag name must be unique within a billing account. You can // create tags in two formats: `key:value` or `label`. The tagging API supports three types of tag: `user` `service`, // and `access` tags. `service` tags cannot be attached to IMS resources. `service` tags must be in the form // `service_prefix:tag_label` where `service_prefix` identifies the Service owning the tag. `access` tags cannot be // attached to IMS and Cloud Foundry resources. They must be in the form `key:value`. // -// Version: 1.2.0 +// API Version: 1.2.0 type GlobalTaggingV1 struct { Service *core.BaseService } @@ -166,8 +166,8 @@ func (globalTagging *GlobalTaggingV1) DisableRetries() { } // ListTags : Get all tags -// Lists all tags in a billing account. Use the `attached_to` parameter to return the list of tags attached to the -// specified resource. +// 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) } @@ -196,6 +196,9 @@ func (globalTagging *GlobalTaggingV1) ListTagsWithContext(ctx context.Context, l builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + if listTagsOptions.TransactionID != nil { + builder.AddHeader("transaction-id", fmt.Sprint(*listTagsOptions.TransactionID)) + } if listTagsOptions.ImpersonateUser != nil { builder.AddQuery("impersonate_user", fmt.Sprint(*listTagsOptions.ImpersonateUser)) @@ -252,10 +255,10 @@ func (globalTagging *GlobalTaggingV1) ListTagsWithContext(ctx context.Context, l return } -// CreateTag : Create an access tag -// Create an access tag. To create an `access` tag, you must have the access listed in the [Granting users 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. +// CreateTag : Create an access management tag +// Create an access management tag. To create an `access` tag, you must have the access listed in the [Granting users +// 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) } @@ -289,6 +292,9 @@ func (globalTagging *GlobalTaggingV1) CreateTagWithContext(ctx context.Context, } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") + if createTagOptions.TransactionID != nil { + builder.AddHeader("transaction-id", fmt.Sprint(*createTagOptions.TransactionID)) + } if createTagOptions.ImpersonateUser != nil { builder.AddQuery("impersonate_user", fmt.Sprint(*createTagOptions.ImpersonateUser)) @@ -360,6 +366,9 @@ func (globalTagging *GlobalTaggingV1) DeleteTagAllWithContext(ctx context.Contex builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + if deleteTagAllOptions.TransactionID != nil { + builder.AddHeader("transaction-id", fmt.Sprint(*deleteTagAllOptions.TransactionID)) + } if deleteTagAllOptions.Providers != nil { builder.AddQuery("providers", fmt.Sprint(*deleteTagAllOptions.Providers)) @@ -433,6 +442,9 @@ func (globalTagging *GlobalTaggingV1) DeleteTagWithContext(ctx context.Context, builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + if deleteTagOptions.TransactionID != nil { + builder.AddHeader("transaction-id", fmt.Sprint(*deleteTagOptions.TransactionID)) + } if deleteTagOptions.Providers != nil { builder.AddQuery("providers", strings.Join(deleteTagOptions.Providers, ",")) @@ -469,7 +481,8 @@ func (globalTagging *GlobalTaggingV1) DeleteTagWithContext(ctx context.Context, } // AttachTag : Attach tags -// Attaches one or more tags to one or more resources. +// 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) } @@ -503,6 +516,9 @@ func (globalTagging *GlobalTaggingV1) AttachTagWithContext(ctx context.Context, } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") + if attachTagOptions.TransactionID != nil { + builder.AddHeader("transaction-id", fmt.Sprint(*attachTagOptions.TransactionID)) + } if attachTagOptions.ImpersonateUser != nil { builder.AddQuery("impersonate_user", fmt.Sprint(*attachTagOptions.ImpersonateUser)) @@ -585,6 +601,9 @@ func (globalTagging *GlobalTaggingV1) DetachTagWithContext(ctx context.Context, } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/json") + if detachTagOptions.TransactionID != nil { + builder.AddHeader("transaction-id", fmt.Sprint(*detachTagOptions.TransactionID)) + } if detachTagOptions.ImpersonateUser != nil { builder.AddQuery("impersonate_user", fmt.Sprint(*detachTagOptions.ImpersonateUser)) @@ -634,25 +653,29 @@ func (globalTagging *GlobalTaggingV1) DetachTagWithContext(ctx context.Context, // AttachTagOptions : The AttachTag options. type AttachTagOptions struct { - // List of resources on which the tag or tags should be attached. - Resources []Resource `validate:"required"` + // List of resources on which the tag or tags are attached. + Resources []Resource `json:"resources" validate:"required"` // The name of the tag to attach. - TagName *string + TagName *string `json:"tag_name,omitempty"` // An array of tag names to attach. - TagNames []string + TagNames []string `json:"tag_names,omitempty"` + + // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically + // generated with the prefix "gst-". + TransactionID *string `json:"transaction-id,omitempty"` // The user on whose behalf the attach operation must be performed (_for administrators only_). - ImpersonateUser *string + ImpersonateUser *string `json:"impersonate_user,omitempty"` - // The ID of the billing account where the resources to be tagged lives. It is a required parameter if `tag_type` is - // set to `service`. Otherwise, it is inferred from the authorization IAM token. - AccountID *string + // 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"` // The type of the tag. Supported values are `user`, `service` and `access`. `service` and `access` are not supported // for IMS resources. - TagType *string + TagType *string `json:"tag_type,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -692,6 +715,12 @@ func (_options *AttachTagOptions) SetTagNames(tagNames []string) *AttachTagOptio return _options } +// SetTransactionID : Allow user to set TransactionID +func (_options *AttachTagOptions) SetTransactionID(transactionID string) *AttachTagOptions { + _options.TransactionID = core.StringPtr(transactionID) + return _options +} + // SetImpersonateUser : Allow user to set ImpersonateUser func (_options *AttachTagOptions) SetImpersonateUser(impersonateUser string) *AttachTagOptions { _options.ImpersonateUser = core.StringPtr(impersonateUser) @@ -719,17 +748,21 @@ func (options *AttachTagOptions) SetHeaders(param map[string]string) *AttachTagO // CreateTagOptions : The CreateTag options. type CreateTagOptions struct { // An array of tag names to create. - TagNames []string `validate:"required"` + TagNames []string `json:"tag_names" validate:"required"` // The user on whose behalf the create operation must be performed (_for administrators only_). - ImpersonateUser *string + ImpersonateUser *string `json:"impersonate_user,omitempty"` + + // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically + // generated with the prefix "gst-". + TransactionID *string `json:"transaction-id,omitempty"` // The ID of the billing account where the tag must be created. It is a required parameter if `impersonate_user` is // set. - AccountID *string + AccountID *string `json:"account_id,omitempty"` // The type of the tags you want to create. The only allowed value is `access`. - TagType *string + TagType *string `json:"tag_type,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -760,6 +793,12 @@ func (_options *CreateTagOptions) SetImpersonateUser(impersonateUser string) *Cr return _options } +// SetTransactionID : Allow user to set TransactionID +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) @@ -780,7 +819,7 @@ func (options *CreateTagOptions) SetHeaders(param map[string]string) *CreateTagO // CreateTagResults : Results of a create tag(s) request. type CreateTagResults struct { - // Array of results of an set_tags request. + // Array of results of a create_tag request. Results []CreateTagResultsResultsItem `json:"results,omitempty"` } @@ -800,7 +839,7 @@ type CreateTagResultsResultsItem struct { // The name of the tag created. TagName *string `json:"tag_name,omitempty"` - // true if the tag was not created. + // true if the tag was not created (for example, the tag already exists). IsError *bool `json:"is_error,omitempty"` } @@ -821,19 +860,23 @@ func UnmarshalCreateTagResultsResultsItem(m map[string]json.RawMessage, result i // DeleteTagAllOptions : The DeleteTagAll options. type DeleteTagAllOptions struct { + // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically + // generated with the prefix "gst-". + TransactionID *string `json:"transaction-id,omitempty"` + // Select a provider. Supported values are `ghost` and `ims`. - Providers *string + Providers *string `json:"providers,omitempty"` // The user on whose behalf the delete all operation must be performed (_for administrators only_). - ImpersonateUser *string + ImpersonateUser *string `json:"impersonate_user,omitempty"` // The ID of the billing account to delete the tags for. If it is not set, then it is taken from the authorization // token. It is a required parameter if `tag_type` is set to `service`. - AccountID *string + AccountID *string `json:"account_id,omitempty"` // The type of the tag. Supported values are `user`, `service` and `access`. `service` and `access` are not supported // for IMS resources (`providers` parameter set to `ims`). - TagType *string + TagType *string `json:"tag_type,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -860,6 +903,12 @@ func (*GlobalTaggingV1) NewDeleteTagAllOptions() *DeleteTagAllOptions { return &DeleteTagAllOptions{} } +// SetTransactionID : Allow user to set TransactionID +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) @@ -893,22 +942,26 @@ func (options *DeleteTagAllOptions) SetHeaders(param map[string]string) *DeleteT // DeleteTagOptions : The DeleteTag options. type DeleteTagOptions struct { // The name of tag to be deleted. - TagName *string `validate:"required,ne="` + TagName *string `json:"tag_name" validate:"required,ne="` + + // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically + // generated with the prefix "gst-". + 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 + Providers []string `json:"providers,omitempty"` // The user on whose behalf the delete operation must be performed (_for administrators only_). - ImpersonateUser *string + ImpersonateUser *string `json:"impersonate_user,omitempty"` // The ID of the billing account to delete the tag for. It is a required parameter if `tag_type` is set to `service`, // otherwise it is inferred from the authorization IAM token. - AccountID *string + AccountID *string `json:"account_id,omitempty"` // The type of the tag. Supported values are `user`, `service` and `access`. `service` and `access` are not supported // for IMS resources (`providers` parameter set to `ims`). - TagType *string + TagType *string `json:"tag_type,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -942,6 +995,12 @@ func (_options *DeleteTagOptions) SetTagName(tagName string) *DeleteTagOptions { return _options } +// SetTransactionID : Allow user to set TransactionID +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 @@ -994,7 +1053,7 @@ type DeleteTagResultsItem struct { // The provider of the tag. Provider *string `json:"provider,omitempty"` - // It is `true` if the operation exits with an error. + // It is `true` if the operation exits with an error (for example, the tag does not exist). IsError *bool `json:"is_error,omitempty"` // Allows users to set arbitrary properties @@ -1016,6 +1075,14 @@ func (o *DeleteTagResultsItem) SetProperty(key string, value interface{}) { o.additionalProperties[key] = value } +// SetProperties allows the user to set a map of arbitrary properties on an instance of DeleteTagResultsItem +func (o *DeleteTagResultsItem) SetProperties(m map[string]interface{}) { + o.additionalProperties = make(map[string]interface{}) + for k, v := range m { + o.additionalProperties[k] = v + } +} + // GetProperty allows the user to retrieve an arbitrary property from an instance of DeleteTagResultsItem func (o *DeleteTagResultsItem) GetProperty(key string) interface{} { return o.additionalProperties[key] @@ -1070,7 +1137,7 @@ func UnmarshalDeleteTagResultsItem(m map[string]json.RawMessage, result interfac return } -// DeleteTagsResult : Results of a deleting unattatched tags. +// DeleteTagsResult : Results of deleting unattatched tags. type DeleteTagsResult struct { // The number of tags that have been deleted. TotalCount *int64 `json:"total_count,omitempty"` @@ -1127,25 +1194,29 @@ func UnmarshalDeleteTagsResultItem(m map[string]json.RawMessage, result interfac // DetachTagOptions : The DetachTag options. type DetachTagOptions struct { - // List of resources on which the tag or tags should be detached. - Resources []Resource `validate:"required"` + // List of resources on which the tag or tags are detached. + Resources []Resource `json:"resources" validate:"required"` // The name of the tag to detach. - TagName *string + TagName *string `json:"tag_name,omitempty"` // An array of tag names to detach. - TagNames []string + TagNames []string `json:"tag_names,omitempty"` + + // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically + // generated with the prefix "gst-". + TransactionID *string `json:"transaction-id,omitempty"` // The user on whose behalf the detach operation must be performed (_for administrators only_). - ImpersonateUser *string + ImpersonateUser *string `json:"impersonate_user,omitempty"` - // The ID of the billing account where the resources to be un-tagged lives. It is a required parameter if `tag_type` is - // set to `service`, otherwise it is inferred from the authorization IAM token. - AccountID *string + // 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"` // The type of the tag. Supported values are `user`, `service` and `access`. `service` and `access` are not supported // for IMS resources. - TagType *string + TagType *string `json:"tag_type,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -1185,6 +1256,12 @@ func (_options *DetachTagOptions) SetTagNames(tagNames []string) *DetachTagOptio return _options } +// SetTransactionID : Allow user to set TransactionID +func (_options *DetachTagOptions) SetTransactionID(transactionID string) *DetachTagOptions { + _options.TransactionID = core.StringPtr(transactionID) + return _options +} + // SetImpersonateUser : Allow user to set ImpersonateUser func (_options *DetachTagOptions) SetImpersonateUser(impersonateUser string) *DetachTagOptions { _options.ImpersonateUser = core.StringPtr(impersonateUser) @@ -1211,47 +1288,51 @@ func (options *DetachTagOptions) SetHeaders(param map[string]string) *DetachTagO // ListTagsOptions : The ListTags options. type ListTagsOptions struct { + // An alphanumeric string that can be used to trace a request across services. If not specified, it automatically + // generated with the prefix "gst-". + TransactionID *string `json:"transaction-id,omitempty"` + // The user on whose behalf the get operation must be performed (_for administrators only_). - ImpersonateUser *string + ImpersonateUser *string `json:"impersonate_user,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 + AccountID *string `json:"account_id,omitempty"` // The type of the tag you want to list. Supported values are `user`, `service` and `access`. - TagType *string + TagType *string `json:"tag_type,omitempty"` // If set to `true`, this query returns the provider, `ghost`, `ims` or `ghost,ims`, where the tag exists and the // number of attached resources. - FullData *bool + FullData *bool `json:"full_data,omitempty"` // Select a provider. Supported values are `ghost` and `ims`. To list both Global Search and Tagging tags and // infrastructure tags, use `ghost,ims`. `service` and `access` tags can only be attached to resources that are - // onboarded to Global Search and Tagging, so you should not set this parameter when listing them. - Providers []string + // onboarded to Global Search and Tagging, so you should not set this parameter to list them. + Providers []string `json:"providers,omitempty"` - // If you want to return only the list of tags attached to a specified resource, pass the ID of the resource on this - // parameter. For resources that are onboarded to Global Search and Tagging, the resource ID is the CRN; for IMS - // resources, it is the IMS ID. When using this parameter, you must specify the appropriate provider (`ims` or + // If you want to return only the list of tags that are attached to a specified resource, pass the ID of the resource + // on this parameter. For resources that are onboarded to Global Search and Tagging, the resource ID is the CRN; for + // IMS resources, it is the IMS ID. When using this parameter, you must specify the appropriate provider (`ims` or // `ghost`). - AttachedTo *string + AttachedTo *string `json:"attached_to,omitempty"` // The offset is the index of the item from which you want to start returning data from. - Offset *int64 + Offset *int64 `json:"offset,omitempty"` // The number of tags to return. - Limit *int64 + Limit *int64 `json:"limit,omitempty"` - // The search timeout bounds the search request to be executed within the specified time value. It returns the hits - // accumulated until time runs out. - Timeout *int64 + // The timeout in milliseconds, bounds the request to run within the specified time value. It returns the accumulated + // results until time runs out. + Timeout *int64 `json:"timeout,omitempty"` // Order the output by tag name. - OrderByName *string + OrderByName *string `json:"order_by_name,omitempty"` // Filter on attached tags. If `true`, it returns only tags that are attached to one or more resources. If `false`, it // returns all tags. - AttachedOnly *bool + AttachedOnly *bool `json:"attached_only,omitempty"` // Allows users to set headers on API requests Headers map[string]string @@ -1283,6 +1364,12 @@ func (*GlobalTaggingV1) NewListTagsOptions() *ListTagsOptions { return &ListTagsOptions{} } +// SetTransactionID : Allow user to set TransactionID +func (_options *ListTagsOptions) SetTransactionID(transactionID string) *ListTagsOptions { + _options.TransactionID = core.StringPtr(transactionID) + return _options +} + // SetImpersonateUser : Allow user to set ImpersonateUser func (_options *ListTagsOptions) SetImpersonateUser(impersonateUser string) *ListTagsOptions { _options.ImpersonateUser = core.StringPtr(impersonateUser) @@ -1355,7 +1442,7 @@ func (options *ListTagsOptions) SetHeaders(param map[string]string) *ListTagsOpt return options } -// Resource : A resource that may have attached tags. +// Resource : A resource that might have tags that are attached. type Resource struct { // The CRN or IMS ID of the resource. ResourceID *string `json:"resource_id" validate:"required"` @@ -1390,7 +1477,7 @@ func UnmarshalResource(m map[string]json.RawMessage, result interface{}) (err er // Tag : A tag. type Tag struct { - // This is the name of the tag. + // The name of the tag. Name *string `json:"name" validate:"required"` } @@ -1407,7 +1494,7 @@ func UnmarshalTag(m map[string]json.RawMessage, result interface{}) (err error) // TagList : A list of tags. type TagList struct { - // Set the occurrencies of the total tags associated to this account. + // Set the occurrences of the total tags that are associated with this account. TotalCount *int64 `json:"total_count,omitempty"` // The offset at which tags are returned. diff --git a/globaltaggingv1/global_tagging_v1_suite_test.go b/globaltaggingv1/global_tagging_v1_suite_test.go index a5add71a..31a680b2 100644 --- a/globaltaggingv1/global_tagging_v1_suite_test.go +++ b/globaltaggingv1/global_tagging_v1_suite_test.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2022. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/globaltaggingv1/global_tagging_v1_test.go b/globaltaggingv1/global_tagging_v1_test.go index 8a48df27..72efe4ef 100644 --- a/globaltaggingv1/global_tagging_v1_test.go +++ b/globaltaggingv1/global_tagging_v1_test.go @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2022. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -173,6 +173,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Verify the contents of the request Expect(req.URL.EscapedPath()).To(Equal(listTagsPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -185,7 +187,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // TODO: Add check for attached_only query parameter res.Header().Set("Content-type", "application/json") res.WriteHeader(200) - fmt.Fprintf(res, `} this is not valid json {`) + fmt.Fprint(res, `} this is not valid json {`) })) }) It(`Invoke ListTags with error: Operation response processing error`, func() { @@ -198,17 +200,18 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the ListTagsOptions model listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) + listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.ImpersonateUser = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") - listTagsOptionsModel.FullData = core.BoolPtr(true) + listTagsOptionsModel.FullData = core.BoolPtr(false) listTagsOptionsModel.Providers = []string{"ghost"} listTagsOptionsModel.AttachedTo = core.StringPtr("testString") listTagsOptionsModel.Offset = core.Int64Ptr(int64(0)) listTagsOptionsModel.Limit = core.Int64Ptr(int64(1)) listTagsOptionsModel.Timeout = core.Int64Ptr(int64(0)) listTagsOptionsModel.OrderByName = core.StringPtr("asc") - listTagsOptionsModel.AttachedOnly = core.BoolPtr(true) + listTagsOptionsModel.AttachedOnly = core.BoolPtr(false) listTagsOptionsModel.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 := globalTaggingService.ListTags(listTagsOptionsModel) @@ -239,6 +242,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.URL.EscapedPath()).To(Equal(listTagsPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -269,17 +274,18 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the ListTagsOptions model listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) + listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.ImpersonateUser = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") - listTagsOptionsModel.FullData = core.BoolPtr(true) + listTagsOptionsModel.FullData = core.BoolPtr(false) listTagsOptionsModel.Providers = []string{"ghost"} listTagsOptionsModel.AttachedTo = core.StringPtr("testString") listTagsOptionsModel.Offset = core.Int64Ptr(int64(0)) listTagsOptionsModel.Limit = core.Int64Ptr(int64(1)) listTagsOptionsModel.Timeout = core.Int64Ptr(int64(0)) listTagsOptionsModel.OrderByName = core.StringPtr("asc") - listTagsOptionsModel.AttachedOnly = core.BoolPtr(true) + listTagsOptionsModel.AttachedOnly = core.BoolPtr(false) listTagsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with a Context to test a timeout error @@ -316,6 +322,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.URL.EscapedPath()).To(Equal(listTagsPath)) Expect(req.Method).To(Equal("GET")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -348,17 +356,18 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the ListTagsOptions model listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) + listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.ImpersonateUser = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") - listTagsOptionsModel.FullData = core.BoolPtr(true) + listTagsOptionsModel.FullData = core.BoolPtr(false) listTagsOptionsModel.Providers = []string{"ghost"} listTagsOptionsModel.AttachedTo = core.StringPtr("testString") listTagsOptionsModel.Offset = core.Int64Ptr(int64(0)) listTagsOptionsModel.Limit = core.Int64Ptr(int64(1)) listTagsOptionsModel.Timeout = core.Int64Ptr(int64(0)) listTagsOptionsModel.OrderByName = core.StringPtr("asc") - listTagsOptionsModel.AttachedOnly = core.BoolPtr(true) + listTagsOptionsModel.AttachedOnly = core.BoolPtr(false) listTagsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with valid options model (positive test) @@ -378,17 +387,18 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the ListTagsOptions model listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) + listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.ImpersonateUser = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") - listTagsOptionsModel.FullData = core.BoolPtr(true) + listTagsOptionsModel.FullData = core.BoolPtr(false) listTagsOptionsModel.Providers = []string{"ghost"} listTagsOptionsModel.AttachedTo = core.StringPtr("testString") listTagsOptionsModel.Offset = core.Int64Ptr(int64(0)) listTagsOptionsModel.Limit = core.Int64Ptr(int64(1)) listTagsOptionsModel.Timeout = core.Int64Ptr(int64(0)) listTagsOptionsModel.OrderByName = core.StringPtr("asc") - listTagsOptionsModel.AttachedOnly = core.BoolPtr(true) + listTagsOptionsModel.AttachedOnly = core.BoolPtr(false) listTagsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation with empty URL (negative test) err := globalTaggingService.SetServiceURL("") @@ -422,17 +432,18 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the ListTagsOptions model listTagsOptionsModel := new(globaltaggingv1.ListTagsOptions) + listTagsOptionsModel.TransactionID = core.StringPtr("testString") listTagsOptionsModel.ImpersonateUser = core.StringPtr("testString") listTagsOptionsModel.AccountID = core.StringPtr("testString") listTagsOptionsModel.TagType = core.StringPtr("user") - listTagsOptionsModel.FullData = core.BoolPtr(true) + listTagsOptionsModel.FullData = core.BoolPtr(false) listTagsOptionsModel.Providers = []string{"ghost"} listTagsOptionsModel.AttachedTo = core.StringPtr("testString") listTagsOptionsModel.Offset = core.Int64Ptr(int64(0)) listTagsOptionsModel.Limit = core.Int64Ptr(int64(1)) listTagsOptionsModel.Timeout = core.Int64Ptr(int64(0)) listTagsOptionsModel.OrderByName = core.StringPtr("asc") - listTagsOptionsModel.AttachedOnly = core.BoolPtr(true) + listTagsOptionsModel.AttachedOnly = core.BoolPtr(false) listTagsOptionsModel.Headers = map[string]string{"x-custom-header": "x-custom-value"} // Invoke operation @@ -458,12 +469,14 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Verify the contents of the request Expect(req.URL.EscapedPath()).To(Equal(createTagPath)) Expect(req.Method).To(Equal("POST")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"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") res.WriteHeader(200) - fmt.Fprintf(res, `} this is not valid json {`) + fmt.Fprint(res, `} this is not valid json {`) })) }) It(`Invoke CreateTag with error: Operation response processing error`, func() { @@ -478,6 +491,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel := new(globaltaggingv1.CreateTagOptions) createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.ImpersonateUser = 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"} @@ -526,6 +540,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"access"})) @@ -551,6 +567,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel := new(globaltaggingv1.CreateTagOptions) createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.ImpersonateUser = 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"} @@ -605,6 +622,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"access"})) @@ -632,6 +651,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel := new(globaltaggingv1.CreateTagOptions) createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.ImpersonateUser = 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"} @@ -655,6 +675,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel := new(globaltaggingv1.CreateTagOptions) createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.ImpersonateUser = 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"} @@ -699,6 +720,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel := new(globaltaggingv1.CreateTagOptions) createTagOptionsModel.TagNames = []string{"testString"} createTagOptionsModel.ImpersonateUser = 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"} @@ -726,13 +748,15 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Verify the contents of the request Expect(req.URL.EscapedPath()).To(Equal(deleteTagAllPath)) Expect(req.Method).To(Equal("DELETE")) + 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()["impersonate_user"]).To(Equal([]string{"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") res.WriteHeader(200) - fmt.Fprintf(res, `} this is not valid json {`) + fmt.Fprint(res, `} this is not valid json {`) })) }) It(`Invoke DeleteTagAll with error: Operation response processing error`, func() { @@ -745,6 +769,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagAllOptions model deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) + deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") @@ -779,6 +804,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.URL.EscapedPath()).To(Equal(deleteTagAllPath)) Expect(req.Method).To(Equal("DELETE")) + 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()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) @@ -803,6 +830,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagAllOptions model deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) + deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") @@ -843,6 +871,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.URL.EscapedPath()).To(Equal(deleteTagAllPath)) Expect(req.Method).To(Equal("DELETE")) + 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()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) @@ -869,6 +899,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagAllOptions model deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) + deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") @@ -892,6 +923,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagAllOptions model deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) + deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") @@ -929,6 +961,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagAllOptions model deleteTagAllOptionsModel := new(globaltaggingv1.DeleteTagAllOptions) + deleteTagAllOptionsModel.TransactionID = core.StringPtr("testString") deleteTagAllOptionsModel.Providers = core.StringPtr("ghost") deleteTagAllOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagAllOptionsModel.AccountID = core.StringPtr("testString") @@ -958,12 +991,14 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Verify the contents of the request Expect(req.URL.EscapedPath()).To(Equal(deleteTagPath)) Expect(req.Method).To(Equal("DELETE")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"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") res.WriteHeader(200) - fmt.Fprintf(res, `} this is not valid json {`) + fmt.Fprint(res, `} this is not valid json {`) })) }) It(`Invoke DeleteTag with error: Operation response processing error`, func() { @@ -977,6 +1012,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagOptions model deleteTagOptionsModel := new(globaltaggingv1.DeleteTagOptions) deleteTagOptionsModel.TagName = core.StringPtr("testString") + deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagOptionsModel.AccountID = core.StringPtr("testString") @@ -1011,6 +1047,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.URL.EscapedPath()).To(Equal(deleteTagPath)) Expect(req.Method).To(Equal("DELETE")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -1035,6 +1073,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagOptions model deleteTagOptionsModel := new(globaltaggingv1.DeleteTagOptions) deleteTagOptionsModel.TagName = core.StringPtr("testString") + deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagOptionsModel.AccountID = core.StringPtr("testString") @@ -1075,6 +1114,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(req.URL.EscapedPath()).To(Equal(deleteTagPath)) Expect(req.Method).To(Equal("DELETE")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -1101,6 +1142,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagOptions model deleteTagOptionsModel := new(globaltaggingv1.DeleteTagOptions) deleteTagOptionsModel.TagName = core.StringPtr("testString") + deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagOptionsModel.AccountID = core.StringPtr("testString") @@ -1125,6 +1167,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagOptions model deleteTagOptionsModel := new(globaltaggingv1.DeleteTagOptions) deleteTagOptionsModel.TagName = core.StringPtr("testString") + deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagOptionsModel.AccountID = core.StringPtr("testString") @@ -1170,6 +1213,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Construct an instance of the DeleteTagOptions model deleteTagOptionsModel := new(globaltaggingv1.DeleteTagOptions) deleteTagOptionsModel.TagName = core.StringPtr("testString") + deleteTagOptionsModel.TransactionID = core.StringPtr("testString") deleteTagOptionsModel.Providers = []string{"ghost"} deleteTagOptionsModel.ImpersonateUser = core.StringPtr("testString") deleteTagOptionsModel.AccountID = core.StringPtr("testString") @@ -1199,12 +1243,14 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Verify the contents of the request Expect(req.URL.EscapedPath()).To(Equal(attachTagPath)) Expect(req.Method).To(Equal("POST")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"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") res.WriteHeader(200) - fmt.Fprintf(res, `} this is not valid json {`) + fmt.Fprint(res, `} this is not valid json {`) })) }) It(`Invoke AttachTag with error: Operation response processing error`, func() { @@ -1225,6 +1271,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} attachTagOptionsModel.TagName = core.StringPtr("testString") attachTagOptionsModel.TagNames = []string{"testString"} + attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") @@ -1274,6 +1321,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -1305,6 +1354,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} attachTagOptionsModel.TagName = core.StringPtr("testString") attachTagOptionsModel.TagNames = []string{"testString"} + attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") @@ -1360,6 +1410,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -1393,6 +1445,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} attachTagOptionsModel.TagName = core.StringPtr("testString") attachTagOptionsModel.TagNames = []string{"testString"} + attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") @@ -1423,6 +1476,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} attachTagOptionsModel.TagName = core.StringPtr("testString") attachTagOptionsModel.TagNames = []string{"testString"} + attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") @@ -1474,6 +1528,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} attachTagOptionsModel.TagName = core.StringPtr("testString") attachTagOptionsModel.TagNames = []string{"testString"} + attachTagOptionsModel.TransactionID = core.StringPtr("testString") attachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") attachTagOptionsModel.AccountID = core.StringPtr("testString") attachTagOptionsModel.TagType = core.StringPtr("user") @@ -1502,12 +1557,14 @@ var _ = Describe(`GlobalTaggingV1`, func() { // Verify the contents of the request Expect(req.URL.EscapedPath()).To(Equal(detachTagPath)) Expect(req.Method).To(Equal("POST")) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"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") res.WriteHeader(200) - fmt.Fprintf(res, `} this is not valid json {`) + fmt.Fprint(res, `} this is not valid json {`) })) }) It(`Invoke DetachTag with error: Operation response processing error`, func() { @@ -1528,6 +1585,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} detachTagOptionsModel.TagName = core.StringPtr("testString") detachTagOptionsModel.TagNames = []string{"testString"} + detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") @@ -1577,6 +1635,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -1608,6 +1668,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} detachTagOptionsModel.TagName = core.StringPtr("testString") detachTagOptionsModel.TagNames = []string{"testString"} + detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") @@ -1663,6 +1724,8 @@ var _ = Describe(`GlobalTaggingV1`, func() { } fmt.Fprintf(GinkgoWriter, " Request body: %s", bodyBuf.String()) + Expect(req.Header["Transaction-Id"]).ToNot(BeNil()) + Expect(req.Header["Transaction-Id"][0]).To(Equal(fmt.Sprintf("%v", "testString"))) Expect(req.URL.Query()["impersonate_user"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["account_id"]).To(Equal([]string{"testString"})) Expect(req.URL.Query()["tag_type"]).To(Equal([]string{"user"})) @@ -1696,6 +1759,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} detachTagOptionsModel.TagName = core.StringPtr("testString") detachTagOptionsModel.TagNames = []string{"testString"} + detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") @@ -1726,6 +1790,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} detachTagOptionsModel.TagName = core.StringPtr("testString") detachTagOptionsModel.TagNames = []string{"testString"} + detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") @@ -1777,6 +1842,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.Resources = []globaltaggingv1.Resource{*resourceModel} detachTagOptionsModel.TagName = core.StringPtr("testString") detachTagOptionsModel.TagNames = []string{"testString"} + detachTagOptionsModel.TransactionID = core.StringPtr("testString") detachTagOptionsModel.ImpersonateUser = core.StringPtr("testString") detachTagOptionsModel.AccountID = core.StringPtr("testString") detachTagOptionsModel.TagType = core.StringPtr("user") @@ -1816,6 +1882,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { attachTagOptionsModel.SetResources([]globaltaggingv1.Resource{*resourceModel}) attachTagOptionsModel.SetTagName("testString") attachTagOptionsModel.SetTagNames([]string{"testString"}) + attachTagOptionsModel.SetTransactionID("testString") attachTagOptionsModel.SetImpersonateUser("testString") attachTagOptionsModel.SetAccountID("testString") attachTagOptionsModel.SetTagType("user") @@ -1824,6 +1891,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(attachTagOptionsModel.Resources).To(Equal([]globaltaggingv1.Resource{*resourceModel})) Expect(attachTagOptionsModel.TagName).To(Equal(core.StringPtr("testString"))) Expect(attachTagOptionsModel.TagNames).To(Equal([]string{"testString"})) + Expect(attachTagOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(attachTagOptionsModel.ImpersonateUser).To(Equal(core.StringPtr("testString"))) Expect(attachTagOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(attachTagOptionsModel.TagType).To(Equal(core.StringPtr("user"))) @@ -1835,12 +1903,14 @@ var _ = Describe(`GlobalTaggingV1`, func() { createTagOptionsModel := globalTaggingService.NewCreateTagOptions(createTagOptionsTagNames) createTagOptionsModel.SetTagNames([]string{"testString"}) createTagOptionsModel.SetImpersonateUser("testString") + createTagOptionsModel.SetTransactionID("testString") createTagOptionsModel.SetAccountID("testString") createTagOptionsModel.SetTagType("access") createTagOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(createTagOptionsModel).ToNot(BeNil()) Expect(createTagOptionsModel.TagNames).To(Equal([]string{"testString"})) Expect(createTagOptionsModel.ImpersonateUser).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"})) @@ -1848,12 +1918,14 @@ var _ = Describe(`GlobalTaggingV1`, func() { It(`Invoke NewDeleteTagAllOptions successfully`, func() { // Construct an instance of the DeleteTagAllOptions model deleteTagAllOptionsModel := globalTaggingService.NewDeleteTagAllOptions() + deleteTagAllOptionsModel.SetTransactionID("testString") deleteTagAllOptionsModel.SetProviders("ghost") deleteTagAllOptionsModel.SetImpersonateUser("testString") deleteTagAllOptionsModel.SetAccountID("testString") deleteTagAllOptionsModel.SetTagType("user") deleteTagAllOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(deleteTagAllOptionsModel).ToNot(BeNil()) + Expect(deleteTagAllOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(deleteTagAllOptionsModel.Providers).To(Equal(core.StringPtr("ghost"))) Expect(deleteTagAllOptionsModel.ImpersonateUser).To(Equal(core.StringPtr("testString"))) Expect(deleteTagAllOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) @@ -1865,6 +1937,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { tagName := "testString" deleteTagOptionsModel := globalTaggingService.NewDeleteTagOptions(tagName) deleteTagOptionsModel.SetTagName("testString") + deleteTagOptionsModel.SetTransactionID("testString") deleteTagOptionsModel.SetProviders([]string{"ghost"}) deleteTagOptionsModel.SetImpersonateUser("testString") deleteTagOptionsModel.SetAccountID("testString") @@ -1872,6 +1945,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { deleteTagOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(deleteTagOptionsModel).ToNot(BeNil()) Expect(deleteTagOptionsModel.TagName).To(Equal(core.StringPtr("testString"))) + Expect(deleteTagOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(deleteTagOptionsModel.Providers).To(Equal([]string{"ghost"})) Expect(deleteTagOptionsModel.ImpersonateUser).To(Equal(core.StringPtr("testString"))) Expect(deleteTagOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) @@ -1893,6 +1967,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { detachTagOptionsModel.SetResources([]globaltaggingv1.Resource{*resourceModel}) detachTagOptionsModel.SetTagName("testString") detachTagOptionsModel.SetTagNames([]string{"testString"}) + detachTagOptionsModel.SetTransactionID("testString") detachTagOptionsModel.SetImpersonateUser("testString") detachTagOptionsModel.SetAccountID("testString") detachTagOptionsModel.SetTagType("user") @@ -1901,6 +1976,7 @@ var _ = Describe(`GlobalTaggingV1`, func() { Expect(detachTagOptionsModel.Resources).To(Equal([]globaltaggingv1.Resource{*resourceModel})) Expect(detachTagOptionsModel.TagName).To(Equal(core.StringPtr("testString"))) Expect(detachTagOptionsModel.TagNames).To(Equal([]string{"testString"})) + Expect(detachTagOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(detachTagOptionsModel.ImpersonateUser).To(Equal(core.StringPtr("testString"))) Expect(detachTagOptionsModel.AccountID).To(Equal(core.StringPtr("testString"))) Expect(detachTagOptionsModel.TagType).To(Equal(core.StringPtr("user"))) @@ -1909,30 +1985,32 @@ var _ = Describe(`GlobalTaggingV1`, func() { It(`Invoke NewListTagsOptions successfully`, func() { // Construct an instance of the ListTagsOptions model listTagsOptionsModel := globalTaggingService.NewListTagsOptions() + listTagsOptionsModel.SetTransactionID("testString") listTagsOptionsModel.SetImpersonateUser("testString") listTagsOptionsModel.SetAccountID("testString") listTagsOptionsModel.SetTagType("user") - listTagsOptionsModel.SetFullData(true) + listTagsOptionsModel.SetFullData(false) listTagsOptionsModel.SetProviders([]string{"ghost"}) listTagsOptionsModel.SetAttachedTo("testString") listTagsOptionsModel.SetOffset(int64(0)) listTagsOptionsModel.SetLimit(int64(1)) listTagsOptionsModel.SetTimeout(int64(0)) listTagsOptionsModel.SetOrderByName("asc") - listTagsOptionsModel.SetAttachedOnly(true) + listTagsOptionsModel.SetAttachedOnly(false) listTagsOptionsModel.SetHeaders(map[string]string{"foo": "bar"}) Expect(listTagsOptionsModel).ToNot(BeNil()) + Expect(listTagsOptionsModel.TransactionID).To(Equal(core.StringPtr("testString"))) Expect(listTagsOptionsModel.ImpersonateUser).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(true))) + Expect(listTagsOptionsModel.FullData).To(Equal(core.BoolPtr(false))) Expect(listTagsOptionsModel.Providers).To(Equal([]string{"ghost"})) Expect(listTagsOptionsModel.AttachedTo).To(Equal(core.StringPtr("testString"))) Expect(listTagsOptionsModel.Offset).To(Equal(core.Int64Ptr(int64(0)))) Expect(listTagsOptionsModel.Limit).To(Equal(core.Int64Ptr(int64(1)))) Expect(listTagsOptionsModel.Timeout).To(Equal(core.Int64Ptr(int64(0)))) Expect(listTagsOptionsModel.OrderByName).To(Equal(core.StringPtr("asc"))) - Expect(listTagsOptionsModel.AttachedOnly).To(Equal(core.BoolPtr(true))) + Expect(listTagsOptionsModel.AttachedOnly).To(Equal(core.BoolPtr(false))) Expect(listTagsOptionsModel.Headers).To(Equal(map[string]string{"foo": "bar"})) }) It(`Invoke NewResource successfully`, func() { From 0af3685a7e6ef91e994b4637b9aa6d26610c3aa6 Mon Sep 17 00:00:00 2001 From: Fabrizio Leoni Date: Thu, 12 Jan 2023 15:11:44 +0100 Subject: [PATCH 2/2] Upd_1210 --- globalsearchv2/global_search_v2.go | 10 +++++++--- globalsearchv2/global_search_v2_suite_test.go | 2 +- globalsearchv2/global_search_v2_test.go | 2 +- globaltaggingv1/global_tagging_v1.go | 4 ++-- globaltaggingv1/global_tagging_v1_suite_test.go | 2 +- globaltaggingv1/global_tagging_v1_test.go | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/globalsearchv2/global_search_v2.go b/globalsearchv2/global_search_v2.go index 8946f5e6..d025a888 100644 --- a/globalsearchv2/global_search_v2.go +++ b/globalsearchv2/global_search_v2.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. @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.62.2-e5d4c32b-20221214-193750 + * IBM OpenAPI SDK Code Generator Version: 3.63.0-5dae26c1-20230111-193039 */ // Package globalsearchv2 : Operations and models for the GlobalSearchV2 service @@ -47,6 +47,9 @@ type GlobalSearchV2 struct { Service *core.BaseService } +// DefaultServiceURL is the default URL to make service requests to. +const DefaultServiceURL = "https://api.global-search-tagging.cloud.ibm.com" + // DefaultServiceName is the default key used to find external configuration information. const DefaultServiceName = "global_search" @@ -89,6 +92,7 @@ func NewGlobalSearchV2UsingExternalConfig(options *GlobalSearchV2Options) (globa // NewGlobalSearchV2 : constructs an instance of GlobalSearchV2 with passed in options. func NewGlobalSearchV2(options *GlobalSearchV2Options) (service *GlobalSearchV2, err error) { serviceOptions := &core.ServiceOptions{ + URL: DefaultServiceURL, Authenticator: options.Authenticator, } @@ -434,7 +438,7 @@ type ScanResult struct { SearchCursor *string `json:"search_cursor,omitempty"` // Value of the limit parameter specified by the user. - Limit *float64 `json:"limit" validate:"required"` + Limit *int64 `json:"limit" validate:"required"` // The array of results. Each item represents a resource. An empty array signals the end of the result set, which means // there are no more results to fetch. diff --git a/globalsearchv2/global_search_v2_suite_test.go b/globalsearchv2/global_search_v2_suite_test.go index 77a8e2a8..7a297ab5 100644 --- a/globalsearchv2/global_search_v2_suite_test.go +++ b/globalsearchv2/global_search_v2_suite_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. diff --git a/globalsearchv2/global_search_v2_test.go b/globalsearchv2/global_search_v2_test.go index 73f7f3a7..fb5b3abc 100644 --- a/globalsearchv2/global_search_v2_test.go +++ b/globalsearchv2/global_search_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. diff --git a/globaltaggingv1/global_tagging_v1.go b/globaltaggingv1/global_tagging_v1.go index aa0dffb1..ee86b2b8 100644 --- a/globaltaggingv1/global_tagging_v1.go +++ b/globaltaggingv1/global_tagging_v1.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. @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.62.2-e5d4c32b-20221214-193750 + * IBM OpenAPI SDK Code Generator Version: 3.63.0-5dae26c1-20230111-193039 */ // Package globaltaggingv1 : Operations and models for the GlobalTaggingV1 service diff --git a/globaltaggingv1/global_tagging_v1_suite_test.go b/globaltaggingv1/global_tagging_v1_suite_test.go index 31a680b2..73ecbe0a 100644 --- a/globaltaggingv1/global_tagging_v1_suite_test.go +++ b/globaltaggingv1/global_tagging_v1_suite_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. diff --git a/globaltaggingv1/global_tagging_v1_test.go b/globaltaggingv1/global_tagging_v1_test.go index 72efe4ef..9fb2832a 100644 --- a/globaltaggingv1/global_tagging_v1_test.go +++ b/globaltaggingv1/global_tagging_v1_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.