megam_api 1.5.rc5 → 1.5.rc7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/LICENSE +21 -202
  4. data/README.md +3 -20
  5. data/lib/megam/api.rb +154 -169
  6. data/lib/megam/api/accounts.rb +0 -15
  7. data/lib/megam/api/assemblies.rb +0 -15
  8. data/lib/megam/api/assembly.rb +0 -15
  9. data/lib/megam/api/balances.rb +0 -15
  10. data/lib/megam/api/billedhistories.rb +0 -15
  11. data/lib/megam/api/billingtransactions.rb +0 -15
  12. data/lib/megam/api/components.rb +0 -15
  13. data/lib/megam/api/domains.rb +0 -15
  14. data/lib/megam/api/errors.rb +0 -15
  15. data/lib/megam/api/eventsbilling.rb +0 -15
  16. data/lib/megam/api/eventscontainer.rb +0 -15
  17. data/lib/megam/api/eventsstorage.rb +0 -15
  18. data/lib/megam/api/eventsvm.rb +0 -15
  19. data/lib/megam/api/marketplaces.rb +0 -15
  20. data/lib/megam/api/organizations.rb +0 -15
  21. data/lib/megam/api/promos.rb +0 -15
  22. data/lib/megam/api/requests.rb +0 -15
  23. data/lib/megam/api/sensors.rb +0 -15
  24. data/lib/megam/api/snapshots.rb +0 -15
  25. data/lib/megam/api/sshkeys.rb +0 -15
  26. data/lib/megam/api/version.rb +1 -16
  27. data/lib/megam/core/account.rb +241 -60
  28. data/lib/megam/core/assemblies.rb +0 -16
  29. data/lib/megam/core/assemblies_collection.rb +101 -116
  30. data/lib/megam/core/assembly.rb +201 -218
  31. data/lib/megam/core/assembly_collection.rb +101 -116
  32. data/lib/megam/core/balances.rb +182 -197
  33. data/lib/megam/core/balances_collection.rb +101 -116
  34. data/lib/megam/core/billedhistories.rb +186 -201
  35. data/lib/megam/core/billedhistories_collection.rb +101 -116
  36. data/lib/megam/core/billingtransactions.rb +0 -15
  37. data/lib/megam/core/billingtransactions_collection.rb +0 -15
  38. data/lib/megam/core/components.rb +300 -316
  39. data/lib/megam/core/components_collection.rb +0 -15
  40. data/lib/megam/core/domain_collection.rb +1 -16
  41. data/lib/megam/core/domains.rb +115 -131
  42. data/lib/megam/core/error.rb +55 -70
  43. data/lib/megam/core/eventsbilling.rb +0 -16
  44. data/lib/megam/core/eventsbilling_collection.rb +101 -116
  45. data/lib/megam/core/eventscontainer.rb +0 -16
  46. data/lib/megam/core/eventscontainer_collection.rb +101 -116
  47. data/lib/megam/core/eventsstorage.rb +0 -16
  48. data/lib/megam/core/eventsstorage_collection.rb +0 -15
  49. data/lib/megam/core/eventsvm.rb +0 -16
  50. data/lib/megam/core/eventsvm_collection.rb +101 -116
  51. data/lib/megam/core/json_compat.rb +0 -12
  52. data/lib/megam/core/konipai.rb +0 -15
  53. data/lib/megam/core/log.rb +0 -15
  54. data/lib/megam/core/marketplace.rb +224 -241
  55. data/lib/megam/core/marketplace_collection.rb +0 -15
  56. data/lib/megam/core/organizations.rb +0 -16
  57. data/lib/megam/core/organizations_collection.rb +0 -15
  58. data/lib/megam/core/promos.rb +0 -15
  59. data/lib/megam/core/request.rb +0 -15
  60. data/lib/megam/core/request_collection.rb +0 -15
  61. data/lib/megam/core/rest_adapter.rb +0 -15
  62. data/lib/megam/core/sensors.rb +138 -154
  63. data/lib/megam/core/sensors_collection.rb +0 -15
  64. data/lib/megam/core/snapshots.rb +0 -16
  65. data/lib/megam/core/snapshots_collection.rb +0 -15
  66. data/lib/megam/core/sshkey.rb +169 -184
  67. data/lib/megam/core/sshkey_collection.rb +0 -15
  68. data/lib/megam/core/stuff.rb +17 -32
  69. data/lib/megam/core/text.rb +82 -97
  70. data/lib/megam/mixins/assemblies.rb +10 -25
  71. data/lib/megam/mixins/assembly.rb +33 -49
  72. data/lib/megam/mixins/common_deployable.rb +64 -79
  73. data/lib/megam/mixins/components.rb +160 -175
  74. data/lib/megam/mixins/megam_attributes.rb +22 -37
  75. data/lib/megam/mixins/outputs.rb +14 -29
  76. data/lib/megam/mixins/policies.rb +21 -36
  77. data/lib/megam_api.rb +0 -15
  78. data/test/mixins/test_assemblies.rb +1 -2
  79. data/test/test_accounts.rb +84 -29
  80. data/test/test_billingtranscations.rb +17 -21
  81. data/test/test_eventscontainer.rb +19 -23
  82. data/test/test_eventsstorage.rb +8 -10
  83. data/test/test_eventsvm.rb +19 -23
  84. data/test/test_helper.rb +30 -30
  85. data/test/test_snapshots.rb +16 -22
  86. metadata +2 -2
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  # GET /accounts
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  # GET /nodes
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  def get_one_assembly(asm_id)
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  def get_balances
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  def get_billedhistories
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  def get_billingtransactions
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  def get_components(comp_id)
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
 
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  module Errors
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  # GET /nodes
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  # GET /nodes
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  # GET /nodes
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  # GET /nodes
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
 
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  def get_organizations
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
 
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
 
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  def get_sensors
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  # GET /nodes
@@ -1,18 +1,3 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
3
  def get_sshkeys
