Class: Unitpost::Resources::ContactFields

Inherits:
Base
  • Object
show all
Defined in:
lib/unitpost/resources.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Unitpost::Resources::Base

Instance Method Details

#create(body) ⇒ Object



166
167
168
# File 'lib/unitpost/resources.rb', line 166

def create(body)
  @http.request("POST", "/contact-fields", body: body)
end

#delete(id) ⇒ Object



178
179
180
# File 'lib/unitpost/resources.rb', line 178

def delete(id)
  @http.request("DELETE", "/contact-fields/#{enc(id)}")
end

#get(id) ⇒ Object



170
171
172
# File 'lib/unitpost/resources.rb', line 170

def get(id)
  @http.request("GET", "/contact-fields/#{enc(id)}")
end

#list(limit: nil, after: nil, before: nil) ⇒ Object



158
159
160
# File 'lib/unitpost/resources.rb', line 158

def list(limit: nil, after: nil, before: nil)
  @http.request("GET", "/contact-fields", query: list_params(limit: limit, after: after, before: before))
end

#list_all(**params) ⇒ Object



162
163
164
# File 'lib/unitpost/resources.rb', line 162

def list_all(**params)
  paginate("/contact-fields", params)
end

#rename(id, body) ⇒ Object



182
183
184
# File 'lib/unitpost/resources.rb', line 182

def rename(id, body)
  @http.request("POST", "/contact-fields/#{enc(id)}/rename", body: body)
end

#update(id, body) ⇒ Object



174
175
176
# File 'lib/unitpost/resources.rb', line 174

def update(id, body)
  @http.request("PATCH", "/contact-fields/#{enc(id)}", body: body)
end