Exemplo n.º 1
0
Arquivo: WriteApi.cs Projeto: ory/sdk
        /// <summary>
        /// Create a Relation Tuple Use this endpoint to create a relation tuple.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="payload"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (KetoRelationQuery)</returns>
        public async System.Threading.Tasks.Task <Ory.Keto.Client.Client.ApiResponse <KetoRelationQuery> > CreateRelationTupleWithHttpInfoAsync(KetoRelationQuery payload = default(KetoRelationQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Ory.Keto.Client.Client.RequestOptions localVarRequestOptions = new Ory.Keto.Client.Client.RequestOptions();

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

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


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

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

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

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

            localVarRequestOptions.Data = payload;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PutAsync <KetoRelationQuery>("/relation-tuples", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

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

            return(localVarResponse);
        }
Exemplo n.º 2
0
Arquivo: WriteApi.cs Projeto: ory/sdk
        /// <summary>
        /// Create a Relation Tuple Use this endpoint to create a relation tuple.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="payload"> (optional)</param>
        /// <returns>ApiResponse of KetoRelationQuery</returns>
        public Ory.Keto.Client.Client.ApiResponse <KetoRelationQuery> CreateRelationTupleWithHttpInfo(KetoRelationQuery payload = default(KetoRelationQuery))
        {
            Ory.Keto.Client.Client.RequestOptions localVarRequestOptions = new Ory.Keto.Client.Client.RequestOptions();

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

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

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

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

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

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

            localVarRequestOptions.Data = payload;


            // make the HTTP request
            var localVarResponse = this.Client.Put <KetoRelationQuery>("/relation-tuples", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Exemplo n.º 3
0
Arquivo: WriteApi.cs Projeto: ory/sdk
        /// <summary>
        /// Create a Relation Tuple Use this endpoint to create a relation tuple.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="payload"> (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of KetoRelationQuery</returns>
        public async System.Threading.Tasks.Task <KetoRelationQuery> CreateRelationTupleAsync(KetoRelationQuery payload = default(KetoRelationQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Ory.Keto.Client.Client.ApiResponse <KetoRelationQuery> localVarResponse = await CreateRelationTupleWithHttpInfoAsync(payload, cancellationToken).ConfigureAwait(false);

            return(localVarResponse.Data);
        }
Exemplo n.º 4
0
Arquivo: WriteApi.cs Projeto: ory/sdk
 /// <summary>
 /// Create a Relation Tuple Use this endpoint to create a relation tuple.
 /// </summary>
 /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="payload"> (optional)</param>
 /// <returns>KetoRelationQuery</returns>
 public KetoRelationQuery CreateRelationTuple(KetoRelationQuery payload = default(KetoRelationQuery))
 {
     Ory.Keto.Client.Client.ApiResponse <KetoRelationQuery> localVarResponse = CreateRelationTupleWithHttpInfo(payload);
     return(localVarResponse.Data);
 }