@@ -1,20 +1,5 @@
1
- # Copyright:: Copyright (c) 2013-2016 Megam Systems
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class API
18
- VERSION = "1.5.rc5"
3
+ VERSION = "1.5.rc7"
19
4
  end
20
5
  end
@@ -1,32 +1,17 @@
1
- # Copyright:: 2013-2016 Megam Systems, Inc.
2
- # License:: Apache License, Version 2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
1
  module Megam
17
2
  class Account < Megam::RestAdapter
18
3
  def initialize(o)
19
4
  @id = nil
20
5
  @email = nil
21
6
  @api_key = nil
22
- @first_name = nil
23
- @last_name = nil
7
+ @name = nil
24
8
  @phone = nil
25
9
  @password = nil
26
- @authority = nil
27
- @password_reset_key = nil
28
- @password_reset_sent_at = nil
29
- @created_at = nil
10
+ @states = nil
11
+ @approval = nil
12
+ @suspend = nil
13
+ @registration_ip_address = nil
14
+ @dates = nil
30
15
  @some_msg = {}
31
16
  super({:email => o[:email], :api_key => o[:api_key], :host => o[:host], :password => o[:password], :org_id => o[:org_id]})
32
17
  end
@@ -60,19 +45,42 @@ module Megam
60
45
  end
61
46
  end
62
47
 
63
- def first_name(arg=nil)
48
+ def name(arg=nil)
64
49
  if arg != nil
50
+ @name = arg
51
+ else
52
+ @name
53
+ end
54
+ end
55
+ def first_name(arg = nil)
56
+ if !arg.nil?
65
57
  @first_name = arg
66
58
  else
67
- @first_name
59
+ @first_name
68
60
  end
69
61
  end
70
62
 
71
- def last_name(arg=nil)
72
- if arg != nil
63
+ def last_name(arg = nil)
64
+ if !arg.nil?
73
65
  @last_name = arg
74
66
  else
75
- @last_name
67
+ @last_name
68
+ end
69
+ end
70
+
71
+ def phone(arg=nil)
72
+ if arg != nil
73
+ @phone = arg
74
+ else
75
+ @phone
76
+ end
77
+ end
78
+
79
+ def phone_verified(arg=nil)
80
+ if arg != nil
81
+ @phone_verified = arg
82
+ else
83
+ @phone_verified
76
84
  end
