class StytchB2B::SSO::SAML

def create_connection(

The type of this field is nilable +SAMLConnection+ (+object+).
The `SAML Connection` object affected by this API call. See the [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) for complete response field details.
connection::
The type of this field is +Integer+.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:

The type of this field is nilable +String+.
A human-readable display name for the connection.
display_name::
The type of this field is +String+.
Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
organization_id::
== Parameters:

Create a new SAML Connection.
def create_connection(
  organization_id:,
  display_name: nil
)
  request = {}
  request[:display_name] = display_name unless display_name.nil?
  post_request("/v1/b2b/sso/saml/#{organization_id}", request)
end

def delete_verification_certificate(

The type of this field is +Integer+.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +String+.
The ID of the certificate that was deleted.
certificate_id::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:

The type of this field is +String+.
The ID of the certificate to be deleted.
certificate_id::
The type of this field is +String+.
The ID of the SAML connection.
connection_id::
The type of this field is +String+.
The organization ID that the SAML connection belongs to.
organization_id::
== Parameters:

You may need to do this when rotating certificates from your IdP, since Stytch allows a maximum of 5 certificates per connection. There must always be at least one certificate per active connection.

Delete a SAML verification certificate.
def delete_verification_certificate(
  organization_id:,
  connection_id:,
  certificate_id:
)
  delete_request("/v1/b2b/sso/saml/#{organization_id}/connections/#{connection_id}/verification_certificates/#{certificate_id}")
end

def initialize(connection)

def initialize(connection)
  @connection = connection
end

def update_by_url(

The type of this field is nilable +SAMLConnection+ (+object+).
The `SAML Connection` object affected by this API call. See the [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) for complete response field details.
connection::
The type of this field is +Integer+.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:

The type of this field is +String+.
A URL that points to the IdP metadata. This will be provided by the IdP.
metadata_url::
The type of this field is +String+.
Globally unique UUID that identifies a specific SSO `connection_id` for a Member.
connection_id::
The type of this field is +String+.
Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
organization_id::
== Parameters:

* `attribute_mapping` (must be supplied using [Update SAML Connection](update-saml-connection))
* `x509_certificate`
* `idp_entity_id`
* `idp_sso_url`
A newly created connection will not become active until all the following are provided:

Used to update an existing SAML connection using an IDP metadata URL.
def update_by_url(
  organization_id:,
  connection_id:,
  metadata_url:
)
  request = {
    metadata_url: metadata_url
  }
  put_request("/v1/b2b/sso/saml/#{organization_id}/connections/#{connection_id}/url", request)
end

def update_connection(

The type of this field is nilable +SAMLConnection+ (+object+).
The `SAML Connection` object affected by this API call. See the [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) for complete response field details.
connection::
The type of this field is +Integer+.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:

The type of this field is nilable +String+.
An alternative URL to use for the Audience Restriction. This value can be used when you wish to migrate an existing SAML integration to Stytch with zero downtime.
alternative_audience_uri::
The type of this field is nilable +String+.
The URL for which assertions for login requests will be sent. This will be provided by the IdP.
idp_sso_url::
The type of this field is nilable +String+.
A certificate that Stytch will use to verify the sign-in assertion sent by the IdP, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format. See our [X509 guide](https://stytch.com/docs/b2b/api/saml-certificates) for more info.
x509_certificate::
The type of this field is nilable +object+.
An object that represents the attributes used to identify a Member. This object will map the IdP-defined User attributes to Stytch-specific values. Required attributes: `email` and one of `full_name` or `first_name` and `last_name`.
attribute_mapping::
The type of this field is nilable +String+.
A human-readable display name for the connection.
display_name::
The type of this field is nilable +String+.
A globally unique name for the IdP. This will be provided by the IdP.
idp_entity_id::
The type of this field is +String+.
Globally unique UUID that identifies a specific SSO `connection_id` for a Member.
connection_id::
The type of this field is +String+.
Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
organization_id::
== Parameters:

* `x509_certificate`
* `idp_entity_id`
* `attribute_mapping`
* `idp_sso_url`
Note that a newly created connection will not become active until all of the following are provided:

Updates an existing SAML connection.
def update_connection(
  organization_id:,
  connection_id:,
  idp_entity_id: nil,
  display_name: nil,
  attribute_mapping: nil,
  x509_certificate: nil,
  idp_sso_url: nil,
  alternative_audience_uri: nil
)
  request = {}
  request[:idp_entity_id] = idp_entity_id unless idp_entity_id.nil?
  request[:display_name] = display_name unless display_name.nil?
  request[:attribute_mapping] = attribute_mapping unless attribute_mapping.nil?
  request[:x509_certificate] = x509_certificate unless x509_certificate.nil?
  request[:idp_sso_url] = idp_sso_url unless idp_sso_url.nil?
  request[:alternative_audience_uri] = alternative_audience_uri unless alternative_audience_uri.nil?
  put_request("/v1/b2b/sso/saml/#{organization_id}/connections/#{connection_id}", request)
end