Some checks failed
CI / Run lints and checks (push) Failing after 47s
CI / Run tests (push) Failing after 1s
CI / Run race tests (push) Failing after 5s
CI / Build CLI docs (push) Has been skipped
CI / Run buf actions (push) Failing after 5s
CodeQL / Analyze (go) (push) Failing after 3s
CodeQL / Analyze (javascript) (push) Failing after 2s
Docker Image Scanners / scanners (push) Failing after 3s
Format / format (push) Failing after 3s
Synchronize Issue Labels / Synchronize Issue Labels (push) Has been skipped
CI / Generate release (push) Has been skipped
CI / Draft newsletter (push) Has been skipped
CI / Pending approval Slack notification (push) Has been skipped
CI / Send newsletter (push) Has been skipped
263 lines
7.1 KiB
Go
Generated
263 lines
7.1 KiB
Go
Generated
/*
|
|
* Ory Keto API
|
|
*
|
|
* Documentation for all of Ory Keto's REST APIs. gRPC is documented separately.
|
|
*
|
|
* API version:
|
|
* Contact: hi@ory.sh
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package client
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// CreateRelationshipBody Create Relationship Request Body
|
|
type CreateRelationshipBody struct {
|
|
// Namespace to query
|
|
Namespace *string `json:"namespace,omitempty"`
|
|
// Object to query
|
|
Object *string `json:"object,omitempty"`
|
|
// Relation to query
|
|
Relation *string `json:"relation,omitempty"`
|
|
// SubjectID to query Either SubjectSet or SubjectID can be provided.
|
|
SubjectId *string `json:"subject_id,omitempty"`
|
|
SubjectSet *SubjectSet `json:"subject_set,omitempty"`
|
|
}
|
|
|
|
// NewCreateRelationshipBody instantiates a new CreateRelationshipBody object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewCreateRelationshipBody() *CreateRelationshipBody {
|
|
this := CreateRelationshipBody{}
|
|
return &this
|
|
}
|
|
|
|
// NewCreateRelationshipBodyWithDefaults instantiates a new CreateRelationshipBody object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewCreateRelationshipBodyWithDefaults() *CreateRelationshipBody {
|
|
this := CreateRelationshipBody{}
|
|
return &this
|
|
}
|
|
|
|
// GetNamespace returns the Namespace field value if set, zero value otherwise.
|
|
func (o *CreateRelationshipBody) GetNamespace() string {
|
|
if o == nil || o.Namespace == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Namespace
|
|
}
|
|
|
|
// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRelationshipBody) GetNamespaceOk() (*string, bool) {
|
|
if o == nil || o.Namespace == nil {
|
|
return nil, false
|
|
}
|
|
return o.Namespace, true
|
|
}
|
|
|
|
// HasNamespace returns a boolean if a field has been set.
|
|
func (o *CreateRelationshipBody) HasNamespace() bool {
|
|
if o != nil && o.Namespace != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNamespace gets a reference to the given string and assigns it to the Namespace field.
|
|
func (o *CreateRelationshipBody) SetNamespace(v string) {
|
|
o.Namespace = &v
|
|
}
|
|
|
|
// GetObject returns the Object field value if set, zero value otherwise.
|
|
func (o *CreateRelationshipBody) GetObject() string {
|
|
if o == nil || o.Object == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Object
|
|
}
|
|
|
|
// GetObjectOk returns a tuple with the Object field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRelationshipBody) GetObjectOk() (*string, bool) {
|
|
if o == nil || o.Object == nil {
|
|
return nil, false
|
|
}
|
|
return o.Object, true
|
|
}
|
|
|
|
// HasObject returns a boolean if a field has been set.
|
|
func (o *CreateRelationshipBody) HasObject() bool {
|
|
if o != nil && o.Object != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetObject gets a reference to the given string and assigns it to the Object field.
|
|
func (o *CreateRelationshipBody) SetObject(v string) {
|
|
o.Object = &v
|
|
}
|
|
|
|
// GetRelation returns the Relation field value if set, zero value otherwise.
|
|
func (o *CreateRelationshipBody) GetRelation() string {
|
|
if o == nil || o.Relation == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Relation
|
|
}
|
|
|
|
// GetRelationOk returns a tuple with the Relation field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRelationshipBody) GetRelationOk() (*string, bool) {
|
|
if o == nil || o.Relation == nil {
|
|
return nil, false
|
|
}
|
|
return o.Relation, true
|
|
}
|
|
|
|
// HasRelation returns a boolean if a field has been set.
|
|
func (o *CreateRelationshipBody) HasRelation() bool {
|
|
if o != nil && o.Relation != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRelation gets a reference to the given string and assigns it to the Relation field.
|
|
func (o *CreateRelationshipBody) SetRelation(v string) {
|
|
o.Relation = &v
|
|
}
|
|
|
|
// GetSubjectId returns the SubjectId field value if set, zero value otherwise.
|
|
func (o *CreateRelationshipBody) GetSubjectId() string {
|
|
if o == nil || o.SubjectId == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.SubjectId
|
|
}
|
|
|
|
// GetSubjectIdOk returns a tuple with the SubjectId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRelationshipBody) GetSubjectIdOk() (*string, bool) {
|
|
if o == nil || o.SubjectId == nil {
|
|
return nil, false
|
|
}
|
|
return o.SubjectId, true
|
|
}
|
|
|
|
// HasSubjectId returns a boolean if a field has been set.
|
|
func (o *CreateRelationshipBody) HasSubjectId() bool {
|
|
if o != nil && o.SubjectId != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSubjectId gets a reference to the given string and assigns it to the SubjectId field.
|
|
func (o *CreateRelationshipBody) SetSubjectId(v string) {
|
|
o.SubjectId = &v
|
|
}
|
|
|
|
// GetSubjectSet returns the SubjectSet field value if set, zero value otherwise.
|
|
func (o *CreateRelationshipBody) GetSubjectSet() SubjectSet {
|
|
if o == nil || o.SubjectSet == nil {
|
|
var ret SubjectSet
|
|
return ret
|
|
}
|
|
return *o.SubjectSet
|
|
}
|
|
|
|
// GetSubjectSetOk returns a tuple with the SubjectSet field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateRelationshipBody) GetSubjectSetOk() (*SubjectSet, bool) {
|
|
if o == nil || o.SubjectSet == nil {
|
|
return nil, false
|
|
}
|
|
return o.SubjectSet, true
|
|
}
|
|
|
|
// HasSubjectSet returns a boolean if a field has been set.
|
|
func (o *CreateRelationshipBody) HasSubjectSet() bool {
|
|
if o != nil && o.SubjectSet != nil {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSubjectSet gets a reference to the given SubjectSet and assigns it to the SubjectSet field.
|
|
func (o *CreateRelationshipBody) SetSubjectSet(v SubjectSet) {
|
|
o.SubjectSet = &v
|
|
}
|
|
|
|
func (o CreateRelationshipBody) MarshalJSON() ([]byte, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if o.Namespace != nil {
|
|
toSerialize["namespace"] = o.Namespace
|
|
}
|
|
if o.Object != nil {
|
|
toSerialize["object"] = o.Object
|
|
}
|
|
if o.Relation != nil {
|
|
toSerialize["relation"] = o.Relation
|
|
}
|
|
if o.SubjectId != nil {
|
|
toSerialize["subject_id"] = o.SubjectId
|
|
}
|
|
if o.SubjectSet != nil {
|
|
toSerialize["subject_set"] = o.SubjectSet
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
type NullableCreateRelationshipBody struct {
|
|
value *CreateRelationshipBody
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCreateRelationshipBody) Get() *CreateRelationshipBody {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCreateRelationshipBody) Set(val *CreateRelationshipBody) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCreateRelationshipBody) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCreateRelationshipBody) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCreateRelationshipBody(val *CreateRelationshipBody) *NullableCreateRelationshipBody {
|
|
return &NullableCreateRelationshipBody{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCreateRelationshipBody) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCreateRelationshipBody) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|