Module: BusinessInsightApiClient::Api::Calendar

Included in:
Client
Defined in:
lib/business_insight_api_client/api/calendars.rb

Overview

Calendar API based methods. This module contains methods to query the Calendar API.

Instance Method Summary collapse

Instance Method Details

#calendar_event(id) ⇒ Object

get: ‘/calendar/:id’

Parameters:

  • id (Integer)

    calendar id

See Also:



22
23
24
# File 'lib/business_insight_api_client/api/calendars.rb', line 22

def calendar_event(id)
  ::BusinessInsightApiClient::Mash.from_json client.get("/calendar/#{id}")
end

#calendar_events(animal_id, cycle_number = nil, type = nil) ⇒ Object

get: ‘/calendar’

Parameters:

  • animal_id (Integer)

    animal id

  • cycle_number (Integer) (defaults to: nil)

    (nil) cycle_number

  • type (String) (defaults to: nil)

    (nil) calendar type

See Also:



12
13
14
15
16
17
# File 'lib/business_insight_api_client/api/calendars.rb', line 12

def calendar_events(animal_id, cycle_number = nil, type = nil)
  body = { animal_id: animal_id }
  body[:cycle_number] = cycle_number if cycle_number
  body[:type] = type if type
  ::BusinessInsightApiClient::Mash.from_json client.get('/calendar', body: body)
end

#calendar_events_by_cycle(animal_id) ⇒ Object

get: ‘/calendar/by_cycle/’

Parameters:

  • animal_id (Integer)

    animal id

See Also:



39
40
41
42
# File 'lib/business_insight_api_client/api/calendars.rb', line 39

def calendar_events_by_cycle(animal_id)
  body = { animal_id: animal_id }
  ::BusinessInsightApiClient::Mash.from_json client.get('/calendar/by_cycle', body: body)
end

#calendar_events_current_cycle(animal_id, type = nil) ⇒ Object

get: ‘/calendar/current_cycle/’

Parameters:

  • animal_id (Integer)

    animal id

  • type (String) (defaults to: nil)

    (nil) calendar type

See Also:



30
31
32
33
34
# File 'lib/business_insight_api_client/api/calendars.rb', line 30

def calendar_events_current_cycle(animal_id, type=nil)
  body = { animal_id: animal_id }
  body[:type] = type if type
  ::BusinessInsightApiClient::Mash.from_json client.get('/calendar/current_cycle', body: body)
end

#create_birth_event(calendar_event = {}) ⇒ Object

post: ‘/calendar/birth_event’

Parameters:

  • calendar_event (Hash) (defaults to: {})

    calendar event to be created. See docs for parameters.

See Also:



47
48
49
# File 'lib/business_insight_api_client/api/calendars.rb', line 47

