コード例 #1
0
        /// <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 (KetoInternalRelationTuple)</returns>
        public async System.Threading.Tasks.Task <Ory.Keto.Client.Client.ApiResponse <KetoInternalRelationTuple> > CreateRelationTupleWithHttpInfoAsync(KetoInternalRelationTuple payload = default(KetoInternalRelationTuple), 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 <KetoInternalRelationTuple>("/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);
        }
コード例 #2
0
        /// <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 KetoInternalRelationTuple</returns>
        public Ory.Keto.Client.Client.ApiResponse <KetoInternalRelationTuple> CreateRelationTupleWithHttpInfo(KetoInternalRelationTuple payload = default(KetoInternalRelationTuple))
        {
            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 <KetoInternalRelationTuple>("/relation-tuples", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
コード例 #3
0
        /// <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 KetoInternalRelationTuple</returns>
        public async System.Threading.Tasks.Task <KetoInternalRelationTuple> CreateRelationTupleAsync(KetoInternalRelationTuple payload = default(KetoInternalRelationTuple), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Ory.Keto.Client.Client.ApiResponse <KetoInternalRelationTuple> localVarResponse = await CreateRelationTupleWithHttpInfoAsync(payload, cancellationToken).ConfigureAwait(false);

            return(localVarResponse.Data);
        }
コード例 #4
0
 /// <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>KetoInternalRelationTuple</returns>
 public KetoInternalRelationTuple CreateRelationTuple(KetoInternalRelationTuple payload = default(KetoInternalRelationTuple))
 {
     Ory.Keto.Client.Client.ApiResponse <KetoInternalRelationTuple> localVarResponse = CreateRelationTupleWithHttpInfo(payload);
     return(localVarResponse.Data);
 }