77
85
  end
78
86
 
@@ -92,11 +100,12 @@ module Megam
92
100
  end
93
101
  end
94
102
 
95
- def authority(arg=nil)
103
+
104
+ def password(arg=nil)
96
105
  if arg != nil
97
- @authority = arg
106
+ @password = arg
98
107
  else
99
- @authority
108
+ @password
100
109
  end
101
110
  end
102
111
 
@@ -108,7 +117,7 @@ module Megam
108
117
  end
109
118
  end
110
119
 
111
- def password_reset_sent_at(arg=nil)
120
+ def password_reset_sent_at(arg=nil)
112
121
  if arg != nil
113
122
  @password_reset_sent_at = arg
114
123
  else
@@ -116,6 +125,157 @@ module Megam
116
125
  end
117
126
  end
118
127
 
128
+ def states(arg = nil)
129
+ if !arg.nil?
130
+ @states = arg
131
+ else
132
+ @states
133
+ end
134
+ end
135
+
136
+ def authority(arg=nil)
137
+ if arg != nil
138
+ @authority = arg
139
+ else
140
+ @authority
141
+ end
142
+ end
143
+
144
+ def active(arg = nil)
145
+ if !arg.nil?
146
+ @active = arg
147
+ else
148
+ @active
149
+ end
150
+ end
151
+
152
+ def blocked(arg = nil)
153
+ if !arg.nil?
154
+ @blocked = arg
155
+ else
156
+ @blocked
157
+ end
158
+ end
159
+
160
+ def staged(arg = nil)
161
+ if !arg.nil?
162
+ @staged = arg
163
+ else
164
+ @staged
165
+ end
166
+ end
167
+
168
+ def approval(arg = nil)
169
+ if !arg.nil?
170
+ @approval = arg
171
+ else
172
+ @approval
173
+ end
174
+ end
175
+
176
+ def approved(arg = nil)
177
+ if !arg.nil?
178
+ @approved = arg
179
+ else
180
+ @approved
181
+ end
182
+ end
183
+
184
+ def approved_by_id(arg = nil)
185
+ if !arg.nil?
186
+ @approved_by_id = arg
187
+ else
188
+ @approved_by_id
189
+ end
190
+ end
191
+
192
+ def approved_at(arg = nil)
193
+ if !arg.nil?
194
+ @approved_at = arg
195
+ else
196
+ @approved_at
197
+ end
198
+ end
199
+
200
+ def suspend(arg = nil)
201
+ if !arg.nil?
202
+ @suspend = arg
203
+ else
204
+ @suspend
205
+ end
206
+ end
207
+
208
+ def suspended(arg = nil)
209
+ if !arg.nil?
210
+ @suspended = arg
211
+ else
212
+ @suspended
213
+ end
214
+ end
215
+
216
+ def suspended_at(arg = nil)
217
+ if !arg.nil?
218
+ @suspended_at = arg
219
+ else
220
+ @suspended_at
221
+ end
222
+ end
223
+
224
+ def suspended_till(arg = nil)
225
+ if !arg.nil?
226
+ @suspended_till = arg
227
+ else
228
+ @suspended_till
229
+ end
230
+ end
231
+
232
+ def registration_ip_address(arg = nil)
233
+ if !arg.nil?
234
+ @registration_ip_address = arg
235
+ else
236
+ @registration_ip_address
237
+ end
238
+ end
239
+
240
+ def dates(arg = nil)
241
+ if !arg.nil?
242
+ @dates = arg
243
+ else
244
+ @dates
245
+ end
246
+ end
247
+
248
+ def last_posted_at(arg = nil)
249
+ if !arg.nil?
250
+ @last_posted_at = arg
251
+ else
252
+ @last_posted_at
253
+ end
254
+ end
255
+
256
+ def last_emailed_at(arg = nil)
257
+ if !arg.nil?
258
+ @last_emailed_at = arg
259
+ else
260
+ @last_emailed_at
261
+ end
262
+ end
263
+
264
+ def previous_visit_at(arg = nil)
265
+ if !arg.nil?
266
+ @previous_visit_at = arg
267
+ else
268
+ @previous_visit_at
269
+ end
270
+ end
271
+
272
+ def first_seen_at(arg = nil)
273
+ if !arg.nil?
274
+ @first_seen_at = arg
275
+ else
276
+ @first_seen_at
277
+ end
278
+ end
119
279
 
