## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Messaging < Domain class V1 < Version ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class DomainCertsList < ListResource ## # Initialize the DomainCertsList # @param [Version] version Version that contains the resource # @return [DomainCertsList] DomainCertsList def initialize(version) super(version) # Path Solution @solution = {} end ## # Provide a user friendly representation def to_s '#' end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class DomainCertsPage < Page ## # Initialize the DomainCertsPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [DomainCertsPage] DomainCertsPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of DomainCertsInstance # @param [Hash] payload Payload response from the API # @return [DomainCertsInstance] DomainCertsInstance def get_instance(payload) DomainCertsInstance.new(@version, payload, ) end ## # Provide a user friendly representation def to_s '' end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class DomainCertsContext < InstanceContext ## # Initialize the DomainCertsContext # @param [Version] version Version that contains the resource # @param [String] domain_sid Unique string used to identify the domain that this # certificate should be associated with. # @return [DomainCertsContext] DomainCertsContext def initialize(version, domain_sid) super(version) # Path Solution @solution = {domain_sid: domain_sid, } @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/Certificate" end ## # Update the DomainCertsInstance # @param [String] tls_cert Contains the full TLS certificate and private for this # domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. # Twilio uses this information to process HTTPS traffic sent to your domain. # @return [DomainCertsInstance] Updated DomainCertsInstance def update(tls_cert: nil) data = Twilio::Values.of({'TlsCert' => tls_cert, }) payload = @version.update('POST', @uri, data: data) DomainCertsInstance.new(@version, payload, domain_sid: @solution[:domain_sid], ) end ## # Fetch the DomainCertsInstance # @return [DomainCertsInstance] Fetched DomainCertsInstance def fetch payload = @version.fetch('GET', @uri) DomainCertsInstance.new(@version, payload, domain_sid: @solution[:domain_sid], ) end ## # Delete the DomainCertsInstance # @return [Boolean] true if delete succeeds, false otherwise def delete @version.delete('DELETE', @uri) end ## # Provide a user friendly representation def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end end ## # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class DomainCertsInstance < InstanceResource ## # Initialize the DomainCertsInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] domain_sid Unique string used to identify the domain that this # certificate should be associated with. # @return [DomainCertsInstance] DomainCertsInstance def initialize(version, payload, domain_sid: nil) super(version) # Marshaled Properties @properties = { 'domain_sid' => payload['domain_sid'], 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']), 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'domain_name' => payload['domain_name'], 'certificate_sid' => payload['certificate_sid'], 'url' => payload['url'], 'cert_in_validation' => payload['cert_in_validation'], } # Context @instance_context = nil @params = {'domain_sid' => domain_sid || @properties['domain_sid'], } end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @return [DomainCertsContext] DomainCertsContext for this DomainCertsInstance def context unless @instance_context @instance_context = DomainCertsContext.new(@version, @params['domain_sid'], ) end @instance_context end ## # @return [String] The unique string that we created to identify the Domain resource. def domain_sid @properties['domain_sid'] end ## # @return [Time] Date that this Domain was last updated. def date_updated @properties['date_updated'] end ## # @return [Time] Expiration date for your private certificate. def date_expires @properties['date_expires'] end ## # @return [Time] Date this Domain SID was created. def date_created @properties['date_created'] end ## # @return [String] Full url path for this domain. def domain_name @properties['domain_name'] end ## # @return [String] The unique string that we created to identify this Certificate resource. def certificate_sid @properties['certificate_sid'] end ## # @return [String] The url def url @properties['url'] end ## # @return [Hash] New certificate in process of validation field def cert_in_validation @properties['cert_in_validation'] end ## # Update the DomainCertsInstance # @param [String] tls_cert Contains the full TLS certificate and private for this # domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. # Twilio uses this information to process HTTPS traffic sent to your domain. # @return [DomainCertsInstance] Updated DomainCertsInstance def update(tls_cert: nil) context.update(tls_cert: tls_cert, ) end ## # Fetch the DomainCertsInstance # @return [DomainCertsInstance] Fetched DomainCertsInstance def fetch context.fetch end ## # Delete the DomainCertsInstance # @return [Boolean] true if delete succeeds, false otherwise def delete context.delete end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end ## # Provide a detailed, user friendly representation def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end