def create_birth_event(calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/birth_event', calendar_event.to_json)
end

#create_calving_event(calendar_event = {}) ⇒ Object

post: ‘/calendar/calving_event’

Parameters:

  • calendar_event (Hash) (defaults to: {})

    calendar event to be created. See docs for parameters.

See Also:



62
63
64
# File 'lib/business_insight_api_client/api/calendars.rb', line 62

def create_calving_event(calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/calving_event', calendar_event.to_json)
end

#create_dryoff_event(calendar_event = {}) ⇒ Object

post: ‘/calendar/dryoff_event’

Parameters:

  • calendar_event (Hash) (defaults to: {})

    calendar event to be created. See docs for parameters.

See Also:



77
78
79
# File 'lib/business_insight_api_client/api/calendars.rb', line 77

def create_dryoff_event(calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/dryoff_event', calendar_event.to_json)
end

#create_heat_event(calendar_event = {}) ⇒ Object

post: ‘/calendar/heat_event’

Parameters:

  • calendar_event (Hash) (defaults to: {})

    calendar event to be created. See docs for parameters.

See Also:



92
93
94
# File 'lib/business_insight_api_client/api/calendars.rb', line 92

def create_heat_event(calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/heat_event', calendar_event.to_json)
end

#create_insemination_event(calendar_event = {}) ⇒ Object

post: ‘/calendar/insemination_event’

Parameters:

  • calendar_event (Hash) (defaults to: {})

    calendar event to be created. See docs for parameters.

See Also:



122
123
124
# File 'lib/business_insight_api_client/api/calendars.rb', line 122

def create_insemination_event(calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/insemination_event', calendar_event.to_json)
end

#create_keep_open_event(calendar_event = {}) ⇒ Object

post: ‘/calendar/keep_open_event’

Parameters:

  • calendar_event (Hash) (defaults to: {})

    calendar event to be created. See docs for parameters.

See Also:



107
108
109
# File 'lib/business_insight_api_client/api/calendars.rb', line 107

def create_keep_open_event(calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/keep_open_event', calendar_event.to_json)
end

#create_pregnancy_check_event(calendar_event = {}) ⇒ Object

post: ‘/calendar/pregnancy_check_event’

Parameters:

  • calendar_event (Hash) (defaults to: {})

    calendar event to be created. See docs for parameters.

See Also:



137
138
139
# File 'lib/business_insight_api_client/api/calendars.rb', line 137

def create_pregnancy_check_event(calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.post('/calendar/pregnancy_check_event', calendar_event.to_json)
end

#delete_calendar_event(calendar_event_id) ⇒ Object

delete: ‘/calendar/:calendar_event_id’

Parameters:

  • calendar_event_id (Integer)

    calendar event to be deleted.

See Also:



152
153
154
# File 'lib/business_insight_api_client/api/calendars.rb', line 152

def delete_calendar_event(calendar_event_id)
  ::BusinessInsightApiClient::Mash.from_json client.delete("/calendar/#{calendar_event_id}")
end

#update_birth_event(calendar_event_id, calendar_event = {}) ⇒ Object

put: ‘/calendar/birth_event/:calendar_event_id’

Parameters:

  • calendar_event_id (Integer)

    calendar event to be updated.

  • calendar_event (Hash) (defaults to: {})

    ({}) parameters to be updated. See docs for parameters.

See Also:



55
56
57
# File 'lib/business_insight_api_client/api/calendars.rb', line 55

def update_birth_event(calendar_event_id, calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/birth_event/#{calendar_event_id}", calendar_event.to_json)
end

#update_calving_event(calendar_event_id, calendar_event = {}) ⇒ Object

put: ‘/calendar/calving_event/:calendar_event_id’

Parameters:

  • calendar_event_id (Integer)

    calendar event to be updated.

  • calendar_event (Hash) (defaults to: {})

    ({}) parameters to be updated. See docs for parameters.

See Also:



70
71
72
# File 'lib/business_insight_api_client/api/calendars.rb', line 70

def update_calving_event(calendar_event_id, calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/calving_event/#{calendar_event_id}", calendar_event.to_json)
end

#update_dryoff_event(calendar_event_id, calendar_event = {}) ⇒ Object

put: ‘/calendar/dryoff_event/:calendar_event_id’

Parameters:

  • calendar_event_id (Integer)

    calendar event to be updated.

  • calendar_event (Hash) (defaults to: {})

    ({}) parameters to be updated. See docs for parameters.

See Also:



85
86
87
# File 'lib/business_insight_api_client/api/calendars.rb', line 85

def update_dryoff_event(calendar_event_id, calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/dryoff_event/#{calendar_event_id}", calendar_event.to_json)
end

#update_heat_event(calendar_event_id, calendar_event = {}) ⇒ Object

put: ‘/calendar/heat_event/:calendar_event_id’

Parameters:

  • calendar_event_id (Integer)

    calendar event to be updated.

  • calendar_event (Hash) (defaults to: {})

    ({}) parameters to be updated. See docs for parameters.

See Also:



100
101
102
# File 'lib/business_insight_api_client/api/calendars.rb', line 100

def update_heat_event(calendar_event_id, calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/heat_event/#{calendar_event_id}", calendar_event.to_json)
end

#update_insemination_event(calendar_event_id, calendar_event = {}) ⇒ Object

put: ‘/calendar/insemination_event/:calendar_event_id’

Parameters:

  • calendar_event_id (Integer)

    calendar event to be updated.

  • calendar_event (Hash) (defaults to: {})

    ({}) parameters to be updated. See docs for parameters.

See Also:



130
131
132
# File 'lib/business_insight_api_client/api/calendars.rb', line 130

def update_insemination_event(calendar_event_id, calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/insemination_event/#{calendar_event_id}", calendar_event.to_json)
end

#update_keep_open_event(calendar_event_id, calendar_event = {}) ⇒ Object

put: ‘/calendar/keep_open_event/:calendar_event_id’

Parameters:

  • calendar_event_id (Integer)

    calendar event to be updated.

  • calendar_event (Hash) (defaults to: {})

    ({}) parameters to be updated. See docs for parameters.

See Also:



115
116
117
# File 'lib/business_insight_api_client/api/calendars.rb', line 115

def update_keep_open_event(calendar_event_id, calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/keep_open_event/#{calendar_event_id}", calendar_event.to_json)
end

#update_pregnancy_check_event(calendar_event_id, calendar_event = {}) ⇒ Object

put: ‘/calendar/pregnancy_check_event/:calendar_event_id’

Parameters:

  • calendar_event_id (Integer)

    calendar event to be updated.

  • calendar_event (Hash) (defaults to: {})

    ({}) parameters to be updated. See docs for parameters.

See Also:



145
146
147
# File 'lib/business_insight_api_client/api/calendars.rb', line 145

def update_pregnancy_check_event(calendar_event_id, calendar_event = {})
  ::BusinessInsightApiClient::Mash.from_json client.put("/calendar/pregnancy_check_event/#{calendar_event_id}", calendar_event.to_json)
end