// Update Confluent account returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "confluent_account" in the systemConfluentAccountDataAttributesAPIKey:=os.Getenv("CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY")ConfluentAccountDataID:=os.Getenv("CONFLUENT_ACCOUNT_DATA_ID")body:=datadogV2.ConfluentAccountUpdateRequest{Data:datadogV2.ConfluentAccountUpdateRequestData{Attributes:datadogV2.ConfluentAccountUpdateRequestAttributes{ApiKey:ConfluentAccountDataAttributesAPIKey,ApiSecret:"update-secret",Tags:[]string{"updated_tag:val",},},Type:datadogV2.CONFLUENTACCOUNTTYPE_CONFLUENT_CLOUD_ACCOUNTS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewConfluentCloudApi(apiClient)resp,r,err:=api.UpdateConfluentAccount(ctx,ConfluentAccountDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ConfluentCloudApi.UpdateConfluentAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `ConfluentCloudApi.UpdateConfluentAccount`:\n%s\n",responseContent)}
// Update Confluent account returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.ConfluentCloudApi;importcom.datadog.api.client.v2.model.ConfluentAccountResponse;importcom.datadog.api.client.v2.model.ConfluentAccountType;importcom.datadog.api.client.v2.model.ConfluentAccountUpdateRequest;importcom.datadog.api.client.v2.model.ConfluentAccountUpdateRequestAttributes;importcom.datadog.api.client.v2.model.ConfluentAccountUpdateRequestData;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();ConfluentCloudApiapiInstance=newConfluentCloudApi(defaultClient);// there is a valid "confluent_account" in the systemStringCONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY=System.getenv("CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY");StringCONFLUENT_ACCOUNT_DATA_ID=System.getenv("CONFLUENT_ACCOUNT_DATA_ID");ConfluentAccountUpdateRequestbody=newConfluentAccountUpdateRequest().data(newConfluentAccountUpdateRequestData().attributes(newConfluentAccountUpdateRequestAttributes().apiKey(CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY).apiSecret("update-secret").tags(Collections.singletonList("updated_tag:val"))).type(ConfluentAccountType.CONFLUENT_CLOUD_ACCOUNTS));try{ConfluentAccountResponseresult=apiInstance.updateConfluentAccount(CONFLUENT_ACCOUNT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling ConfluentCloudApi#updateConfluentAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update Confluent account returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.confluent_cloud_apiimportConfluentCloudApifromdatadog_api_client.v2.model.confluent_account_typeimportConfluentAccountTypefromdatadog_api_client.v2.model.confluent_account_update_requestimportConfluentAccountUpdateRequestfromdatadog_api_client.v2.model.confluent_account_update_request_attributesimport(ConfluentAccountUpdateRequestAttributes,)fromdatadog_api_client.v2.model.confluent_account_update_request_dataimportConfluentAccountUpdateRequestData# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY=environ["CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY"]CONFLUENT_ACCOUNT_DATA_ID=environ["CONFLUENT_ACCOUNT_DATA_ID"]body=ConfluentAccountUpdateRequest(data=ConfluentAccountUpdateRequestData(attributes=ConfluentAccountUpdateRequestAttributes(api_key=CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY,api_secret="update-secret",tags=["updated_tag:val",],),type=ConfluentAccountType.CONFLUENT_CLOUD_ACCOUNTS,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=ConfluentCloudApi(api_client)response=api_instance.update_confluent_account(account_id=CONFLUENT_ACCOUNT_DATA_ID,body=body)print(response)
# Update Confluent account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::ConfluentCloudAPI.new# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY=ENV["CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY"]CONFLUENT_ACCOUNT_DATA_ID=ENV["CONFLUENT_ACCOUNT_DATA_ID"]body=DatadogAPIClient::V2::ConfluentAccountUpdateRequest.new({data:DatadogAPIClient::V2::ConfluentAccountUpdateRequestData.new({attributes:DatadogAPIClient::V2::ConfluentAccountUpdateRequestAttributes.new({api_key:CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY,api_secret:"update-secret",tags:["updated_tag:val",],}),type:DatadogAPIClient::V2::ConfluentAccountType::CONFLUENT_CLOUD_ACCOUNTS,}),})papi_instance.update_confluent_account(CONFLUENT_ACCOUNT_DATA_ID,body)
// Update Confluent account returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_confluent_cloud::ConfluentCloudAPI;usedatadog_api_client::datadogV2::model::ConfluentAccountType;usedatadog_api_client::datadogV2::model::ConfluentAccountUpdateRequest;usedatadog_api_client::datadogV2::model::ConfluentAccountUpdateRequestAttributes;usedatadog_api_client::datadogV2::model::ConfluentAccountUpdateRequestData;#[tokio::main]asyncfnmain(){// there is a valid "confluent_account" in the system
letconfluent_account_data_attributes_api_key=std::env::var("CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY").unwrap();letconfluent_account_data_id=std::env::var("CONFLUENT_ACCOUNT_DATA_ID").unwrap();letbody=ConfluentAccountUpdateRequest::new(ConfluentAccountUpdateRequestData::new(ConfluentAccountUpdateRequestAttributes::new(confluent_account_data_attributes_api_key.clone(),"update-secret".to_string(),).tags(vec!["updated_tag:val".to_string()]),ConfluentAccountType::CONFLUENT_CLOUD_ACCOUNTS,));letconfiguration=datadog::Configuration::new();letapi=ConfluentCloudAPI::with_config(configuration);letresp=api.update_confluent_account(confluent_account_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Update Confluent account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.ConfluentCloudApi(configuration);// there is a valid "confluent_account" in the system
constCONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY=process.env.CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEYasstring;constCONFLUENT_ACCOUNT_DATA_ID=process.env.CONFLUENT_ACCOUNT_DATA_IDasstring;constparams: v2.ConfluentCloudApiUpdateConfluentAccountRequest={body:{data:{attributes:{apiKey: CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY,apiSecret:"update-secret",tags:["updated_tag:val"],},type:"confluent-cloud-accounts",},},accountId: CONFLUENT_ACCOUNT_DATA_ID,};apiInstance.updateConfluentAccount(params).then((data: v2.ConfluentAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));