kratos/internal/client-go/model_provider.go

384 lines
10 KiB
Go

/*
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
)
// checks if the Provider type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Provider{}
// Provider struct for Provider
type Provider struct {
// The RP's client identifier, issued by the IdP.
ClientId *string `json:"client_id,omitempty"`
// A full path of the IdP config file.
ConfigUrl *string `json:"config_url,omitempty"`
// By specifying one of domain_hints values provided by the accounts endpoints, the FedCM dialog selectively shows the specified account.
DomainHint *string `json:"domain_hint,omitempty"`
// Array of strings that specifies the user information (\"name\", \" email\", \"picture\") that RP needs IdP to share with them. Note: Field API is supported by Chrome 132 and later.
Fields []string `json:"fields,omitempty"`
// By specifying one of login_hints values provided by the accounts endpoints, the FedCM dialog selectively shows the specified account.
LoginHint *string `json:"login_hint,omitempty"`
// A random string to ensure the response is issued for this specific request. Prevents replay attacks.
Nonce *string `json:"nonce,omitempty"`
// Custom object that allows to specify additional key-value parameters: scope: A string value containing additional permissions that RP needs to request, for example \" drive.readonly calendar.readonly\" nonce: A random string to ensure the response is issued for this specific request. Prevents replay attacks. Other custom key-value parameters. Note: parameters is supported from Chrome 132.
Parameters *map[string]string `json:"parameters,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Provider Provider
// NewProvider instantiates a new Provider 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 NewProvider() *Provider {
this := Provider{}
return &this
}
// NewProviderWithDefaults instantiates a new Provider 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 NewProviderWithDefaults() *Provider {
this := Provider{}
return &this
}
// GetClientId returns the ClientId field value if set, zero value otherwise.
func (o *Provider) GetClientId() string {
if o == nil || IsNil(o.ClientId) {
var ret string
return ret
}
return *o.ClientId
}
// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetClientIdOk() (*string, bool) {
if o == nil || IsNil(o.ClientId) {
return nil, false
}
return o.ClientId, true
}
// HasClientId returns a boolean if a field has been set.
func (o *Provider) HasClientId() bool {
if o != nil && !IsNil(o.ClientId) {
return true
}
return false
}
// SetClientId gets a reference to the given string and assigns it to the ClientId field.
func (o *Provider) SetClientId(v string) {
o.ClientId = &v
}
// GetConfigUrl returns the ConfigUrl field value if set, zero value otherwise.
func (o *Provider) GetConfigUrl() string {
if o == nil || IsNil(o.ConfigUrl) {
var ret string
return ret
}
return *o.ConfigUrl
}
// GetConfigUrlOk returns a tuple with the ConfigUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetConfigUrlOk() (*string, bool) {
if o == nil || IsNil(o.ConfigUrl) {
return nil, false
}
return o.ConfigUrl, true
}
// HasConfigUrl returns a boolean if a field has been set.
func (o *Provider) HasConfigUrl() bool {
if o != nil && !IsNil(o.ConfigUrl) {
return true
}
return false
}
// SetConfigUrl gets a reference to the given string and assigns it to the ConfigUrl field.
func (o *Provider) SetConfigUrl(v string) {
o.ConfigUrl = &v
}
// GetDomainHint returns the DomainHint field value if set, zero value otherwise.
func (o *Provider) GetDomainHint() string {
if o == nil || IsNil(o.DomainHint) {
var ret string
return ret
}
return *o.DomainHint
}
// GetDomainHintOk returns a tuple with the DomainHint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetDomainHintOk() (*string, bool) {
if o == nil || IsNil(o.DomainHint) {
return nil, false
}
return o.DomainHint, true
}
// HasDomainHint returns a boolean if a field has been set.
func (o *Provider) HasDomainHint() bool {
if o != nil && !IsNil(o.DomainHint) {
return true
}
return false
}
// SetDomainHint gets a reference to the given string and assigns it to the DomainHint field.
func (o *Provider) SetDomainHint(v string) {
o.DomainHint = &v
}
// GetFields returns the Fields field value if set, zero value otherwise.
func (o *Provider) GetFields() []string {
if o == nil || IsNil(o.Fields) {
var ret []string
return ret
}
return o.Fields
}
// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetFieldsOk() ([]string, bool) {
if o == nil || IsNil(o.Fields) {
return nil, false
}
return o.Fields, true
}
// HasFields returns a boolean if a field has been set.
func (o *Provider) HasFields() bool {
if o != nil && !IsNil(o.Fields) {
return true
}
return false
}
// SetFields gets a reference to the given []string and assigns it to the Fields field.
func (o *Provider) SetFields(v []string) {
o.Fields = v
}
// GetLoginHint returns the LoginHint field value if set, zero value otherwise.
func (o *Provider) GetLoginHint() string {
if o == nil || IsNil(o.LoginHint) {
var ret string
return ret
}
return *o.LoginHint
}
// GetLoginHintOk returns a tuple with the LoginHint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetLoginHintOk() (*string, bool) {
if o == nil || IsNil(o.LoginHint) {
return nil, false
}
return o.LoginHint, true
}
// HasLoginHint returns a boolean if a field has been set.
func (o *Provider) HasLoginHint() bool {
if o != nil && !IsNil(o.LoginHint) {
return true
}
return false
}
// SetLoginHint gets a reference to the given string and assigns it to the LoginHint field.
func (o *Provider) SetLoginHint(v string) {
o.LoginHint = &v
}
// GetNonce returns the Nonce field value if set, zero value otherwise.
func (o *Provider) GetNonce() string {
if o == nil || IsNil(o.Nonce) {
var ret string
return ret
}
return *o.Nonce
}
// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetNonceOk() (*string, bool) {
if o == nil || IsNil(o.Nonce) {
return nil, false
}
return o.Nonce, true
}
// HasNonce returns a boolean if a field has been set.
func (o *Provider) HasNonce() bool {
if o != nil && !IsNil(o.Nonce) {
return true
}
return false
}
// SetNonce gets a reference to the given string and assigns it to the Nonce field.
func (o *Provider) SetNonce(v string) {
o.Nonce = &v
}
// GetParameters returns the Parameters field value if set, zero value otherwise.
func (o *Provider) GetParameters() map[string]string {
if o == nil || IsNil(o.Parameters) {
var ret map[string]string
return ret
}
return *o.Parameters
}
// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetParametersOk() (*map[string]string, bool) {
if o == nil || IsNil(o.Parameters) {
return nil, false
}
return o.Parameters, true
}
// HasParameters returns a boolean if a field has been set.
func (o *Provider) HasParameters() bool {
if o != nil && !IsNil(o.Parameters) {
return true
}
return false
}
// SetParameters gets a reference to the given map[string]string and assigns it to the Parameters field.
func (o *Provider) SetParameters(v map[string]string) {
o.Parameters = &v
}
func (o Provider) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Provider) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ClientId) {
toSerialize["client_id"] = o.ClientId
}
if !IsNil(o.ConfigUrl) {
toSerialize["config_url"] = o.ConfigUrl
}
if !IsNil(o.DomainHint) {
toSerialize["domain_hint"] = o.DomainHint
}
if !IsNil(o.Fields) {
toSerialize["fields"] = o.Fields
}
if !IsNil(o.LoginHint) {
toSerialize["login_hint"] = o.LoginHint
}
if !IsNil(o.Nonce) {
toSerialize["nonce"] = o.Nonce
}
if !IsNil(o.Parameters) {
toSerialize["parameters"] = o.Parameters
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Provider) UnmarshalJSON(data []byte) (err error) {
varProvider := _Provider{}
err = json.Unmarshal(data, &varProvider)
if err != nil {
return err
}
*o = Provider(varProvider)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "client_id")
delete(additionalProperties, "config_url")
delete(additionalProperties, "domain_hint")
delete(additionalProperties, "fields")
delete(additionalProperties, "login_hint")
delete(additionalProperties, "nonce")
delete(additionalProperties, "parameters")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProvider struct {
value *Provider
isSet bool
}
func (v NullableProvider) Get() *Provider {
return v.value
}
func (v *NullableProvider) Set(val *Provider) {
v.value = val
v.isSet = true
}
func (v NullableProvider) IsSet() bool {
return v.isSet
}
func (v *NullableProvider) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProvider(val *Provider) *NullableProvider {
return &NullableProvider{value: val, isSet: true}
}
func (v NullableProvider) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProvider) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}