/*
* Ory APIs
*
* # Introduction Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. ## SDKs This document describes the APIs available in the Ory Network. The APIs are available as SDKs for the following languages: | Language | Download SDK | Documentation | | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Dart | [pub.dev](https://pub.dev/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/dart/README.md) | | .NET | [nuget.org](https://www.nuget.org/packages/Ory.Client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/dotnet/README.md) | | Elixir | [hex.pm](https://hex.pm/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/elixir/README.md) | | Go | [github.com](https://github.com/ory/client-go) | [README](https://github.com/ory/sdk/blob/master/clients/client/go/README.md) | | Java | [maven.org](https://search.maven.org/artifact/sh.ory/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/java/README.md) | | JavaScript | [npmjs.com](https://www.npmjs.com/package/@ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript/README.md) | | JavaScript (With fetch) | [npmjs.com](https://www.npmjs.com/package/@ory/client-fetch) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript-fetch/README.md) | | PHP | [packagist.org](https://packagist.org/packages/ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/php/README.md) | | Python | [pypi.org](https://pypi.org/project/ory-client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/python/README.md) | | Ruby | [rubygems.org](https://rubygems.org/gems/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/ruby/README.md) | | Rust | [crates.io](https://crates.io/crates/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/rust/README.md) |
*
* The version of the OpenAPI document: v1.22.38
* Contact: support@ory.sh
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// OAuth2ConsentSession : A completed OAuth 2.0 Consent Session.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OAuth2ConsentSession {
#[serde(rename = "consent_request", skip_serializing_if = "Option::is_none")]
pub consent_request: Option<Box<models::OAuth2ConsentRequest>>,
/// ConsentRequestID is the identifier of the consent request that initiated this consent session.
#[serde(rename = "consent_request_id", skip_serializing_if = "Option::is_none")]
pub consent_request_id: Option<String>,
#[serde(rename = "context", skip_serializing_if = "Option::is_none")]
pub context: Option<serde_json::Value>,
/// Audience Granted GrantedAudience sets the audience the user authorized the client to use. Should be a subset of `requested_access_token_audience`.
#[serde(rename = "grant_access_token_audience", skip_serializing_if = "Option::is_none")]
pub grant_access_token_audience: Option<Vec<String>>,
/// Scope Granted GrantScope sets the scope the user authorized the client to use. Should be a subset of `requested_scope`.
#[serde(rename = "grant_scope", skip_serializing_if = "Option::is_none")]
pub grant_scope: Option<Vec<String>>,
#[serde(rename = "handled_at", skip_serializing_if = "Option::is_none")]
pub handled_at: Option<String>,
/// Remember Consent Remember, if set to true, tells ORY Hydra to remember this consent authorization and reuse it if the same client asks the same user for the same, or a subset of, scope.
#[serde(rename = "remember", skip_serializing_if = "Option::is_none")]
pub remember: Option<bool>,
/// Remember Consent For RememberFor sets how long the consent authorization should be remembered for in seconds. If set to `0`, the authorization will be remembered indefinitely.
#[serde(rename = "remember_for", skip_serializing_if = "Option::is_none")]
pub remember_for: Option<i64>,
#[serde(rename = "session", skip_serializing_if = "Option::is_none")]
pub session: Option<Box<models::AcceptOAuth2ConsentRequestSession>>,
}
impl OAuth2ConsentSession {
/// A completed OAuth 2.0 Consent Session.
pub fn new() -> OAuth2ConsentSession {
OAuth2ConsentSession {
consent_request: None,
consent_request_id: None,
context: None,
grant_access_token_audience: None,
grant_scope: None,
handled_at: None,
remember: None,
remember_for: None,
session: None,
}
}
}