// // AUTO-GENERATED FILE, DO NOT MODIFY! // // @dart=2.0 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class AutomationApi { AutomationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; final ApiClient apiClient; /// Create an automation /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required): /// Automation to create Future automationCreateWithHttpInfo(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async { // Verify required params are set. if (automationCreateOrUpdateDetailDTO == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: automationCreateOrUpdateDetailDTO'); } final path = r'/api/automation'; Object postBody = automationCreateOrUpdateDetailDTO; final queryParams = []; final headerParams = {}; final formParams = {}; final contentTypes = ['application/json']; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; if ( nullableContentType != null && nullableContentType.toLowerCase().startsWith('multipart/form-data') ) { bool hasFields = false; final mp = MultipartRequest(null, null); if (hasFields) { postBody = mp; } } else { } return await apiClient.invokeAPI( path, 'POST', queryParams, postBody, headerParams, formParams, nullableContentType, authNames, ); } /// Create an automation /// /// Parameters: /// /// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required): /// Automation to create Future automationCreate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async { final response = await automationCreateWithHttpInfo(automationCreateOrUpdateDetailDTO); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body != null && response.statusCode != HttpStatus.noContent) { return apiClient.deserialize(_decodeBodyBytes(response), 'AutomationDTO') as AutomationDTO; } return Future.value(null); } /// Delete an automation /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [String] automationId (required): /// Id of automation to delete Future automationDeleteWithHttpInfo(String automationId) async { // Verify required params are set. if (automationId == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: automationId'); } final path = r'/api/automation/{automationId}' .replaceAll('{' + 'automationId' + '}', automationId.toString()); Object postBody; final queryParams = []; final headerParams = {}; final formParams = {}; final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; if ( nullableContentType != null && nullableContentType.toLowerCase().startsWith('multipart/form-data') ) { bool hasFields = false; final mp = MultipartRequest(null, null); if (hasFields) { postBody = mp; } } else { } return await apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, nullableContentType, authNames, ); } /// Delete an automation /// /// Parameters: /// /// * [String] automationId (required): /// Id of automation to delete Future automationDelete(String automationId) async { final response = await automationDeleteWithHttpInfo(automationId); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body != null && response.statusCode != HttpStatus.noContent) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } return Future.value(null); } /// Delete all automation for a specified /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [String] userId (required): /// Id of user Future automationDeleteAllForUserWithHttpInfo(String userId) async { // Verify required params are set. if (userId == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); } final path = r'/api/automation/user/{userId}' .replaceAll('{' + 'userId' + '}', userId.toString()); Object postBody; final queryParams = []; final headerParams = {}; final formParams = {}; final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; if ( nullableContentType != null && nullableContentType.toLowerCase().startsWith('multipart/form-data') ) { bool hasFields = false; final mp = MultipartRequest(null, null); if (hasFields) { postBody = mp; } } else { } return await apiClient.invokeAPI( path, 'DELETE', queryParams, postBody, headerParams, formParams, nullableContentType, authNames, ); } /// Delete all automation for a specified /// /// Parameters: /// /// * [String] userId (required): /// Id of user Future automationDeleteAllForUser(String userId) async { final response = await automationDeleteAllForUserWithHttpInfo(userId); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body != null && response.statusCode != HttpStatus.noContent) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } return Future.value(null); } /// Get all automations for the specified user /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [String] userId (required): /// Id of user Future automationGetAllWithHttpInfo(String userId) async { // Verify required params are set. if (userId == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: userId'); } final path = r'/api/automation/{userId}' .replaceAll('{' + 'userId' + '}', userId.toString()); Object postBody; final queryParams = []; final headerParams = {}; final formParams = {}; final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; if ( nullableContentType != null && nullableContentType.toLowerCase().startsWith('multipart/form-data') ) { bool hasFields = false; final mp = MultipartRequest(null, null); if (hasFields) { postBody = mp; } } else { } return await apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, nullableContentType, authNames, ); } /// Get all automations for the specified user /// /// Parameters: /// /// * [String] userId (required): /// Id of user Future> automationGetAll(String userId) async { final response = await automationGetAllWithHttpInfo(userId); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body != null && response.statusCode != HttpStatus.noContent) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List) .cast() .toList(growable: false); } return Future>.value(null); } /// Get detail info of a specified automation /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [String] automationId (required): /// automation id Future automationGetDetailWithHttpInfo(String automationId) async { // Verify required params are set. if (automationId == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: automationId'); } final path = r'/api/automation/detail/{automationId}' .replaceAll('{' + 'automationId' + '}', automationId.toString()); Object postBody; final queryParams = []; final headerParams = {}; final formParams = {}; final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; if ( nullableContentType != null && nullableContentType.toLowerCase().startsWith('multipart/form-data') ) { bool hasFields = false; final mp = MultipartRequest(null, null); if (hasFields) { postBody = mp; } } else { } return await apiClient.invokeAPI( path, 'GET', queryParams, postBody, headerParams, formParams, nullableContentType, authNames, ); } /// Get detail info of a specified automation /// /// Parameters: /// /// * [String] automationId (required): /// automation id Future automationGetDetail(String automationId) async { final response = await automationGetDetailWithHttpInfo(automationId); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body != null && response.statusCode != HttpStatus.noContent) { return apiClient.deserialize(_decodeBodyBytes(response), 'AutomationDetailDTO') as AutomationDetailDTO; } return Future.value(null); } /// Update an automation /// /// Note: This method returns the HTTP [Response]. /// /// Parameters: /// /// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required): /// automation to update Future automationUpdateWithHttpInfo(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async { // Verify required params are set. if (automationCreateOrUpdateDetailDTO == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: automationCreateOrUpdateDetailDTO'); } final path = r'/api/automation'; Object postBody = automationCreateOrUpdateDetailDTO; final queryParams = []; final headerParams = {}; final formParams = {}; final contentTypes = ['application/json']; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; final authNames = ['bearer']; if ( nullableContentType != null && nullableContentType.toLowerCase().startsWith('multipart/form-data') ) { bool hasFields = false; final mp = MultipartRequest(null, null); if (hasFields) { postBody = mp; } } else { } return await apiClient.invokeAPI( path, 'PUT', queryParams, postBody, headerParams, formParams, nullableContentType, authNames, ); } /// Update an automation /// /// Parameters: /// /// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required): /// automation to update Future automationUpdate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async { final response = await automationUpdateWithHttpInfo(automationCreateOrUpdateDetailDTO); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, _decodeBodyBytes(response)); } // When a remote server returns no body with a status of 204, we shall not decode it. // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // FormatException when trying to decode an empty string. if (response.body != null && response.statusCode != HttpStatus.noContent) { return apiClient.deserialize(_decodeBodyBytes(response), 'AutomationCreateOrUpdateDetailDTO') as AutomationCreateOrUpdateDetailDTO; } return Future.value(null); } }