Sha256: 2c10e019cb0d4ead19b7a3c04626fd694f9c5da206f68d9463b00714ea2fdaf5

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

# frozen_string_literal: true

module NgrokAPI
  ##
  # Low-level api client for communicating with Ngrok's HTTP API.
  # Use this object to instantiate your clients.
  class Client
    def initialize(
      api_key:,
      base_url: 'https://api.ngrok.com'
    )
      @client = NgrokAPI::HttpClient.new(api_key: api_key, base_url: base_url)
    end

    ##
    # Creates and returns an instance of a NgrokAPI::Services::ApiKeysClient
    #
    # @return [NgrokAPI::Services::ApiKeysClient]
    def api_keys
      @_api_keys ||= NgrokAPI::Services::ApiKeysClient.new(client: @client)
    end

    ##
    # Creates and returns an instance of a NgrokAPI::Services::EndpointConfigurationsClient
    #
    # @return [NgrokAPI::Services::EndpointConfigurationsClient]
    def endpoint_configurations
      @_endpoint_configurations ||= NgrokAPI::Services::EndpointConfigurationsClient.new(
        client: @client
      )
    end

    ##
    # Creates and returns an instance of a NgrokAPI::Services::ReservedDomainsClient
    #
    # @return [NgrokAPI::Services::ReservedDomainsClient]
    def reserved_domains
      @_reserved_domains ||= NgrokAPI::Services::ReservedDomainsClient.new(client: @client)
    end

    ##
    # Creates and returns an instance of a NgrokAPI::Services::TlsCertificatesClient
    #
    # @return [NgrokAPI::Services::TlsCertificatesClient]
    def tls_certificates
      @_tls_certificates ||= NgrokAPI::Services::TlsCertificatesClient.new(client: @client)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ngrok-api-0.9.0 lib/ngrokapi/client.rb