/// <summary> /// /// </summary> /// <exception cref="Flipdish.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="storeId"></param> /// <param name="lightspeedSettings"></param> /// <returns>Task of RestApiResultLightspeedSettings</returns> public async System.Threading.Tasks.Task <RestApiResultLightspeedSettings> LightspeedSaveStoreSettingsAsync(int?storeId, LightspeedSettings lightspeedSettings) { ApiResponse <RestApiResultLightspeedSettings> localVarResponse = await LightspeedSaveStoreSettingsAsyncWithHttpInfo(storeId, lightspeedSettings); return(localVarResponse.Data); }
/// <summary> /// /// </summary> /// <exception cref="Flipdish.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="storeId"></param> /// <param name="lightspeedSettings"></param> /// <returns>Task of ApiResponse (RestApiResultLightspeedSettings)</returns> public async System.Threading.Tasks.Task <ApiResponse <RestApiResultLightspeedSettings> > LightspeedSaveStoreSettingsAsyncWithHttpInfo(int?storeId, LightspeedSettings lightspeedSettings) { // verify the required parameter 'storeId' is set if (storeId == null) { throw new ApiException(400, "Missing required parameter 'storeId' when calling LightspeedApi->LightspeedSaveStoreSettings"); } // verify the required parameter 'lightspeedSettings' is set if (lightspeedSettings == null) { throw new ApiException(400, "Missing required parameter 'lightspeedSettings' when calling LightspeedApi->LightspeedSaveStoreSettings"); } var localVarPath = "/api/v1.0/lightspeed/{storeId}/settings"; 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", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "application/xml", "text/xml" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (storeId != null) { localVarPathParams.Add("storeId", this.Configuration.ApiClient.ParameterToString(storeId)); // path parameter } if (lightspeedSettings != null && lightspeedSettings.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(lightspeedSettings); // http body (model) parameter } else { localVarPostBody = lightspeedSettings; // byte array } // authentication (oauth2) required // oauth required if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) { localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; } // 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("LightspeedSaveStoreSettings", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <RestApiResultLightspeedSettings>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (RestApiResultLightspeedSettings)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(RestApiResultLightspeedSettings)))); }
/// <summary> /// /// </summary> /// <exception cref="Flipdish.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="storeId"></param> /// <param name="lightspeedSettings"></param> /// <returns>RestApiResultLightspeedSettings</returns> public RestApiResultLightspeedSettings LightspeedSaveStoreSettings(int?storeId, LightspeedSettings lightspeedSettings) { ApiResponse <RestApiResultLightspeedSettings> localVarResponse = LightspeedSaveStoreSettingsWithHttpInfo(storeId, lightspeedSettings); return(localVarResponse.Data); }