lib/v20210331/client.rb in tencentcloud-sdk-organization-3.0.661 vs lib/v20210331/client.rb in tencentcloud-sdk-organization-3.0.662

- old
+ new

@@ -123,10 +123,34 @@ raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end + # 创建企业组织 + + # @param request: Request instance for CreateOrganization. + # @type request: :class:`Tencentcloud::organization::V20210331::CreateOrganizationRequest` + # @rtype: :class:`Tencentcloud::organization::V20210331::CreateOrganizationResponse` + def CreateOrganization(request) + body = send_request('CreateOrganization', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = CreateOrganizationResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + # 创建组织成员 # @param request: Request instance for CreateOrganizationMember. # @type request: :class:`Tencentcloud::organization::V20210331::CreateOrganizationMemberRequest` # @rtype: :class:`Tencentcloud::organization::V20210331::CreateOrganizationMemberResponse` @@ -181,9 +205,33 @@ def CreateOrganizationMemberPolicy(request) body = send_request('CreateOrganizationMemberPolicy', request.serialize) response = JSON.parse(body) if response['Response'].key?('Error') == false model = CreateOrganizationMemberPolicyResponse.new + model.deserialize(response['Response']) + model + else + code = response['Response']['Error']['Code'] + message = response['Response']['Error']['Message'] + reqid = response['Response']['RequestId'] + raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid) + end + rescue TencentCloud::Common::TencentCloudSDKException => e + raise e + rescue StandardError => e + raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) + end + + # 删除企业组织 + + # @param request: Request instance for DeleteOrganization. + # @type request: :class:`Tencentcloud::organization::V20210331::DeleteOrganizationRequest` + # @rtype: :class:`Tencentcloud::organization::V20210331::DeleteOrganizationResponse` + def DeleteOrganization(request) + body = send_request('DeleteOrganization', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = DeleteOrganizationResponse.new model.deserialize(response['Response']) model else code = response['Response']['Error']['Code'] message = response['Response']['Error']['Message'] \ No newline at end of file