hipcall 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0714276b651ff95a6fde2b7c36c85acc5e6170065e4a8d07e52712543a35ae1c
4
- data.tar.gz: 80f7fb286ead1667610808cdccb697422976dc54b90fd33481aed108d1c4c829
3
+ metadata.gz: 3898ac66ac26f13ccb829f6969fe89b0595b3129cd2fbb747b045f58cb4ba25c
4
+ data.tar.gz: 055b881593bc0154d28cfd50e44d663067281dd54e2740b67ff7df52e59b61d9
5
5
  SHA512:
6
- metadata.gz: 343a8bfbf09322c45e6bd0b3f4149032b3039a01d95a3aef55fdd875be8e6b034ebcf51c511a42d7f4b2ad1413dfe63240bad0f93100c43592e3f662c6693e84
7
- data.tar.gz: b2d507c8517047aea14069905e5ad57aa11ed8bc5f95e93e0f7182a65b9f439388110c8a722133716c54dadc68c6f0d70bc85a03a07a1ebec075e42b4e8c9e6c
6
+ metadata.gz: 92ee173408c2ea56060d9637c6fb827155039344312981766a724dba0a0bf15d954d7806274569ecd0b0ff4a434051e6d218908e7acb4008b9d6aa779cf546e7
7
+ data.tar.gz: 53433259f647a88586d27377426905a2c2b8e168c7021ac1412c8c22b828d7e80c8b492749ecc48d1b5260690fe44712902c3288cdc6d7990a8f8a40420303d3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.0.0
4
+
5
+ ### Refactor
6
+
7
+ - Hipcall module name changed to HipcallSdk.
8
+
3
9
  ## v1.0.0
4
10
 
5
11
  ### Features
@@ -7,4 +13,4 @@
7
13
  - Add cdr resource
8
14
  - Add number resource
9
15
  - Add task resource
10
- - Add user resource
16
+ - Add user resource
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hipcall (1.0.0)
4
+ hipcall (2.0.0)
5
5
  faraday (~> 1.10)
6
6
  faraday_middleware (~> 1.2)
7
7
 
@@ -9,7 +9,7 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  ast (2.4.2)
12
- faraday (1.10.0)
12
+ faraday (1.10.3)
13
13
  faraday-em_http (~> 1.0)
14
14
  faraday-em_synchrony (~> 1.0)
15
15
  faraday-excon (~> 1.1)
@@ -35,7 +35,7 @@ GEM
35
35
  faraday_middleware (1.2.0)
36
36
  faraday (~> 1.0)
37
37
  minitest (5.16.2)
38
- multipart-post (2.2.3)
38
+ multipart-post (2.3.0)
39
39
  parallel (1.22.1)
40
40
  parser (3.1.2.0)
41
41
  ast (~> 2.4.1)
@@ -65,9 +65,12 @@ GEM
65
65
  unicode-display_width (2.2.0)
66
66
 
67
67
  PLATFORMS
68
+ arm64-darwin-21
69
+ x86_64-darwin-22
68
70
  x86_64-linux
69
71
 
70
72
  DEPENDENCIES
73
+ faraday (~> 1.10, >= 1.10.3)
71
74
  hipcall!
72
75
  minitest (>= 5.0.5)
73
76
  rake (~> 13.0)
data/README.md CHANGED
@@ -21,7 +21,9 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  ```ruby
24
- hipcall = Hipcall::Client.new(api_key: "YOUR_TOKEN_IS_HERE", version: "v20211124", base_url: "https://app.hipcall.com.tr/api/")
24
+ require "hipcall_sdk"
25
+
26
+ hipcall = HipcallSdk::Client.new(api_key: "YOUR_TOKEN_IS_HERE", version: "v20211124", base_url: "https://app.hipcall.com.tr/api/")
25
27
  ```
26
28
 
27
29
  ### Cdr resource
@@ -71,6 +73,22 @@ users = hipcall.users.list
71
73
  user = hipcall.users.retrieve(user_id: 1)
