コード例 #1
0
        /// <summary>
        /// Patch Multiple Relation Tuples Use this endpoint to patch one or more relation tuples.
        /// </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</returns>
        public async System.Threading.Tasks.Task <Ory.Keto.Client.Client.ApiResponse <Object> > PatchRelationTuplesWithHttpInfoAsync(List <KetoPatchDelta> payload = default(List <KetoPatchDelta>), 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.PatchAsync <Object>("/relation-tuples", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

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

            return(localVarResponse);
        }
コード例 #2
0
        /// <summary>
        /// Patch Multiple Relation Tuples Use this endpoint to patch one or more relation tuples.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="payload"> (optional)</param>
        /// <returns>ApiResponse of Object(void)</returns>
        public Ory.Keto.Client.Client.ApiResponse <Object> PatchRelationTuplesWithHttpInfo(List <KetoPatchDelta> payload = default(List <KetoPatchDelta>))
        {
            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.Patch <Object>("/relation-tuples", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
コード例 #3
0
        /// <summary>
        /// Check readiness status This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well.  If the service supports TLS Edge Termination, this endpoint does not require the &#x60;X-Forwarded-Proto&#x60; header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (KetoHealthStatus)</returns>
        public async System.Threading.Tasks.Task <Ory.Keto.Client.Client.ApiResponse <KetoHealthStatus> > IsInstanceReadyWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Ory.Keto.Client.Client.RequestOptions localVarRequestOptions = new Ory.Keto.Client.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // 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);
            }



            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <KetoHealthStatus>("/health/ready", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

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

            return(localVarResponse);
        }
コード例 #4
0
        /// <summary>
        /// Check readiness status This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well.  If the service supports TLS Edge Termination, this endpoint does not require the &#x60;X-Forwarded-Proto&#x60; header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of KetoHealthStatus</returns>
        public Ory.Keto.Client.Client.ApiResponse <KetoHealthStatus> IsInstanceReadyWithHttpInfo()
        {
            Ory.Keto.Client.Client.RequestOptions localVarRequestOptions = new Ory.Keto.Client.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // 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);
            }



            // make the HTTP request
            var localVarResponse = this.Client.Get <KetoHealthStatus>("/health/ready", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
コード例 #5
0
        /// <summary>
        /// Check readiness status This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well.  If the service supports TLS Edge Termination, this endpoint does not require the &#x60;X-Forwarded-Proto&#x60; header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (KetoHealthStatus)</returns>
        public async System.Threading.Tasks.Task <Ory.Keto.Client.Client.ApiResponse <KetoHealthStatus> > IsInstanceReadyAsyncWithHttpInfo()
        {
            Ory.Keto.Client.Client.RequestOptions localVarRequestOptions = new Ory.Keto.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

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

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }



            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <KetoHealthStatus>("/health/ready", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
コード例 #6
0
        /// <summary>
        /// Delete a Relation Tuple Use this endpoint to delete a relation tuple.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="_namespace">Namespace of the Relation Tuple</param>
        /// <param name="_object">Object of the Relation Tuple</param>
        /// <param name="relation">Relation of the Relation Tuple</param>
        /// <param name="subject">Subject of the Relation Tuple  The subject follows the subject string encoding format. (optional)</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <Ory.Keto.Client.Client.ApiResponse <Object> > DeleteRelationTupleWithHttpInfoAsync(string _namespace, string _object, string relation, string subject = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter '_namespace' is set
            if (_namespace == null)
            {
                throw new Ory.Keto.Client.Client.ApiException(400, "Missing required parameter '_namespace' when calling WriteApi->DeleteRelationTuple");
            }

            // verify the required parameter '_object' is set
            if (_object == null)
            {
                throw new Ory.Keto.Client.Client.ApiException(400, "Missing required parameter '_object' when calling WriteApi->DeleteRelationTuple");
            }

            // verify the required parameter 'relation' is set
            if (relation == null)
            {
                throw new Ory.Keto.Client.Client.ApiException(400, "Missing required parameter 'relation' when calling WriteApi->DeleteRelationTuple");
            }


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

            String[] _contentTypes = new String[] {
            };

            // 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.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "namespace", _namespace));
            localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "object", _object));
            localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "relation", relation));
            if (subject != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "subject", subject));
            }


            // make the HTTP request

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

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

            return(localVarResponse);
        }
コード例 #7
0
ファイル: WriteApi.cs プロジェクト: ory/sdk
        /// <summary>
        /// Delete a Relation Tuple Use this endpoint to delete a relation tuple.
        /// </summary>
        /// <exception cref="Ory.Keto.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="_namespace">Namespace of the Relation Tuple</param>
        /// <param name="_object">Object of the Relation Tuple</param>
        /// <param name="relation">Relation of the Relation Tuple</param>
        /// <param name="subjectId">SubjectID of the Relation Tuple (optional)</param>
        /// <param name="subjectSetNamespace">Namespace of the Subject Set (optional)</param>
        /// <param name="subjectSetObject">Object of the Subject Set (optional)</param>
        /// <param name="subjectSetRelation">Relation of the Subject Set (optional)</param>
        /// <returns>ApiResponse of Object(void)</returns>
        public Ory.Keto.Client.Client.ApiResponse <Object> DeleteRelationTupleWithHttpInfo(string _namespace, string _object, string relation, string subjectId = default(string), string subjectSetNamespace = default(string), string subjectSetObject = default(string), string subjectSetRelation = default(string))
        {
            // verify the required parameter '_namespace' is set
            if (_namespace == null)
            {
                throw new Ory.Keto.Client.Client.ApiException(400, "Missing required parameter '_namespace' when calling WriteApi->DeleteRelationTuple");
            }

            // verify the required parameter '_object' is set
            if (_object == null)
            {
                throw new Ory.Keto.Client.Client.ApiException(400, "Missing required parameter '_object' when calling WriteApi->DeleteRelationTuple");
            }

            // verify the required parameter 'relation' is set
            if (relation == null)
            {
                throw new Ory.Keto.Client.Client.ApiException(400, "Missing required parameter 'relation' when calling WriteApi->DeleteRelationTuple");
            }

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

            string[] _contentTypes = new string[] {
            };

            // 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.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "namespace", _namespace));
            localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "object", _object));
            localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "relation", relation));
            if (subjectId != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "subject_id", subjectId));
            }
            if (subjectSetNamespace != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "subject_set.namespace", subjectSetNamespace));
            }
            if (subjectSetObject != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "subject_set.object", subjectSetObject));
            }
            if (subjectSetRelation != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Keto.Client.Client.ClientUtils.ParameterToMultiMap("", "subject_set.relation", subjectSetRelation));
            }


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

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

            return(localVarResponse);
        }