Module: SmartHR::Client::CrewCustomFieldTemplateMethods

Included in:
SmartHR::Client
Defined in:
lib/smarthr/client/crew_custom_field_template_methods.rb

Instance Method Summary collapse

Instance Method Details

#create_crew_custom_field_template(body:) {|response_body, response_header| ... } ⇒ Hashie::Mash

Create a new crew custom field template

Parameters:

  • body (Hash)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

Returns:

  • (Hashie::Mash)

See Also:



80
81
82
# File 'lib/smarthr/client/crew_custom_field_template_methods.rb', line 80

def create_crew_custom_field_template(body:, &block)
  post("/crew_custom_field_templates", body, &block)
end

#destroy_crew_custom_field_template(id:) {|response_body, response_header| ... } ⇒ Object

Delete the crew custom field template

Parameters:

  • id (String)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

See Also:



11
12
13
# File 'lib/smarthr/client/crew_custom_field_template_methods.rb', line 11

def destroy_crew_custom_field_template(id:, &block)
  delete("/crew_custom_field_templates/#{id}", &block)
end

#find_crew_custom_field_template(id:, embed_group: false) {|response_body, response_header| ... } ⇒ Hashie::Mash

Get the crew custom field template

Parameters:

  • id (String)
  • embed_group (Boolean) (defaults to: false)

    Whether or not to embed group

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

Returns:

  • (Hashie::Mash)

See Also:



27
28
29
# File 'lib/smarthr/client/crew_custom_field_template_methods.rb', line 27

def find_crew_custom_field_template(id:, embed_group: false, &block)
  get("/crew_custom_field_templates/#{id}", embed: embed_group ? 'group' : nil, &block)
end

#get_crew_custom_field_templates(page: 1, per_page: 10, embed_group: false) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>

Get the list of crew custom field templates

Parameters:

  • page (Integer) (defaults to: 1)
  • per_page (Integer) (defaults to: 10)
  • embed_group (Boolean) (defaults to: false)

    Whether or not to embed group

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Array<Hashie::Mash>)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

Returns:

  • (Array<Hashie::Mash>)

See Also:



60
61
62
63
64
65
66
67
# File 'lib/smarthr/client/crew_custom_field_template_methods.rb', line 60

def get_crew_custom_field_templates(page: 1, per_page: 10, embed_group: false, &block)
  get("/crew_custom_field_templates",
    page: page,
    per_page: per_page,
    embed: embed_group ? 'group' : nil,
    &block
  )
end

#update_crew_custom_field_template(id:, body:) {|response_body, response_header| ... } ⇒ Hashie::Mash

Change the data of the specified template

Parameters:

  • id (String)
  • body (Hash)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Hashie::Mash)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-Rate-Limit-Limit, X-Rate-Limit-Reset, X-Rate-Limit-Remaining)

Returns:

  • (Hashie::Mash)

See Also:



43
44
45
# File 'lib/smarthr/client/crew_custom_field_template_methods.rb', line 43

def update_crew_custom_field_template(id:, body:, &block)
  patch("/crew_custom_field_templates/#{id}", body, &block)
end