Exemplo n.º 1
0
        /// <summary>
        /// Update a Project Creates a new configuration revision for a project.
        /// </summary>
        /// <exception cref="Ory.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="projectId">Project ID  The project&#39;s ID.</param>
        /// <param name="clientProjectPatch"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (ClientProject)</returns>
        public async System.Threading.Tasks.Task <Ory.Client.Client.ApiResponse <ClientProject> > UpdateProjectWithHttpInfoAsync(string projectId, ClientProjectPatch clientProjectPatch = default(ClientProjectPatch), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'projectId' is set
            if (projectId == null)
            {
                throw new Ory.Client.Client.ApiException(400, "Missing required parameter 'projectId' when calling V0alpha0Api->UpdateProject");
            }


            Ory.Client.Client.RequestOptions localVarRequestOptions = new Ory.Client.Client.RequestOptions();

            string[] _contentTypes = new string[] {
                "application/json"
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };


            var localVarContentType = Ory.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Ory.Client.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("project_id", Ory.Client.Client.ClientUtils.ParameterToString(projectId)); // path parameter
            localVarRequestOptions.Data = clientProjectPatch;

            // authentication (oryAccessToken) required
            // bearer authentication required
            if (!string.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PutAsync <ClientProject>("/backoffice/public/projects/{project_id}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("UpdateProject", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Update a Project Creates a new configuration revision for a project.
        /// </summary>
        /// <exception cref="Ory.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="projectId">Project ID  The project&#39;s ID.</param>
        /// <param name="clientProjectPatch"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ClientProject</returns>
        public async System.Threading.Tasks.Task <ClientProject> UpdateProjectAsync(string projectId, ClientProjectPatch clientProjectPatch = default(ClientProjectPatch), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Ory.Client.Client.ApiResponse <ClientProject> localVarResponse = await UpdateProjectWithHttpInfoAsync(projectId, clientProjectPatch, cancellationToken).ConfigureAwait(false);

            return(localVarResponse.Data);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create a Project Creates a new project.
        /// </summary>
        /// <exception cref="Ory.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="clientProjectPatch"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (ClientProject)</returns>
        public async System.Threading.Tasks.Task <Ory.Client.Client.ApiResponse <ClientProject> > CreateProjectWithHttpInfoAsync(ClientProjectPatch clientProjectPatch = default(ClientProjectPatch), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Ory.Client.Client.RequestOptions localVarRequestOptions = new Ory.Client.Client.RequestOptions();

            string[] _contentTypes = new string[] {
                "application/json"
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };


            var localVarContentType = Ory.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Ory.Client.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = clientProjectPatch;

            // authentication (oryAccessToken) required
            // bearer authentication required
            if (!string.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <ClientProject>("/backoffice/public/projects", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("CreateProject", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Update a Project Creates a new configuration revision for a project.
 /// </summary>
 /// <exception cref="Ory.Client.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="projectId">Project ID  The project&#39;s ID.</param>
 /// <param name="clientProjectPatch"> (optional)</param>
 /// <returns>ClientProject</returns>
 public ClientProject UpdateProject(string projectId, ClientProjectPatch clientProjectPatch = default(ClientProjectPatch))
 {
     Ory.Client.Client.ApiResponse <ClientProject> localVarResponse = UpdateProjectWithHttpInfo(projectId, clientProjectPatch);
     return(localVarResponse.Data);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a Project Creates a new project.
 /// </summary>
 /// <exception cref="Ory.Client.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="clientProjectPatch"> (optional)</param>
 /// <returns>ClientProject</returns>
 public ClientProject CreateProject(ClientProjectPatch clientProjectPatch = default(ClientProjectPatch))
 {
     Ory.Client.Client.ApiResponse <ClientProject> localVarResponse = CreateProjectWithHttpInfo(clientProjectPatch);
     return(localVarResponse.Data);
 }