From f74c7bfea07cd389bc281c9133c67be73c198982 Mon Sep 17 00:00:00 2001 From: Arnau Lacambra Date: Wed, 19 Oct 2022 15:25:34 +0200 Subject: [PATCH] Added method to retrieve an Event using uuid instead of integer --- src/SignRequest/Api/EventsApi.cs | 261 ++++++++++++++++++++++++++----- 1 file changed, 224 insertions(+), 37 deletions(-) diff --git a/src/SignRequest/Api/EventsApi.cs b/src/SignRequest/Api/EventsApi.cs index e44acb4..de30af8 100644 --- a/src/SignRequest/Api/EventsApi.cs +++ b/src/SignRequest/Api/EventsApi.cs @@ -47,7 +47,7 @@ public interface IEventsApi : IApiAccessor /// A page number within the paginated result set. (optional) /// Number of results to return per page. (optional) /// InlineResponse2004 - InlineResponse2004 EventsList (string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null); + InlineResponse2004 EventsList(string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null); /// /// Retrieve a list of Events @@ -72,7 +72,7 @@ public interface IEventsApi : IApiAccessor /// A page number within the paginated result set. (optional) /// Number of results to return per page. (optional) /// ApiResponse of InlineResponse2004 - ApiResponse EventsListWithHttpInfo (string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null); + ApiResponse EventsListWithHttpInfo(string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null); /// /// Retrieve an Event /// @@ -82,7 +82,18 @@ public interface IEventsApi : IApiAccessor /// Thrown when fails to make API call /// A unique integer value identifying this event. /// Event - Event EventsRead (int? id); + Event EventsRead(int? id); + + /// + /// Retrieve an Event + /// + /// + /// + /// + /// Thrown when fails to make API call + /// A unique uudi value identifying this event. + /// Event + Event EventsRead(string uuid); /// /// Retrieve an Event @@ -93,7 +104,18 @@ public interface IEventsApi : IApiAccessor /// Thrown when fails to make API call /// A unique integer value identifying this event. /// ApiResponse of Event - ApiResponse EventsReadWithHttpInfo (int? id); + ApiResponse EventsReadWithHttpInfo(int? id); + + /// + /// Retrieve an Event + /// + /// + /// + /// + /// Thrown when fails to make API call + /// A unique uuid value identifying this event. + /// ApiResponse of Event + ApiResponse EventsReadWithHttpInfo(string uuid); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -119,7 +141,7 @@ public interface IEventsApi : IApiAccessor /// A page number within the paginated result set. (optional) /// Number of results to return per page. (optional) /// Task of InlineResponse2004 - System.Threading.Tasks.Task EventsListAsync (string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null); + System.Threading.Tasks.Task EventsListAsync(string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null); /// /// Retrieve a list of Events @@ -144,7 +166,7 @@ public interface IEventsApi : IApiAccessor /// A page number within the paginated result set. (optional) /// Number of results to return per page. (optional) /// Task of ApiResponse (InlineResponse2004) - System.Threading.Tasks.Task> EventsListAsyncWithHttpInfo (string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null); + System.Threading.Tasks.Task> EventsListAsyncWithHttpInfo(string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null); /// /// Retrieve an Event /// @@ -154,7 +176,18 @@ public interface IEventsApi : IApiAccessor /// Thrown when fails to make API call /// A unique integer value identifying this event. /// Task of Event - System.Threading.Tasks.Task EventsReadAsync (int? id); + System.Threading.Tasks.Task EventsReadAsync(int? id); + + /// + /// Retrieve an Event + /// + /// + /// + /// + /// Thrown when fails to make API call + /// A unique uuid value identifying this event. + /// Task of Event + System.Threading.Tasks.Task EventsReadAsync(string uuid); /// /// Retrieve an Event @@ -165,7 +198,18 @@ public interface IEventsApi : IApiAccessor /// Thrown when fails to make API call /// A unique integer value identifying this event. /// Task of ApiResponse (Event) - System.Threading.Tasks.Task> EventsReadAsyncWithHttpInfo (int? id); + System.Threading.Tasks.Task> EventsReadAsyncWithHttpInfo(int? id); + + /// + /// Retrieve an Event + /// + /// + /// + /// + /// Thrown when fails to make API call + /// A unique uuid value identifying this event. + /// Task of ApiResponse (Event) + System.Threading.Tasks.Task> EventsReadAsyncWithHttpInfo(string uuid); #endregion Asynchronous Operations } @@ -226,7 +270,7 @@ public void SetBasePath(String basePath) /// Gets or sets the configuration object /// /// An instance of the Configuration - public SignRequest.Client.Configuration Configuration {get; set;} + public SignRequest.Client.Configuration Configuration { get; set; } /// /// Provides a factory method hook for the creation of exceptions. @@ -286,10 +330,10 @@ public void AddDefaultHeader(string key, string value) /// A page number within the paginated result set. (optional) /// Number of results to return per page. (optional) /// InlineResponse2004 - public InlineResponse2004 EventsList (string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null) + public InlineResponse2004 EventsList(string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null) { - ApiResponse localVarResponse = EventsListWithHttpInfo(documentUuid, documentExternalId, documentSignrequestWho, documentSignrequestFromEmail, documentStatus, documentUserEmail, documentUserFirstName, documentUserLastName, delivered, deliveredOn, timestamp, status, eventType, page, limit); - return localVarResponse.Data; + ApiResponse localVarResponse = EventsListWithHttpInfo(documentUuid, documentExternalId, documentSignrequestWho, documentSignrequestFromEmail, documentStatus, documentUserEmail, documentUserFirstName, documentUserLastName, delivered, deliveredOn, timestamp, status, eventType, page, limit); + return localVarResponse.Data; } /// @@ -312,7 +356,7 @@ public InlineResponse2004 EventsList (string documentUuid = null, string documen /// A page number within the paginated result set. (optional) /// Number of results to return per page. (optional) /// ApiResponse of InlineResponse2004 - public ApiResponse< InlineResponse2004 > EventsListWithHttpInfo (string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null) + public ApiResponse EventsListWithHttpInfo(string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null) { var localVarPath = "./events/"; @@ -360,11 +404,11 @@ public ApiResponse< InlineResponse2004 > EventsListWithHttpInfo (string document } // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int) localVarResponse.StatusCode; + int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { @@ -374,7 +418,7 @@ public ApiResponse< InlineResponse2004 > EventsListWithHttpInfo (string document return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (InlineResponse2004) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2004))); + (InlineResponse2004)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2004))); } /// @@ -397,10 +441,10 @@ public ApiResponse< InlineResponse2004 > EventsListWithHttpInfo (string document /// A page number within the paginated result set. (optional) /// Number of results to return per page. (optional) /// Task of InlineResponse2004 - public async System.Threading.Tasks.Task EventsListAsync (string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null) + public async System.Threading.Tasks.Task EventsListAsync(string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null) { - ApiResponse localVarResponse = await EventsListAsyncWithHttpInfo(documentUuid, documentExternalId, documentSignrequestWho, documentSignrequestFromEmail, documentStatus, documentUserEmail, documentUserFirstName, documentUserLastName, delivered, deliveredOn, timestamp, status, eventType, page, limit); - return localVarResponse.Data; + ApiResponse localVarResponse = await EventsListAsyncWithHttpInfo(documentUuid, documentExternalId, documentSignrequestWho, documentSignrequestFromEmail, documentStatus, documentUserEmail, documentUserFirstName, documentUserLastName, delivered, deliveredOn, timestamp, status, eventType, page, limit); + return localVarResponse.Data; } @@ -424,7 +468,7 @@ public async System.Threading.Tasks.Task EventsListAsync (st /// A page number within the paginated result set. (optional) /// Number of results to return per page. (optional) /// Task of ApiResponse (InlineResponse2004) - public async System.Threading.Tasks.Task> EventsListAsyncWithHttpInfo (string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null) + public async System.Threading.Tasks.Task> EventsListAsyncWithHttpInfo(string documentUuid = null, string documentExternalId = null, string documentSignrequestWho = null, string documentSignrequestFromEmail = null, string documentStatus = null, string documentUserEmail = null, string documentUserFirstName = null, string documentUserLastName = null, string delivered = null, string deliveredOn = null, string timestamp = null, string status = null, string eventType = null, int? page = null, int? limit = null) { var localVarPath = "./events/"; @@ -472,11 +516,11 @@ public async System.Threading.Tasks.Task> Events } // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int) localVarResponse.StatusCode; + int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { @@ -486,7 +530,7 @@ public async System.Threading.Tasks.Task> Events return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (InlineResponse2004) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2004))); + (InlineResponse2004)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2004))); } /// @@ -495,10 +539,22 @@ public async System.Threading.Tasks.Task> Events /// Thrown when fails to make API call /// A unique integer value identifying this event. /// Event - public Event EventsRead (int? id) + public Event EventsRead(int? id) + { + ApiResponse localVarResponse = EventsReadWithHttpInfo(id); + return localVarResponse.Data; + } + + /// + /// Retrieve an Event + /// + /// Thrown when fails to make API call + /// A unique uuid value identifying this event. + /// Event + public Event EventsRead(string uuid) { - ApiResponse localVarResponse = EventsReadWithHttpInfo(id); - return localVarResponse.Data; + ApiResponse localVarResponse = EventsReadWithHttpInfo(uuid); + return localVarResponse.Data; } /// @@ -507,7 +563,7 @@ public Event EventsRead (int? id) /// Thrown when fails to make API call /// A unique integer value identifying this event. /// ApiResponse of Event - public ApiResponse< Event > EventsReadWithHttpInfo (int? id) + public ApiResponse EventsReadWithHttpInfo(int? id) { // verify the required parameter 'id' is set if (id == null) @@ -544,11 +600,71 @@ public ApiResponse< Event > EventsReadWithHttpInfo (int? id) } // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("EventsRead", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Event)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Event))); + } + + /// + /// Retrieve an Event + /// + /// Thrown when fails to make API call + /// A unique uuid value identifying this event. + /// ApiResponse of Event + public ApiResponse EventsReadWithHttpInfo(string uuid) + { + // verify the required parameter 'id' is set + if (string.IsNullOrEmpty(uuid)) + throw new ApiException(400, "Missing required parameter 'uuid' when calling EventsApi->EventsRead"); + + var localVarPath = "./events/{id}/"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + 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("id", this.Configuration.ApiClient.ParameterToString(uuid)); // path parameter + + // authentication (Token) required + if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int) localVarResponse.StatusCode; + int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { @@ -558,7 +674,7 @@ public ApiResponse< Event > EventsReadWithHttpInfo (int? id) return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Event) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Event))); + (Event)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Event))); } /// @@ -567,11 +683,22 @@ public ApiResponse< Event > EventsReadWithHttpInfo (int? id) /// Thrown when fails to make API call /// A unique integer value identifying this event. /// Task of Event - public async System.Threading.Tasks.Task EventsReadAsync (int? id) + public async System.Threading.Tasks.Task EventsReadAsync(int? id) { - ApiResponse localVarResponse = await EventsReadAsyncWithHttpInfo(id); - return localVarResponse.Data; + ApiResponse localVarResponse = await EventsReadAsyncWithHttpInfo(id); + return localVarResponse.Data; + } + /// + /// Retrieve an Event + /// + /// Thrown when fails to make API call + /// A unique uuid value identifying this event. + /// Task of Event + public async System.Threading.Tasks.Task EventsReadAsync(string uuid) + { + ApiResponse localVarResponse = await EventsReadAsyncWithHttpInfo(uuid); + return localVarResponse.Data; } /// @@ -580,7 +707,7 @@ public async System.Threading.Tasks.Task EventsReadAsync (int? id) /// Thrown when fails to make API call /// A unique integer value identifying this event. /// Task of ApiResponse (Event) - public async System.Threading.Tasks.Task> EventsReadAsyncWithHttpInfo (int? id) + public async System.Threading.Tasks.Task> EventsReadAsyncWithHttpInfo(int? id) { // verify the required parameter 'id' is set if (id == null) @@ -617,11 +744,71 @@ public async System.Threading.Tasks.Task> EventsReadAsyncWith } // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int)localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("EventsRead", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + (Event)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Event))); + } + + /// + /// Retrieve an Event + /// + /// Thrown when fails to make API call + /// A unique uuid value identifying this event. + /// Task of ApiResponse (Event) + public async System.Threading.Tasks.Task> EventsReadAsyncWithHttpInfo(string uuid) + { + // verify the required parameter 'id' is set + if (uuid == null) + throw new ApiException(400, "Missing required parameter 'id' when calling EventsApi->EventsRead"); + + var localVarPath = "./events/{id}/"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + 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("id", this.Configuration.ApiClient.ParameterToString(uuid)); // path parameter + + // authentication (Token) required + if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) + { + localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization"); + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); - int localVarStatusCode = (int) localVarResponse.StatusCode; + int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { @@ -631,7 +818,7 @@ public async System.Threading.Tasks.Task> EventsReadAsyncWith return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Event) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Event))); + (Event)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Event))); } }