Sha256: 4d4ffc06bdaa7d81c707e38eb1389fb973d593fbf70b307402ddc5dbc74ba414

Contents?: true

Size: 1.66 KB

Versions: 1

Compression:

Stored size: 1.66 KB

Contents

# frozen_string_literal: true

module NgrokAPI
  module Models
    class ReservedDomain
      attr_reader :client,
        :attrs,
        :id,
        :uri,
        :created_at,
        :description,
        :metadata,
        :domain,
        :region,
        :cname_target,
        :http_endpoint_configuration,
        :https_endpoint_configuration,
        :certificate,
        :certificate_management_policy,
        :certificate_management_status,
        :acme_challenge_cname_target

      def initialize(client: nil, attrs: {})
        @client = client
        @attrs = attrs
        @id = @attrs['id']
        @uri = @attrs['uri']
        @created_at = @attrs['created_at']
        @description = @attrs['description']
        @metadata = @attrs['metadata']
        @domain = @attrs['domain']
        @region = @attrs['region']
        @cname_target = @attrs['cname_target']
        @http_endpoint_configuration = @attrs['http_endpoint_configuration']
        @https_endpoint_configuration = @attrs['https_endpoint_configuration']
        @certificate = @attrs['certificate']
        @certificate_management_policy = @attrs['certificate_management_policy']
        @certificate_management_status = @attrs['certificate_management_status']
        @acme_challenge_cname_target = @attrs['acme_challenge_cname_target']
      end

      def ==(other)
        @attrs == other.attrs
      end

      def to_s
        @attrs.to_s
      end

      def to_h
        @attrs.to_h
      end

      ##
      # Delete a reserved domain.
      #
      # https://ngrok.com/docs/api#api-reserved-domains-delete
      def delete
        @client.delete(
          id: @id
        )
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ngrok-api-0.19.0 lib/ngrokapi/models/reserved_domain.rb