/// <summary> /// Create a new developer certificate to connect to the bootstrap server. This REST API is intended to be used by customers to get a developer certificate (a certificate that can be flashed into multiple devices to connect to bootstrap server). **Note:** The number of developer certificates allowed per account is limited. Please see [Using your own certificate authority](/docs/v1.2/mbed-cloud-deploy/instructions-for-factory-setup-and-device-provision.html#using-your-own-certificate-authority-with-mbed-cloud). **Example usage:** curl -X POST \"http://api.us-east-1.mbedcloud.com/v3/developer-certificates\" -H \"accept: application/json\" -H \"Authorization: Bearer THE_ACCESS_TOKEN\" -H \"content-type: application/json\" -d \"{ \\\"name\\\": \\\"THE_CERTIFICATE_NAME\\\", \\\"description\\\": \\\"THE_CERTIFICATE_DESCRIPTION\\\"}\" /// </summary> /// <exception cref="connector_ca.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="authorization">Bearer {Access Token}. </param> /// <param name="body"></param> /// <returns>Task of DeveloperCertificateResponseData</returns> public async System.Threading.Tasks.Task <DeveloperCertificateResponseData> CreateDeveloperCertificateAsync(string authorization, DeveloperCertificateRequestData body) { ApiResponse <DeveloperCertificateResponseData> localVarResponse = await CreateDeveloperCertificateAsyncWithHttpInfo(authorization, body); return(localVarResponse.Data); }
/// <summary> /// Create a new developer certificate to connect to the bootstrap server. This REST API is intended to be used by customers to get a developer certificate (a certificate that can be flashed into multiple devices to connect to bootstrap server). **Note:** The number of developer certificates allowed per account is limited. Please see [Using your own certificate authority](/docs/v1.2/mbed-cloud-deploy/instructions-for-factory-setup-and-device-provision.html#using-your-own-certificate-authority-with-mbed-cloud). **Example usage:** curl -X POST \"http://api.us-east-1.mbedcloud.com/v3/developer-certificates\" -H \"accept: application/json\" -H \"Authorization: Bearer THE_ACCESS_TOKEN\" -H \"content-type: application/json\" -d \"{ \\\"name\\\": \\\"THE_CERTIFICATE_NAME\\\", \\\"description\\\": \\\"THE_CERTIFICATE_DESCRIPTION\\\"}\" /// </summary> /// <exception cref="connector_ca.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="authorization">Bearer {Access Token}. </param> /// <param name="body"></param> /// <returns>Task of ApiResponse (DeveloperCertificateResponseData)</returns> public async System.Threading.Tasks.Task <ApiResponse <DeveloperCertificateResponseData> > CreateDeveloperCertificateAsyncWithHttpInfo(string authorization, DeveloperCertificateRequestData body) { // verify the required parameter 'authorization' is set if (authorization == null) { throw new ApiException(400, "Missing required parameter 'authorization' when calling DeveloperCertificateApi->CreateDeveloperCertificate"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling DeveloperCertificateApi->CreateDeveloperCertificate"); } var localVarPath = "/v3/developer-certificates"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (authorization != null) { localVarHeaderParams.Add("Authorization", Configuration.ApiClient.ParameterToString(authorization)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // authentication (Bearer) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarHeaderParams["Authorization"] = Configuration.GetApiKeyWithPrefix("Authorization"); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("CreateDeveloperCertificate", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <DeveloperCertificateResponseData>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (DeveloperCertificateResponseData)Configuration.ApiClient.Deserialize(localVarResponse, typeof(DeveloperCertificateResponseData)))); }
/// <summary> /// Create a new developer certificate to connect to the bootstrap server. This REST API is intended to be used by customers to get a developer certificate (a certificate that can be flashed into multiple devices to connect to bootstrap server). **Note:** The number of developer certificates allowed per account is limited. Please see [Using your own certificate authority](/docs/v1.2/mbed-cloud-deploy/instructions-for-factory-setup-and-device-provision.html#using-your-own-certificate-authority-with-mbed-cloud). **Example usage:** curl -X POST \"http://api.us-east-1.mbedcloud.com/v3/developer-certificates\" -H \"accept: application/json\" -H \"Authorization: Bearer THE_ACCESS_TOKEN\" -H \"content-type: application/json\" -d \"{ \\\"name\\\": \\\"THE_CERTIFICATE_NAME\\\", \\\"description\\\": \\\"THE_CERTIFICATE_DESCRIPTION\\\"}\" /// </summary> /// <exception cref="connector_ca.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="authorization">Bearer {Access Token}. </param> /// <param name="body"></param> /// <returns>DeveloperCertificateResponseData</returns> public DeveloperCertificateResponseData CreateDeveloperCertificate(string authorization, DeveloperCertificateRequestData body) { ApiResponse <DeveloperCertificateResponseData> localVarResponse = CreateDeveloperCertificateWithHttpInfo(authorization, body); return(localVarResponse.Data); }