120
280
  def created_at(arg=nil)
121
281
  if arg != nil
@@ -144,14 +304,14 @@ module Megam
144
304
  index_hash["id"] = id
145
305
  index_hash["email"] = email
146
306
  index_hash["api_key"] = api_key
147
- index_hash["first_name"] = first_name
148
- index_hash["last_name"] = last_name
307
+ index_hash["name"] = name
149
308
  index_hash["phone"] = phone
150
309
  index_hash["password"] = password
151
- index_hash["password_reset_key"] = password_reset_key
152
- index_hash["password_reset_sent_at"] = password_reset_sent_at
153
- index_hash["authority"] = authority
154
- index_hash["created_at"] = created_at
310
+ index_hash["states"] = states
311
+ index_hash["approval"] = approval
312
+ index_hash["suspend"] = suspend
313
+ index_hash["registration_ip_address"] = registration_ip_address
314
+ index_hash["dates"] = dates
155
315
  index_hash["some_msg"] = some_msg
156
316
  index_hash
157
317
  end
@@ -167,14 +327,13 @@ module Megam
167
327
  "id" => id,
168
328
  "email" => email,
169
329
  "api_key" => api_key,
170
- "first_name" => first_name,
171
- "last_name" => last_name,
330
+ "name" => name,
172
331
  "phone" => phone,
173
332
  "password" => password,
174
- "password_reset_key" => password_reset_key,
175
- "password_reset_sent_at" => password_reset_sent_at,
176
- "authority" => authority,
177
- "created_at" => created_at
333
+ "states" => states,
334
+ "approval" => approval,
335
+ "registration_ip_address" => registration_ip_address,
336
+ "dates" => dates
178
337
  }
179
338
  result
180
339
  end
@@ -185,14 +344,36 @@ module Megam
185
344
  acct.id(o["id"]) if o.has_key?("id")
186
345
  acct.email(o["email"]) if o.has_key?("email")
187
346
  acct.api_key(o["api_key"]) if o.has_key?("api_key")
