Sha256: 516dcfb349f79495344ad0c3c41ba8e4c5c10577d29ce2d8d862bdd9c2706974

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Telnyx
  class PartnerCampaign < APIResource
    extend Telnyx::APIOperations::List
    extend Telnyx::APIOperations::Create
    include Telnyx::APIOperations::Delete
    include Telnyx::APIOperations::Save
    extend APIOperations::NestedResource

    ACTIONS = %w[mnoMetadata operationStatus].freeze
    ACTIONS.each do |action|
      nested_resource_class_methods action,
                                    path: %W[#{action}],
                                    operations: [:create],
                                    instance_methods: { create: action }
    end
    def sharing(params = {}, opts = {})
      resp, opts = request(:post, "/10dlc/campaign/sharing/#{campaignId.gsub(/\s+/, '+')}", params, opts)
      Util.convert_to_telnyx_object(resp.data, opts)
    end

    def self.resource_url(inner_id = nil)
      path_prefix = "/10dlc"
      object_path = "partnerCampaign"

      inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
    end

    OBJECT_NAME = "partnerCampaign".freeze
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
telnyx-3.0.5 lib/telnyx/partner_campaign.rb
telnyx-3.0.4 lib/telnyx/partner_campaign.rb
telnyx-3.0.3 lib/telnyx/partner_campaign.rb
telnyx-3.0.2 lib/telnyx/partner_campaign.rb