/// <summary> /// Download a Theme Downloads a stores *Theme*. /// </summary> /// <exception cref="Themes.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body"></param> /// <param name="accept"></param> /// <param name="contentType"></param> /// <param name="uuid">The theme identifier.</param> /// <returns>Task of JobId</returns> public async System.Threading.Tasks.Task <JobId> DownloadThemeAsync(WhichThemeToDownload body, string accept, string contentType, string uuid) { ApiResponse <JobId> localVarResponse = await DownloadThemeAsyncWithHttpInfo(body, accept, contentType, uuid); return(localVarResponse.Data); }
/// <summary> /// Download a Theme Downloads a stores *Theme*. /// </summary> /// <exception cref="Themes.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body"></param> /// <param name="accept"></param> /// <param name="contentType"></param> /// <param name="uuid">The theme identifier.</param> /// <returns>Task of ApiResponse (JobId)</returns> public async System.Threading.Tasks.Task <ApiResponse <JobId> > DownloadThemeAsyncWithHttpInfo(WhichThemeToDownload body, string accept, string contentType, string uuid) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling ThemeActionsApi->DownloadTheme"); } // verify the required parameter 'accept' is set if (accept == null) { throw new ApiException(400, "Missing required parameter 'accept' when calling ThemeActionsApi->DownloadTheme"); } // verify the required parameter 'contentType' is set if (contentType == null) { throw new ApiException(400, "Missing required parameter 'contentType' when calling ThemeActionsApi->DownloadTheme"); } // verify the required parameter 'uuid' is set if (uuid == null) { throw new ApiException(400, "Missing required parameter 'uuid' when calling ThemeActionsApi->DownloadTheme"); } var localVarPath = "/themes/{uuid}/actions/download"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(this.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[] { "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (uuid != null) { localVarPathParams.Add("uuid", this.Configuration.ApiClient.ParameterToString(uuid)); // path parameter } if (accept != null) { localVarHeaderParams.Add("Accept", this.Configuration.ApiClient.ParameterToString(accept)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", this.Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // authentication (X-Auth-Token) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("X-Auth-Token"))) { localVarHeaderParams["X-Auth-Token"] = this.Configuration.GetApiKeyWithPrefix("X-Auth-Token"); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("DownloadTheme", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <JobId>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), (JobId)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(JobId)))); }
/// <summary> /// Download a Theme Downloads a stores *Theme*. /// </summary> /// <exception cref="Themes.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body"></param> /// <param name="accept"></param> /// <param name="contentType"></param> /// <param name="uuid">The theme identifier.</param> /// <returns>JobId</returns> public JobId DownloadTheme(WhichThemeToDownload body, string accept, string contentType, string uuid) { ApiResponse <JobId> localVarResponse = DownloadThemeWithHttpInfo(body, accept, contentType, uuid); return(localVarResponse.Data); }