188
- acct.authority(o["authority"]) if o.has_key?("authority")
189
- acct.first_name(o["first_name"]) if o.has_key?("first_name")
190
- acct.last_name(o["last_name"]) if o.has_key?("last_name")
191
- acct.phone(o["phone"]) if o.has_key?("phone")
192
- acct.password(o["password"]) if o.has_key?("password")
193
- acct.password_reset_key(o["password_reset_key"]) if o.has_key?("password_reset_key")
194
- acct.password_reset_key(o["password_reset_sent_at"]) if o.has_key?("password_reset_sent_at")
195
- acct.created_at(o["created_at"]) if o.has_key?("created_at")
347
+ na = o['name']
348
+ acct.name[:first_name] = na['first_name'] if na && na.key?('first_name')
349
+ acct.name[:last_name] = na['last_name'] if na && na.key?('last_name')
350
+ ph = o['phone']
351
+ acct.phone[:phone] = ph['phone'] if ph && ph.key?('phone')
352
+ acct.phone[:phone_verified] = ph['phone_verified'] if ph && ph.key?('phone_verified')
353
+ pwd = o['password']
354
+ acct.password[:password] = pwd['password'] if pwd && pwd.key?('password')
355
+ acct.password[:password_reset_key] = pwd['password_reset_key'] if pwd && pwd.key?('password_reset_key')
356
+ acct.password[:password_reset_sent_at] = pwd['password_reset_sent_at'] if pwd && pwd.key?('password_reset_sent_at')
357
+ st = o['states']
358
+ acct.states[:authority] = st['authority'] if st && st.key?('authority')
359
+ acct.states[:active] = st['active'] if st && st.key?('active')
360
+ acct.states[:blocked] = st['blocked'] if st && st.key?('blocked')
361
+ acct.states[:staged] = st['staged'] if st && st.key?('staged')
362
+ al = o['approval']
363
+ acct.approval[:approved] = al['approved'] if al && al.key?('approved')
364
+ acct.approval[:approved_by_id] = al['approved_by_id'] if al && al.key?('approved_by_id')
365
+ acct.approval[:approved_at] = al['approved_at'] if al && al.key?('approved_at')
366
+ sp = o['suspend']
367
+ acct.suspend[:suspended] = sp['suspended'] if sp && sp.key?('suspended')
368
+ acct.suspend[:suspended_at] = sp['suspended_at'] if sp && sp.key?('suspended_at')
369
+ acct.suspend[:suspended_till] = sp['suspended_till'] if sp && sp.key?('suspended_till')
370
+ acct.registration_ip_address(o["registration_ip_address"]) if o.has_key?("registration_ip_address")
371
+ dt = o['dates']
372
+ acct.dates[:last_posted_at] = dt['last_posted_at'] if dt && dt.key?('last_posted_at')
373
+ acct.dates[:last_emailed_at] = dt['last_emailed_at'] if dt && dt.key?('last_emailed_at')
374
+ acct.dates[:previous_visit_at] = dt['previous_visit_at'] if dt && dt.key?('previous_visit_at')
375
+ acct.dates[:first_seen_at] = dt['first_seen_at'] if dt && dt.key?('first_seen_at')
376
+ acct.dates[:created_at] = dt['created_at'] if dt && dt.key?('created_at')
196
377
  acct.some_msg[:code] = o["code"] if o.has_key?("code")
197
378
  acct.some_msg[:msg_type] = o["msg_type"] if o.has_key?("msg_type")
198
379
  acct.some_msg[:msg]= o["msg"] if o.has_key?("msg")
@@ -210,14 +391,14 @@ module Megam
210
391
  @id = o[:id] if o.has_key?(:id)
211
392
  @email = o[:email] if o.has_key?(:email)
212
393
  @api_key = o[:api_key] if o.has_key?(:api_key)
213
- @authority = o[:authority] if o.has_key?(:authority)
214
- @first_name = o[:first_name] if o.has_key?(:first_name)
215
- @last_name = o[:last_name] if o.has_key?(:last_name)
394
+ @name = o[:name] if o.has_key?(:name)
216
395
  @phone = o[:phone] if o.has_key?(:phone)
217
396
  @password = o[:password] if o.has_key?(:password)
218
- @password_reset_key = o[:password_reset_key] if o.has_key?(:password_reset_key)
219
- @password_reset_sent_at = o[:password_reset_sent_at] if o.has_key?(:password_reset_sent_at)
220
- @created_at = o[:created_at] if o.has_key?(:created_at)
397
+ @states = o[:states] if o.has_key?(:states)
398
+ @approval = o[:approval] if o.has_key?(:approval)
399
+ @suspend = o[:suspend] if o.has_key?(:suspend)
400
+ @registration_ip_address = o[:registration_ip_address] if o.has_key?(:registration_ip_address)
401
+ @dates = o[:dates] if o.has_key?(:dates)
221
402
  self
222
403
  end
223
404
 
@@ -241,12 +422,12 @@ module Megam
241
422
  acct = from_hash(o)
242
423
  acct.update
243
424
  end
244
-
425
+
245
426
  def self.reset(o)
246
427
  acct = from_hash(o)
247
428
  acct.reset
248
429
  end
249
-
430
+
250
431
  def self.repassword(o)
251
432
  acct = from_hash(o)
252
433
  acct.repassword
@@ -256,11 +437,11 @@ module Megam
256
437
  def update
257
438
  megam_rest.update_accounts(to_hash)
258
439
  end
259
-
440
+
260
441
  def reset
261
442
  megam_rest.reset_accounts(to_hash)
262
443
  end
263
-
444
+
264
445
  def repassword
265
446
  megam_rest.repassword_accounts(to_hash)
266
447
  end