hipcall 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 072b7a0cc008aca2610f483131fb18c9d884d0cb1dc9a3001393986f6b5c7348
4
- data.tar.gz: f31f1a70e20bb86cc2fea7c3450278ea18c9dbc1ab5721f30215467bc8aa348e
3
+ metadata.gz: 33548822c10c31fae51a043b9301c8db7977fc016b75dbf2de68229001c9e87e
4
+ data.tar.gz: beeea3ad16d0d6ddf22c97a305670cff873f25ff37f1bdfd569188a50f836a5f
5
5
  SHA512:
6
- metadata.gz: 1ea9402937bef7e0cdadc121cb23013b027f76c72653cf2e2c4886f5ee542826a0943bdf99e6aaf77d11e1c38ba80888e1b661253d8c48e1fb8d0ae2802a0884
7
- data.tar.gz: 7d76e148e92da353a8affa155bc5816eb17c1f4f79999feec23edab633e9273dc2da847356cc81e2144b7c62cd52066b2b55015db2f1b1acb2d8fc9d44ac56fc
6
+ metadata.gz: 2c694a802279ff03c8d1fa26d254a0edd4fe42513f8a164135e425b2b3bdd9466a36bb44557496b6ea5035b99f5d3e176ee60ba5e7cc58bd4affbfe50effc5e4
7
+ data.tar.gz: 41c40f8faa2212aea7f5c4f46a05825218eecdbb4f951b354ec06670e287c12eb047e6e267391f0ddc6e45076a232e74c876ae74d5d1ec0001ff5c7d7759fe5e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.3.0
4
+
5
+ - Add tags to Contact
6
+ - Remove tags from Contact.
7
+ - Add tags to Company
8
+ - Remove tags from Company.
9
+
3
10
  ## v2.2.0
4
11
 
5
12
  ### Features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hipcall (2.0.0)
4
+ hipcall (2.2.0)
5
5
  faraday (~> 1.10)
6
6
  faraday_middleware (~> 1.2)
7
7
 
@@ -70,7 +70,6 @@ PLATFORMS
70
70
  x86_64-linux
71
71
 
72
72
  DEPENDENCIES
73
- faraday (~> 1.10, >= 1.10.3)
74
73
  hipcall!
75
74
  minitest (>= 5.0.5)
76
75
  rake (~> 13.0)
data/README.md CHANGED
@@ -40,6 +40,38 @@ cdr_uuid = "caedfd1b-25ec-447e-ad87-3b7eb3d358ea"
40
40
  cdr = hipcall.cdrs.retrieve(year: year, mounth: mounth, day: day, cdr_uuid: cdr_uuid)
41
41
  ```
42
42
 
43
+ ### Company resource
44
+
45
+ #### Add tags to company
46
+
47
+ ```ruby
48
+ # Add tags to company
49
+ tags = hipcall.companies.create_tags(company_id: 1, tags: ["tag1", "tag2"]);
50
+ ```
51
+
52
+ #### Remove a tag from company
53
+
54
+ ```ruby
55
+ # Remove a tag from company
56
+ hipcall.companies.delete_tags(company_id: 1, tag_id: 1);
57
+ ```
58
+
59
+ ### Contact resource
60
+
61
+ #### Add tags to contact
62
+
63
+ ```ruby
64
+ # Add tags to contact
65
+ tags = hipcall.contacts.create_tags(contact_id: 1, tags: ["tag1", "tag2"]);
66
+ ```
67
+
68
+ #### Remove a tag from contact
69
+
70
+ ```ruby
71
+ # Remove a tag from contact
72
+ hipcall.contacts.delete_tags(contact_id: 1, tag_id: 1);
73
+ ```
74
+
43
75
  ### Comment resource
44
76
 
45
77
  ```ruby
@@ -110,8 +142,6 @@ users = hipcall.users.list
110
142
  user = hipcall.users.retrieve(user_id: 1)
111
143
  ```
112
144
 
113
-
114
-
115
145
  ## Contributing
116
146
 
117
147
  Bug reports and pull requests are welcome on GitHub at https://github.com/hipcall/ruby-sdk .
@@ -122,4 +152,5 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/hipcal
122
152
  rake test
123
153
  rake build
124
154
  sudo gem install --local pkg/hipcall-X.X.X.gem
155
+ gem push pkg/hipcall-x.x.x.gem
125
156
  ```
