Module: Insightly2::DSL::OpportunityCategories
- Included in:
- Insightly2::DSL
- Defined in:
- lib/insightly2/dsl/opportunity_categories.rb
Instance Method Summary collapse
-
#create_opportunity_category(category: nil) ⇒ Insightly2::Resources::OpportunityCategory?
POST /v2.1/OpportunityCategories Create an opportunity category.
-
#delete_opportunity_category(id: nil) ⇒ Faraday::Response
DELETE /v2.1/OpportunityCategories/id Delete an opportunity category.
-
#get_opportunity_categories ⇒ Array?
GET /v2.1/OpportunityCategories Get a list of opportunity categories.
-
#get_opportunity_category(id: nil) ⇒ Insightly2::Resources::OpportunityCategory?
GET /v2.1/OpportunityCategories/id Get an opportunity category.
-
#update_opportunity_category(category: nil) ⇒ Insightly2::Resources::OpportunityCategory?
PUT /v2.1/OpportunityCategories Update an opportunity category.
Instance Method Details
#create_opportunity_category(category: nil) ⇒ Insightly2::Resources::OpportunityCategory?
POST /v2.1/OpportunityCategories Create an opportunity category.
27 28 29 30 |
# File 'lib/insightly2/dsl/opportunity_categories.rb', line 27 def create_opportunity_category(category: nil) raise ArgumentError, "Category cannot be blank" if category.blank? Resources::OpportunityCategory.parse(request(:post, "OpportunityCategories", category)) end |
#delete_opportunity_category(id: nil) ⇒ Faraday::Response
DELETE /v2.1/OpportunityCategories/id Delete an opportunity category.
47 48 49 50 |
# File 'lib/insightly2/dsl/opportunity_categories.rb', line 47 def delete_opportunity_category(id: nil) raise ArgumentError, "ID cannot be blank" if id.blank? request(:delete, "OpportunityCategories/#{id}") end |
#get_opportunity_categories ⇒ Array?
GET /v2.1/OpportunityCategories Get a list of opportunity categories.
18 19 20 |
# File 'lib/insightly2/dsl/opportunity_categories.rb', line 18 def get_opportunity_categories Resources::OpportunityCategory.parse(request(:get, "OpportunityCategories")) end |
#get_opportunity_category(id: nil) ⇒ Insightly2::Resources::OpportunityCategory?
GET /v2.1/OpportunityCategories/id Get an opportunity category.
10 11 12 13 |
# File 'lib/insightly2/dsl/opportunity_categories.rb', line 10 def get_opportunity_category(id: nil) raise ArgumentError, "ID cannot be blank" if id.blank? Resources::OpportunityCategory.parse(request(:get, "OpportunityCategories/#{id}")) end |
#update_opportunity_category(category: nil) ⇒ Insightly2::Resources::OpportunityCategory?
PUT /v2.1/OpportunityCategories Update an opportunity category.
37 38 39 40 |
# File 'lib/insightly2/dsl/opportunity_categories.rb', line 37 def update_opportunity_category(category: nil) raise ArgumentError, "Category cannot be blank" if category.blank? Resources::OpportunityCategory.parse(request(:put, "OpportunityCategories", category)) end |