72
74
  ```
73
75
 
76
+ ### Comment resource
77
+
78
+ ```ruby
79
+ # Create
80
+ new_comment = hipcall.comments.create(commentable_type: 'company', commentable_id: 8777, content: 'Comment body, note, etc')
81
+ ```
82
+
74
83
  ## Contributing
75
84
 
76
85
  Bug reports and pull requests are welcome on GitHub at https://github.com/hipcall/ruby-sdk .
86
+
87
+
88
+ ### Some useful commands
89
+
90
+ ```
91
+ rake test
92
+ rake build
93
+ sudo gem install --local pkg/hipcall-X.X.X.gem
94
+ ```
data/bin/console CHANGED
@@ -11,7 +11,7 @@ require "hipcall"
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- client = Hipcall::Client.new(api_key: ENV["HIPCALL_API_KEY"])
14
+ client = HipcallSdk::Client.new(api_key: ENV["HIPCALL_API_KEY"])
15
15
 
16
16
  require "irb"
17
17
  IRB.start(__FILE__)
data/hipcall.gemspec CHANGED
@@ -4,8 +4,8 @@ require_relative "lib/hipcall/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "hipcall"
7
- spec.version = Hipcall::VERSION
8
- spec.authors = ["Hipcall Development Team", "Onur Ozgur OZKAN"]
7
+ spec.version = HipcallSdk::VERSION
8
+ spec.authors = ["Hipcall Development Team", "Onur Ozgur OZKAN", "Kendal BOZKURT"]
9
9
  spec.email = ["hello@hipcall.com"]
10
10
 
11
11
  spec.summary = "Hipcall's Ruby SDK"
@@ -1,7 +1,7 @@
1
1
  require "faraday"
2
2
  require "faraday_middleware"
3
3
 
4
- module Hipcall
4
+ module HipcallSdk
5
5
  class Client
6
6
  attr_reader :api_key, :version, :base_url, :adapter
7
7
 
@@ -29,6 +29,10 @@ module Hipcall
29
29
  UserResource.new(self)
30
30
  end
31
31
 
32
+ def comments
33
+ CommentResource.new(self)
34
+ end
35
+
32
36
  def connection
33
37
  @connection ||= Faraday.new (base_url + version) do |connection|
34
38
  connection.request :authorization, :Bearer, api_key
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class Collection
3
3
  attr_reader :data, :links, :meta
4
4
 
data/lib/hipcall/error.rb CHANGED
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class Error < StandardError
3
3
  end
4
4
  end
@@ -1,6 +1,6 @@
1
1
  require "ostruct"
2
2
 
3
- module Hipcall
3
+ module HipcallSdk
4
4
  class Object < OpenStruct
5
5
  def initialize(attributes)
6
6
  super to_ostruct(attributes)
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class Cdr < Object
3
3
  end
4
4
  end
@@ -0,0 +1,4 @@
1
+ module HipcallSdk
2
+ class Comment < Object
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class Number < Object
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class Task < Object
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class User < Object
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class Resource
3
3
  attr_reader :client
4
4
 
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class CdrResource < Resource
3
3
  def list(**params)
4
4
  response = get_request("cdrs", params: params)
@@ -0,0 +1,7 @@
1
+ module HipcallSdk
2
+ class CommentResource < Resource
3
+ def create(**attributes)
4
+ Comment.new post_request("comments", body: attributes).body.dig("data")
5
+ end
6
+ end
7
+ end
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class NumberResource < Resource
3
3
  def list(**params)
4
4
  response = get_request("numbers", params: params)
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class TaskResource < Resource
3
3
  def list(**params)
4
4
  response = get_request("tasks", params: params)
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  class UserResource < Resource
3
3
  def list(**params)
4
4
  response = get_request("users", params: params)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Hipcall
4
- VERSION = "1.0.0"
3
+ module HipcallSdk
4
+ VERSION = "2.1.0"
5
5
  end
@@ -2,21 +2,22 @@
2
2
 
3
3
  require_relative "hipcall/version"
4
4
 
5
- module Hipcall
5
+ module HipcallSdk
6
6
  autoload :Client, "hipcall/client"
7
7
  autoload :Collection, "hipcall/collection"
8
8
  autoload :Error, "hipcall/error"
9
9
  autoload :Object, "hipcall/object"
10
10
  autoload :Resource, "hipcall/resource"
11
11
 
12
-
13
12
  autoload :Cdr, "hipcall/objects/cdr"
14
13
  autoload :Number, "hipcall/objects/number"
15
14
  autoload :Task, "hipcall/objects/task"
16
15
  autoload :User, "hipcall/objects/user"
16
+ autoload :Comment, "hipcall/objects/comment"
17
17
 
18
18
  autoload :CdrResource, "hipcall/resources/cdrs"
19
19
  autoload :NumberResource, "hipcall/resources/numbers"
20
20
  autoload :TaskResource, "hipcall/resources/tasks"
21
21
  autoload :UserResource, "hipcall/resources/users"
22
+ autoload :CommentResource, "hipcall/resources/comments"
22
23
  end
@@ -1,4 +1,4 @@
1
- module Hipcall
1
+ module HipcallSdk
2
2
  VERSION: String
3
3
  # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
4
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hipcall
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hipcall Development Team
8
8
  - Onur Ozgur OZKAN
9
- autorequire:
9
+ - Kendal BOZKURT
10
+ autorequire:
10
11
  bindir: exe
11
12
  cert_chain: []
12
- date: 2022-07-08 00:00:00.000000000 Z
13
+ date: 2023-03-06 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: faraday
@@ -39,7 +40,7 @@ dependencies:
39
40
  - - "~>"
40
41
  - !ruby/object:Gem::Version
41
42
  version: '1.2'
42
- description:
43
+ description:
43
44
  email:
44
45
  - hello@hipcall.com
45
46
  executables: []
@@ -55,21 +56,23 @@ files:
55
56
  - bin/console
56
57
  - bin/setup
57
58
  - hipcall.gemspec
58
- - lib/hipcall.rb
59
59
  - lib/hipcall/client.rb
60
60
  - lib/hipcall/collection.rb
61
61
  - lib/hipcall/error.rb
62
62
  - lib/hipcall/object.rb
63
63
  - lib/hipcall/objects/cdr.rb
64
+ - lib/hipcall/objects/comment.rb
64
65
  - lib/hipcall/objects/number.rb
65
66
  - lib/hipcall/objects/task.rb
66
67
  - lib/hipcall/objects/user.rb
67
68
  - lib/hipcall/resource.rb
68
69
  - lib/hipcall/resources/cdrs.rb
70
+ - lib/hipcall/resources/comments.rb
69
71
  - lib/hipcall/resources/numbers.rb
70
72
  - lib/hipcall/resources/tasks.rb
71
73
  - lib/hipcall/resources/users.rb
72
74
  - lib/hipcall/version.rb
75
+ - lib/hipcall_sdk.rb
73
76
  - sig/hipcall/hipcall.rbs
74
77
  homepage: https://www.hipcall.com
75
78
  licenses:
@@ -78,7 +81,7 @@ metadata:
78
81
  homepage_uri: https://www.hipcall.com
79
82
  source_code_uri: https://github.com/hipcall/ruby-sdk
80
83
  changelog_uri: https://github.com/hipcall/ruby-sdk/blob/master/CHANGELOG.md
81
- post_install_message:
84
+ post_install_message:
82
85
  rdoc_options: []
83
86
  require_paths:
84
87
  - lib
@@ -93,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
96
  - !ruby/object:Gem::Version
94
97
  version: '0'
95
98
  requirements: []
96
- rubygems_version: 3.2.33
97
- signing_key:
99
+ rubygems_version: 3.3.7
100
+ signing_key:
98
101
  specification_version: 4
99
102
  summary: Hipcall's Ruby SDK
100
103
  test_files: []