moesif_api 1.2.5 → 1.2.6

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: f03579dcdef101fe45b4f839f3059c77e1079766a116db2d326f672f744fbe08
4
- data.tar.gz: 00f963b0abb153bae0bb3c61d61cb7b0e309c7c8e9121cbc164e6e6288fa3582
3
+ metadata.gz: 790a76c65b201a0778f2e71c6f55af5d43557be861fae237fcc8a3416b8d2e39
4
+ data.tar.gz: d9150f671c23586c9bd8647c8c3c5893cc96826effd13abe40a583255c4c7d8f
5
5
  SHA512:
6
- metadata.gz: b8952a4d79b418b0e71161df18b941726324aa8d9efa3b5889f0144f2c5a666e6bf8c40af27fc4e901925f552853e2b28b2f0ca549d0ada1e48f655eb8cfb0e1
7
- data.tar.gz: b0fb53a6940026d7cdfcc7bf245bb705ef2591222ce8d5767fd593e909cdba170ee922cab2d64e7a3dca213f6c44e38120d5e973a6e2feb8ccf5a5106ff1fac7
6
+ metadata.gz: d2e09621caf34c89118dcf63ed2d0f140e777b119e310af03cd9392a6d6860ad841000af450b3a8808b6ed1e7890842df77ddc4fe5bfa6b66c0e9987a176aba4
7
+ data.tar.gz: 5d4fd39b2c50a7f76e37a179d1648085737546919d3857de24f126c0903aa9a70e399f99649f0791ff2b6a080b77c432debf183eec08ccc23f90b195619d353a
data/README.md CHANGED
@@ -125,9 +125,34 @@ user_model.modified_time = Time.now.utc.iso8601 # option, default now.
125
125
  user_model.user_id = "testrubyapiuser" #only required field.
126
126
  user_model.metadata = metadata
127
127
 
128
+ # Perform the API call through the SDK function
128
129
  response = api_controller.update_user(user_model)
129
130
 
130
131
  ```
132
+
133
+ ### update company
134
+
135
+ You can also update the metadata for each company. The only required field is company_id
136
+
137
+ ```ruby
138
+ api_client = MoesifApi::MoesifAPIClient.new(my_application_id)
139
+ api_controller = api_client.api
140
+
141
+ metadata = JSON.parse('{'\
142
+ '"email": "testrubyapi@user.com",'\
143
+ '"name": "ruby api user",'\
144
+ '"location": "United States"'\
145
+ '}')
146
+
147
+ company_model = CompanyModel.new()
148
+ company_model.modified_time = Time.now.utc.iso8601 # option, default now.
149
+ company_model.company_id = "1" #only required field.
150
+ company_model.metadata = metadata
151
+
152
+ # Perform the API call through the SDK function
153
+ response = api_controller.update_company(company_model)
154
+ ```
155
+
131
156
  ## How to build and install manually:
132
157
 
133
158
  The generated code depends on a few Ruby gems. The references to these gems are
@@ -8,7 +8,7 @@ module MoesifApi
8
8
  # Your Application Id for authentication/authorization
9
9
  @application_id = 'SET_ME'
10
10
 
11
- @version = '1.2.5'
11
+ @version = '1.2.6'
12
12
 
13
13
  # create the getters and setters
14
14
  class << self
@@ -212,10 +212,10 @@ module MoesifApi
212
212
  return _response
213
213
  end
214
214
 
215
- # Add Data for a Single Company
215
+ # Update Data for a Single Company
216
216
  # @param [CompanyModel] body Required parameter.
217
217
  # @return void response from the API call
218
- def add_company(body)
218
+ def update_company(body)
219
219
  # the base uri for api requests
220
220
  _query_builder = Configuration.base_uri.dup
221
221
 
@@ -254,7 +254,7 @@ module MoesifApi
254
254
  # Update Data for multiple Companies in a single batch (batch size must be less than 250kb)
255
255
  # @param [list of CompanyModel] body Required parameter.
256
256
  # @return void response from the API call
257
- def add_companies_batch(body)
257
+ def update_companies_batch(body)
258
258
  # the base uri for api requests
259
259
  _query_builder = Configuration.base_uri.dup
260
260
 
@@ -22,6 +22,10 @@ module MoesifApi
22
22
  # @return [String]
23
23
  attr_accessor :user_id
24
24
 
25
+ # company_id string
26
+ # @return [String]
27
+ attr_accessor :company_id
28
+
25
29
  # metadata
26
30
  # @return [Hash]
27
31
  attr_accessor :metadata
@@ -35,6 +39,7 @@ module MoesifApi
35
39
  @hash["session_token"] = "session_token"
36
40
  @hash["tags"] = "tags"
37
41
  @hash["user_id"] = "user_id"
42
+ @hash["company_id"] = "company_id"
38
43
  @hash["metadata"] = "metadata"
39
44
  end
40
45
  @hash
@@ -45,12 +50,14 @@ module MoesifApi
45
50
  session_token = nil,
46
51
  tags = nil,
47
52
  user_id = nil,
53
+ company_id = nil,
48
54
  metadata = nil)
49
55
  @request = request
50
56
  @response = response
51
57
  @session_token = session_token
52
58
  @tags = tags
53
59
  @user_id = user_id
60
+ @company_id = company_id
54
61
  @metadata = metadata
55
62
  end
56
63
 
@@ -65,6 +72,7 @@ module MoesifApi
65
72
  session_token = hash["session_token"]
66
73
  tags = hash["tags"]
67
74
  user_id = hash["user_id"]
75
+ company_id = hash["company_id"]
68
76
  metadata = hash["metadata"]
69
77
 
70
78
  # Create object from extracted values
@@ -73,6 +81,7 @@ module MoesifApi
73
81
  session_token,
74
82
  tags,
75
83
  user_id,
84
+ company_id,
76
85
  metadata)
77
86
  end
78
87
  end
@@ -135,7 +135,7 @@ class ApiControllerTests < ControllerTestBase
135
135
  end
136
136
 
137
137
  # Add Single Company via API
138
- def test_add_company()
138
+ def test_update_company()
139
139
  # Parameters for the API call
140
140
 
141
141
  company_model = CompanyModel.new()
@@ -143,14 +143,14 @@ class ApiControllerTests < ControllerTestBase
143
143
  company_model.company_id = "1"
144
144
 
145
145
  # Perform the API call through the SDK function
146
- self.class.controller.add_company(company_model)
146
+ self.class.controller.update_company(company_model)
147
147
 
148
148
  # Test response code
149
149
  assert_equal(@response_catcher.response.status_code, 201)
150
150
  end
151
151
 
152
152
  # Add Batched Companies via Ingestion API
153
- def test_add_companies_batch()
153
+ def test_update_companies_batch()
154
154
  # Parameters for the API call
155
155
 
156
156
  company_model_A = CompanyModel.new()
@@ -169,7 +169,7 @@ class ApiControllerTests < ControllerTestBase
169
169
  companies = [company_model_A, company_model_B]
170
170
 
171
171
  # Perform the API call through the SDK function
172
- self.class.controller.add_companies_batch(companies)
172
+ self.class.controller.update_companies_batch(companies)
173
173
 
174
174
  # Test response code
175
175
  assert_equal(@response_catcher.response.status_code, 201)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moesif_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moesif, Inc
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-15 00:00:00.000000000 Z
12
+ date: 2019-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit