From a7070ad92408a16524ea4a069a648747be08f129 Mon Sep 17 00:00:00 2001 From: namratabhadauriya Date: Thu, 25 Apr 2024 01:09:47 +0530 Subject: [PATCH 1/2] fixed wrong sdk generated previoulsy Signed-off-by: namratabhadauriya --- .../enterprise_management_v1.go | 19 +++++++++++++++++-- .../enterprise_management_v1_test.go | 5 ++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/enterprisemanagementv1/enterprise_management_v1.go b/enterprisemanagementv1/enterprise_management_v1.go index dcc8b005..d22d1399 100644 --- a/enterprisemanagementv1/enterprise_management_v1.go +++ b/enterprisemanagementv1/enterprise_management_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.87.0-91c7c775-20240320-213027 + * IBM OpenAPI SDK Code Generator Version: 3.89.1-ed9d96f4-20240417-193115 */ // Package enterprisemanagementv1 : Operations and models for the EnterpriseManagementV1 service @@ -1743,7 +1743,7 @@ func (options *CreateAccountOptions) SetHeaders(param map[string]string) *Create } // CreateAccountRequestOptions : The options object can be used to set properties on child accounts of an enterprise. You can pass a field to to -// create IAM service id with IAM api key when creating a child account in the enterprise. This is an optional field. +// create IAM service id with IAM api keyg when creating a child account in the enterprise. This is an optional field. type CreateAccountRequestOptions struct { // By default create_iam_service_id_with_apikey_and_owner_policies is turned off for a newly created child account. You // can enable this property by passing 'true' in this boolean field. IAM service id has account owner IAM policies and @@ -1818,6 +1818,21 @@ func UnmarshalCreateAccountResponse(m map[string]json.RawMessage, result interfa err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "iam_service_id", &obj.IamServiceID) + if err != nil { + err = core.SDKErrorf(err, "", "iam_service_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "iam_apikey_id", &obj.IamApikeyID) + if err != nil { + err = core.SDKErrorf(err, "", "iam_apikey_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "iam_apikey", &obj.IamApikey) + if err != nil { + err = core.SDKErrorf(err, "", "iam_apikey-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } diff --git a/enterprisemanagementv1/enterprise_management_v1_test.go b/enterprisemanagementv1/enterprise_management_v1_test.go index a6e1d61b..f9d6a186 100644 --- a/enterprisemanagementv1/enterprise_management_v1_test.go +++ b/enterprisemanagementv1/enterprise_management_v1_test.go @@ -1247,7 +1247,7 @@ var _ = Describe(`EnterpriseManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(202) - fmt.Fprintf(res, "%s", `{"account_id": "AccountID"}`) + fmt.Fprintf(res, "%s", `{"account_id": "AccountID", "iam_service_id": "IamServiceID", "iam_apikey_id": "IamApikeyID", "iam_apikey": "IamApikey"}`) })) }) It(`Invoke CreateAccount successfully with retries`, func() { @@ -1330,7 +1330,7 @@ var _ = Describe(`EnterpriseManagementV1`, func() { // Set mock response res.Header().Set("Content-type", "application/json") res.WriteHeader(202) - fmt.Fprintf(res, "%s", `{"account_id": "AccountID"}`) + fmt.Fprintf(res, "%s", `{"account_id": "AccountID", "iam_service_id": "IamServiceID", "iam_apikey_id": "IamApikeyID", "iam_apikey": "IamApikey"}`) })) }) It(`Invoke CreateAccount successfully`, func() { @@ -3435,7 +3435,6 @@ var _ = Describe(`EnterpriseManagementV1`, func() { Expect(result).To(Equal(model)) }) }) - Describe(`Utility function tests`, func() { It(`Invoke CreateMockByteArray() successfully`, func() { mockByteArray := CreateMockByteArray("This is a test") From 0b4bd0acf03fd0a0f0ea471e78e95c6979c49018 Mon Sep 17 00:00:00 2001 From: namratabhadauriya Date: Thu, 25 Apr 2024 01:18:38 +0530 Subject: [PATCH 2/2] minor fix Signed-off-by: namratabhadauriya --- enterprisemanagementv1/enterprise_management_v1.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enterprisemanagementv1/enterprise_management_v1.go b/enterprisemanagementv1/enterprise_management_v1.go index d22d1399..78a74c9f 100644 --- a/enterprisemanagementv1/enterprise_management_v1.go +++ b/enterprisemanagementv1/enterprise_management_v1.go @@ -1743,7 +1743,7 @@ func (options *CreateAccountOptions) SetHeaders(param map[string]string) *Create } // CreateAccountRequestOptions : The options object can be used to set properties on child accounts of an enterprise. You can pass a field to to -// create IAM service id with IAM api keyg when creating a child account in the enterprise. This is an optional field. +// create IAM service id with IAM api key when creating a child account in the enterprise. This is an optional field. type CreateAccountRequestOptions struct { // By default create_iam_service_id_with_apikey_and_owner_policies is turned off for a newly created child account. You // can enable this property by passing 'true' in this boolean field. IAM service id has account owner IAM policies and