/// <summary> /// Create an invitation Used so a user can join the platform. The entered email will be used to confirm the user's entity. An invitation email will also be sent. Requires the User Admin Role. /// </summary> /// <exception cref="mantle.lib.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="request"> (optional)</param> /// <returns>Task of Invitation</returns> public async System.Threading.Tasks.Task <Invitation> InvitationsPostAsync(InvitationCreateRequest request = null) { ApiResponse <Invitation> localVarResponse = await InvitationsPostAsyncWithHttpInfo(request); return(localVarResponse.Data); }
/// <summary> /// Create an invitation Used so a user can join the platform. The entered email will be used to confirm the user's entity. An invitation email will also be sent. Requires the User Admin Role. /// </summary> /// <exception cref="mantle.lib.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="request"> (optional)</param> /// <returns>Task of ApiResponse (Invitation)</returns> public async System.Threading.Tasks.Task <ApiResponse <Invitation> > InvitationsPostAsyncWithHttpInfo(InvitationCreateRequest request = null) { var localVarPath = "./invitations"; 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[] { "application/json-patch+json", "application/json", "text/json", "application/_*+json" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "text/plain", "application/json", "text/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (request != null && request.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { localVarPostBody = request; // byte array } // 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("InvitationsPost", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <Invitation>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Invitation)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Invitation)))); }
/// <summary> /// Create an invitation Used so a user can join the platform. The entered email will be used to confirm the user's entity. An invitation email will also be sent. Requires the User Admin Role. /// </summary> /// <exception cref="mantle.lib.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="request"> (optional)</param> /// <returns>Invitation</returns> public Invitation InvitationsPost(InvitationCreateRequest request = null) { ApiResponse <Invitation> localVarResponse = InvitationsPostWithHttpInfo(request); return(localVarResponse.Data); }