@@ -30,6 +30,14 @@ module HipcallSdk
30
30
  CommentResource.new(self)
31
31
  end
32
32
 
33
+ def companies
34
+ CompanyResource.new(self)
35
+ end
36
+
37
+ def contacts
38
+ ContactResource.new(self)
39
+ end
40
+
33
41
  def extensions
34
42
  ExtensionResource.new(self)
35
43
  end
@@ -0,0 +1,4 @@
1
+ module HipcallSdk
2
+ class Company < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HipcallSdk
2
+ class Contact < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HipcallSdk
2
+ class Tag < Object
3
+ end
4
+ end
@@ -0,0 +1,12 @@
1
+ module HipcallSdk
2
+ class CompanyResource < Resource
3
+ def create_tags(company_id:, **attributes)
4
+ response = post_request("companies/#{company_id}/tags", body: attributes)
5
+ Collection.from_response(response, key: "data", type: Tag)
6
+ end
7
+
8
+ def delete_tags(company_id:, tag_id:)
9
+ delete_request("companies/#{company_id}/tags/#{tag_id}")
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module HipcallSdk
2
+ class ContactResource < Resource
3
+ def create_tags(contact_id:, **attributes)
4
+ response = post_request("contacts/#{contact_id}/tags", body: attributes)
5
+ Collection.from_response(response, key: "data", type: Tag)
6
+ end
7
+
8
+ def delete_tags(contact_id:, tag_id:)
9
+ delete_request("contacts/#{contact_id}/tags/#{tag_id}")
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HipcallSdk
4
- VERSION = "2.2.0"
4
+ VERSION = "2.3.0"
5
5
  end
data/lib/hipcall_sdk.rb CHANGED
@@ -10,15 +10,20 @@ module HipcallSdk
10
10
  autoload :Resource, "hipcall/resource"
11
11
 
12
12
  autoload :Cdr, "hipcall/objects/cdr"
13
+ autoload :Contact, "hipcall/objects/contact"
14
+ autoload :Company, "hipcall/objects/company"
13
15
  autoload :Comment, "hipcall/objects/comment"
14
16
  autoload :Extension, "hipcall/objects/extension"
15
17
  autoload :Greeting, "hipcall/objects/greeting"
16
18
  autoload :Number, "hipcall/objects/number"
19
+ autoload :Tag, "hipcall/objects/tag"
17
20
  autoload :Task, "hipcall/objects/task"
18
21
  autoload :Team, "hipcall/objects/team"
19
22
  autoload :User, "hipcall/objects/user"
20
23
 
21
24
  autoload :CdrResource, "hipcall/resources/cdrs"
25
+ autoload :ContactResource, "hipcall/resources/contacts"
26
+ autoload :CompanyResource, "hipcall/resources/companies"
22
27
  autoload :CommentResource, "hipcall/resources/comments"
23
28
  autoload :ExtensionResource, "hipcall/resources/extensions"
24
29
  autoload :GreetingResource, "hipcall/resources/greetings"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hipcall
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hipcall Development Team
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-03-18 00:00:00.000000000 Z
13
+ date: 2023-04-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -62,15 +62,20 @@ files:
62
62
  - lib/hipcall/object.rb
63
63
  - lib/hipcall/objects/cdr.rb
64
64
  - lib/hipcall/objects/comment.rb
65
+ - lib/hipcall/objects/company.rb
66
+ - lib/hipcall/objects/contact.rb
65
67
  - lib/hipcall/objects/extension.rb
66
68
  - lib/hipcall/objects/greeting.rb
67
69
  - lib/hipcall/objects/number.rb
70
+ - lib/hipcall/objects/tag.rb
68
71
  - lib/hipcall/objects/task.rb
69
72
  - lib/hipcall/objects/team.rb
70
73
  - lib/hipcall/objects/user.rb
71
74
  - lib/hipcall/resource.rb
72
75
  - lib/hipcall/resources/cdrs.rb
73
76
  - lib/hipcall/resources/comments.rb
77
+ - lib/hipcall/resources/companies.rb
78
+ - lib/hipcall/resources/contacts.rb
74
79
  - lib/hipcall/resources/extensions.rb
75
80
  - lib/hipcall/resources/greetings.rb
76
81
  - lib/hipcall/resources/numbers.rb