##
# This code was generated by
# \ / _    _  _|   _  _
#  | (_)\/(_)(_|\/| |(/_  v1.0.0
#       /       /
#
# frozen_string_literal: true

module Twilio
  module REST
    class Numbers < Domain
      class V2 < Version
        class RegulatoryComplianceList < ListResource
          class BundleContext < InstanceContext
            ##
            # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
            class BundleCopyList < ListResource
              ##
              # Initialize the BundleCopyList
              # @param [Version] version Version that contains the resource
              # @param [String] bundle_sid The unique string that we created to identify the
              #   Bundle resource.
              # @return [BundleCopyList] BundleCopyList
              def initialize(version, bundle_sid: nil)
                super(version)

                # Path Solution
                @solution = {bundle_sid: bundle_sid}
                @uri = "/RegulatoryCompliance/Bundles/#{@solution[:bundle_sid]}/Copies"
              end

              ##
              # Create the BundleCopyInstance
              # @param [String] friendly_name The string that you assigned to describe the
              #   copied bundle.
              # @return [BundleCopyInstance] Created BundleCopyInstance
              def create(friendly_name: :unset)
                data = Twilio::Values.of({'FriendlyName' => friendly_name, })

                payload = @version.create('POST', @uri, data: data)

                BundleCopyInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
              end

              ##
              # Provide a user friendly representation
              def to_s
                '#<Twilio.Numbers.V2.BundleCopyList>'
              end
            end

            ##
            # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
            class BundleCopyPage < Page
              ##
              # Initialize the BundleCopyPage
              # @param [Version] version Version that contains the resource
              # @param [Response] response Response from the API
              # @param [Hash] solution Path solution for the resource
              # @return [BundleCopyPage] BundleCopyPage
              def initialize(version, response, solution)
                super(version, response)

                # Path Solution
                @solution = solution
              end

              ##
              # Build an instance of BundleCopyInstance
              # @param [Hash] payload Payload response from the API
              # @return [BundleCopyInstance] BundleCopyInstance
              def get_instance(payload)
                BundleCopyInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
              end

              ##
              # Provide a user friendly representation
              def to_s
                '<Twilio.Numbers.V2.BundleCopyPage>'
              end
            end

            ##
            # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
            class BundleCopyInstance < InstanceResource
              ##
              # Initialize the BundleCopyInstance
              # @param [Version] version Version that contains the resource
              # @param [Hash] payload payload that contains response from Twilio
              # @param [String] bundle_sid The unique string that we created to identify the
              #   Bundle resource.
              # @return [BundleCopyInstance] BundleCopyInstance
              def initialize(version, payload, bundle_sid: nil)
                super(version)

                # Marshaled Properties
                @properties = {
                    'sid' => payload['sid'],
                    'account_sid' => payload['account_sid'],
                    'regulation_sid' => payload['regulation_sid'],
                    'friendly_name' => payload['friendly_name'],
                    'status' => payload['status'],
                    'valid_until' => Twilio.deserialize_iso8601_datetime(payload['valid_until']),
                    'email' => payload['email'],
                    'status_callback' => payload['status_callback'],
                    'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
                    'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
                }
              end

              ##
              # @return [String] The unique string that identifies the resource
              def sid
                @properties['sid']
              end

              ##
              # @return [String] The SID of the Account that created the resource
              def account_sid
                @properties['account_sid']
              end

              ##
              # @return [String] The unique string of a regulation
              def regulation_sid
                @properties['regulation_sid']
              end

              ##
              # @return [String] The string that you assigned to describe the resource
              def friendly_name
                @properties['friendly_name']
              end

              ##
              # @return [bundle_copy.Status] The verification status of the Bundle resource
              def status
                @properties['status']
              end

              ##
              # @return [Time] The ISO 8601 date and time in GMT when the resource will be valid until
              def valid_until
                @properties['valid_until']
              end

              ##
              # @return [String] The email address
              def email
                @properties['email']
              end

              ##
              # @return [String] The URL we call to inform your application of status changes
              def status_callback
                @properties['status_callback']
              end

              ##
              # @return [Time] The ISO 8601 date and time in GMT when the resource was created
              def date_created
                @properties['date_created']
              end

              ##
              # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
              def date_updated
                @properties['date_updated']
              end

              ##
              # Provide a user friendly representation
              def to_s
                "<Twilio.Numbers.V2.BundleCopyInstance>"
              end

              ##
              # Provide a detailed, user friendly representation
              def inspect
                "<Twilio.Numbers.V2.BundleCopyInstance>"
              end
            end
          end
        end
      end
    end
  end
end