Sha256: 1c8206bb2d3d03070fc1cb72e038f95c2cf08b471931793d53013d21933141f2

Contents?: true

Size: 907 Bytes

Versions: 1

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

module Tikkie
  module Api
    module V1
      module Requests
        # Platforms operations at Tikkie.
        class Platforms
          def initialize(request)
            @request = request
          end

          def list
            response = @request.get("/tikkie/platforms")
            Tikkie::Api::V1::Responses::Platforms.new(response)
          end

          def create(options = {})
            params = {
              name: options.fetch(:name),
              phoneNumber: options.fetch(:phone_number),
              platformUsage: options.fetch(:platform_usage),
              email: options[:email],
              notificationUrl: options[:notification_url]
            }
            response = @request.post("/tikkie/platforms", params)

            Tikkie::Api::V1::Responses::Platform.new(response)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tikkie-api-2.0.0 lib/tikkie/api/v1/requests/platforms.rb