Class: Smartsheet::UpdateRequests

Inherits:
Object
  • Object
show all
Defined in:
lib/smartsheet/endpoints/update_requests/update_requests.rb

Overview

Update Requests Endpoints

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ UpdateRequests



14
15
16
17
18
# File 'lib/smartsheet/endpoints/update_requests/update_requests.rb', line 14

def initialize(client)
  @client = client

  @sent = SentUpdateRequests.new(client)
end

Instance Attribute Details

#sentSentUpdateRequests (readonly)



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/smartsheet/endpoints/update_requests/update_requests.rb', line 10

class UpdateRequests
  attr_reader :client, :sent
  private :client

  def initialize(client)
    @client = client

    @sent = SentUpdateRequests.new(client)
  end

  def create(sheet_id:, body:, params: {}, header_overrides: {})
    endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'updaterequests'], body_type: :json)
    request_spec = Smartsheet::API::RequestSpec.new(
        params: params,
        header_overrides: header_overrides,
        body: body,
        sheet_id: sheet_id
    )
    client.make_request(endpoint_spec, request_spec)
  end

  def delete(sheet_id:, update_request_id:, params: {}, header_overrides: {})
    endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['sheets', :sheet_id, 'updaterequests', :update_request_id])
    request_spec = Smartsheet::API::RequestSpec.new(
        params: params,
        header_overrides: header_overrides,
        sheet_id: sheet_id,
        update_request_id: update_request_id
    )
    client.make_request(endpoint_spec, request_spec)
  end

  def get(sheet_id:, update_request_id:, params: {}, header_overrides: {})
    endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'updaterequests', :update_request_id])
    request_spec = Smartsheet::API::RequestSpec.new(
        params: params,
        header_overrides: header_overrides,
        sheet_id: sheet_id,
        update_request_id: update_request_id
    )
    client.make_request(endpoint_spec, request_spec)
  end

  def list(sheet_id:, params: {}, header_overrides: {})
    endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'updaterequests'])
    request_spec = Smartsheet::API::RequestSpec.new(
        header_overrides: header_overrides,
        params: params,
        sheet_id: sheet_id
    )
    client.make_request(endpoint_spec, request_spec)
  end

  def update(sheet_id:, update_request_id:, body:, params: {}, header_overrides: {})
    endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['sheets', :sheet_id, 'updaterequests', :update_request_id], body_type: :json)
    request_spec = Smartsheet::API::RequestSpec.new(
        params: params,
        header_overrides: header_overrides,
        body: body,
        sheet_id: sheet_id,
        update_request_id: update_request_id
    )
    client.make_request(endpoint_spec, request_spec)
  end
end

Instance Method Details

#create(sheet_id:, body:, params: {}, header_overrides: {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/smartsheet/endpoints/update_requests/update_requests.rb', line 20

def create(sheet_id:, body:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:post, ['sheets', :sheet_id, 'updaterequests'], body_type: :json)
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      body: body,
      sheet_id: sheet_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#delete(sheet_id:, update_request_id:, params: {}, header_overrides: {}) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/smartsheet/endpoints/update_requests/update_requests.rb', line 31

def delete(sheet_id:, update_request_id:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:delete, ['sheets', :sheet_id, 'updaterequests', :update_request_id])
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      sheet_id: sheet_id,
      update_request_id: update_request_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#get(sheet_id:, update_request_id:, params: {}, header_overrides: {}) ⇒ Object



42
43
44
45
46
47
48
49
50
51
# File 'lib/smartsheet/endpoints/update_requests/update_requests.rb', line 42

def get(sheet_id:, update_request_id:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'updaterequests', :update_request_id])
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      sheet_id: sheet_id,
      update_request_id: update_request_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#list(sheet_id:, params: {}, header_overrides: {}) ⇒ Object



53
54
55
56
57
58
59
60
61
# File 'lib/smartsheet/endpoints/update_requests/update_requests.rb', line 53

def list(sheet_id:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:get, ['sheets', :sheet_id, 'updaterequests'])
  request_spec = Smartsheet::API::RequestSpec.new(
      header_overrides: header_overrides,
      params: params,
      sheet_id: sheet_id
  )
  client.make_request(endpoint_spec, request_spec)
end

#update(sheet_id:, update_request_id:, body:, params: {}, header_overrides: {}) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/smartsheet/endpoints/update_requests/update_requests.rb', line 63

def update(sheet_id:, update_request_id:, body:, params: {}, header_overrides: {})
  endpoint_spec = Smartsheet::API::EndpointSpec.new(:put, ['sheets', :sheet_id, 'updaterequests', :update_request_id], body_type: :json)
  request_spec = Smartsheet::API::RequestSpec.new(
      params: params,
      header_overrides: header_overrides,
      body: body,
      sheet_id: sheet_id,
      update_request_id: update_request_id
  )
  client.make_request(endpoint_spec, request_spec)
end