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
-
#calendar_event(id) ⇒ Object
get: ‘/calendar/:id’.
-
#calendar_events(animal_id, cycle_number = nil, type = nil) ⇒ Object
get: ‘/calendar’.
-
#calendar_events_by_cycle(animal_id) ⇒ Object
get: ‘/calendar/by_cycle/’.
-
#calendar_events_current_cycle(animal_id, type = nil) ⇒ Object
get: ‘/calendar/current_cycle/’.
-
#create_birth_event(calendar_event = {}) ⇒ Object
post: ‘/calendar/birth_event’.
-
#create_calving_event(calendar_event = {}) ⇒ Object
post: ‘/calendar/calving_event’.
-
#create_dryoff_event(calendar_event = {}) ⇒ Object
post: ‘/calendar/dryoff_event’.
-
#create_heat_event(calendar_event = {}) ⇒ Object
post: ‘/calendar/heat_event’.
-
#create_insemination_event(calendar_event = {}) ⇒ Object
post: ‘/calendar/insemination_event’.
-
#create_keep_open_event(calendar_event = {}) ⇒ Object
post: ‘/calendar/keep_open_event’.
-
#create_pregnancy_check_event(calendar_event = {}) ⇒ Object
post: ‘/calendar/pregnancy_check_event’.
-
#delete_calendar_event(calendar_event_id) ⇒ Object
delete: ‘/calendar/:calendar_event_id’.
-
#update_birth_event(calendar_event_id, calendar_event = {}) ⇒ Object
put: ‘/calendar/birth_event/:calendar_event_id’.
-
#update_calving_event(calendar_event_id, calendar_event = {}) ⇒ Object
put: ‘/calendar/calving_event/:calendar_event_id’.
-
#update_dryoff_event(calendar_event_id, calendar_event = {}) ⇒ Object
put: ‘/calendar/dryoff_event/:calendar_event_id’.
-
#update_heat_event(calendar_event_id, calendar_event = {}) ⇒ Object
put: ‘/calendar/heat_event/:calendar_event_id’.
-
#update_insemination_event(calendar_event_id, calendar_event = {}) ⇒ Object
put: ‘/calendar/insemination_event/:calendar_event_id’.
-
#update_keep_open_event(calendar_event_id, calendar_event = {}) ⇒ Object
put: ‘/calendar/keep_open_event/:calendar_event_id’.
-
#update_pregnancy_check_event(calendar_event_id, calendar_event = {}) ⇒ Object
put: ‘/calendar/pregnancy_check_event/:calendar_event_id’.
Instance Method Details
#calendar_event(id) ⇒ Object
get: ‘/calendar/:id’
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’
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/’
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/’
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’
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’
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’
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’
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’
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’
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’
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’
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’
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’
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’
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’
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’
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’
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’
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 |