Class: FuelSDK::ET_CUDSupportRest

Inherits:
ET_GetSupportRest show all
Defined in:
lib/new.rb

Direct Known Subclasses

ET_Campaign, FuelSDK::ET_Campaign::Asset

Instance Attribute Summary

Attributes inherited from ET_GetSupportRest

#lastPageNumber, #urlProps, #urlPropsRequired

Attributes inherited from ET_BaseObject

#authStub, #endpoint, #lastRequestID, #obj, #props

Instance Method Summary collapse

Methods inherited from ET_GetSupportRest

#get, #getMoreResults

Methods inherited from ET_BaseObject

#initialize

Constructor Details

This class inherits a constructor from FuelSDK::ET_BaseObject

Instance Method Details

#deleteObject



782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
# File 'lib/new.rb', line 782

def delete()
  completeURL = @endpoint
  # All URL Props are required when doing Patch
  @urlProps.each do |value|
    if !@props || !@props.has_key?(value) then
      raise "Unable to process request due to missing required prop: #{value}"
    end
  end

  if @props and @props.is_a? Hash then
    @props.each do |k,v|
      if @urlProps.include?(k) then
        completeURL.sub!("{#{k}}", v)
      end
    end
  end

  ET_DeleteRest.new(@authStub, completeURL)
end

#patchObject



762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
# File 'lib/new.rb', line 762

def patch()
  completeURL = @endpoint
  # All URL Props are required when doing Patch
  @urlProps.each do |value|
    if !@props || !@props.has_key?(value) then
      raise "Unable to process request due to missing required prop: #{value}"
    end
  end

  if @props and @props.is_a? Hash then
    @props.each do |k,v|
      if @urlProps.include?(k) then
        completeURL.sub!("{#{k}}", v)
      end
    end
  end

  obj = ET_PatchRest.new(@authStub, completeURL, @props)
end

#postObject



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/new.rb', line 737

def post()
  completeURL = @endpoint

  if @props and @props.is_a? Hash then
    @props.each do |k,v|
      if @urlProps.include?(k) then
        completeURL.sub!("{#{k}}", v)
      end
    end
  end

  @urlPropsRequired.each do |value|
    if !@props || !@props.has_key?(value) then
      raise "Unable to process request due to missing required prop: #{value}"
    end
  end

  # Clean Optional Parameters from Endpoint URL first
  @urlProps.each do |value|
    completeURL.sub!("/{#{value}}", "")
  end

  ET_PostRest.new(@authStub, completeURL, @props)
end