sysaid 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sysaid/ticket.rb +79 -72
  3. data/lib/sysaid/user.rb +30 -30
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0519d826d111724b463a1f8cbb69929c01af2445
4
- data.tar.gz: 688d94e4230f20f817a2bfe3286544fdc11ffdeb
3
+ metadata.gz: b4fe7162cf00afdf721ab97712445a400f9ddf4e
4
+ data.tar.gz: ab0ee5cd4a41d955f02f69d06d6ecc8a9ebe0820
5
5
  SHA512:
6
- metadata.gz: 477e368c753ae59ce4bc1f43f16232c33d6a9b488d399e679a992bc46abe9916f66894b08fef546f0525a619834947ab56becf24ddf9e558cbf369b98d41ad30
7
- data.tar.gz: 1e9b146eef9d2be2b83063e4bb42096f76ee9244cfde39839a02daf6872ff16b8969c2d437138aa14fe4f43793ed20c176b47bc196163e1e6384e072bd692f56
6
+ metadata.gz: 6b9affe8dea28fa3c0938e30cfc8a8f679c3efba784399e4e02e16058a2073d680a5b7e2389dd3d778580c00adcf92afb3c9e48c1427c103675384024e3eb2ae
7
+ data.tar.gz: 887e542faa903d7e6bdc7559d0e12762097297aebca0a5f3610897162207579ead0e439589753779c4554c87197a05b4022bfeefe112db2b7b4d87826f1981e6
@@ -1,17 +1,18 @@
1
1
  require 'date'
2
2
 
3
3
  class SysAid::Ticket
4
- attr_accessor :agreement, :assignCounter, :assignedTo, :ciid, :category, :currentSupportLevel, :custInt1,
5
- :custInt2, :custList1, :custList2, :description, :escalation, :id, :location, :maxSupportLevel,
6
- :parentLink, :priority, :projectID, :reopenCounter, :requestUser, :source, :srSubType, :srType,
7
- :status, :subCategory, :submitUser, :successRating, :taskID, :title, :urgency, :version, :archive,
8
- :assignedGroup, :assignedTo, :cc, :changeCategory, :closeTime, :closureInformation, :computerID,
9
- :custNotes, :custText1, :custText2, :impact, :notes, :resolution, :solution, :thirdLevelCategory,
10
- :updateTime, :updateUser, :userManager, :workaround
4
+ attr_accessor :agreement, :assign_counter, :assigned_to, :ciid, :category, :current_support_level, :cust_int1,
5
+ :cust_int2, :cust_list1, :cust_list2, :description, :escalation, :id, :location, :max_support_level,
6
+ :parent_link, :priority, :project_id, :reopen_counter, :request_user, :source, :sr_sub_type, :sr_type,
7
+ :status, :sub_category, :submit_user, :success_rating, :task_id, :title, :urgency, :version, :archive,
8
+ :assigned_group, :cc, :change_category, :close_time, :closure_information, :computer_id,
9
+ :cust_notes, :cust_text1, :cust_text2, :impact, :notes, :resolution, :solution, :third_level_category,
10
+ :update_time, :update_user, :user_manager, :workaround, :insert_time, :followup_text, :email_account
11
11
 
12
12
  def initialize
13
- self.closeTime = Date.new
14
- self.updateTime = Date.new
13
+ self.close_time = Date.new
14
+ self.insert_time = Date.new
15
+ self.update_time = Date.new
15
16
  end
16
17
 
17
18
  def self.find_by_id(ticket_id)
@@ -75,57 +76,56 @@ class SysAid::Ticket
75
76
  xml = builder.apiSysObj('xsi:type' => "tns:apiServiceRequest") { |b|
76
77
  b.agreement(self.agreement, 'xsi:type' => 'xsd:int')
77
78
  b.archive(self.archive, 'xsi:type' => 'xsd:boolean')
78
- b.assignCounter(self.assignCounter, 'xsi:type' => 'xsd:int')
79
- b.assignedGroup(self.assignedGroup, 'xsi:type' => 'xsd:string')
80
- b.assignedTo(self.assignedTo, 'xsi:type' => 'xsd:string')
79
+ b.assignCounter(self.assign_counter, 'xsi:type' => 'xsd:int')
80
+ b.assignedGroup(self.assigned_group, 'xsi:type' => 'xsd:string')
81
+ b.assignedTo(self.assigned_to, 'xsi:type' => 'xsd:string')
81
82
  b.CIId(self.ciid, 'xsi:type' => 'xsd:int')
82
83
  b.category(self.category, 'xsi:type' => 'xsd:string')
83
84
  b.cc(self.cc, 'xsi:type' => 'xsd:string')
84
- b.changeCategory(self.changeCategory, 'xsi:type' => 'xsd:int')
85
- b.closeTime(self.closeTime.rfc3339, 'xsi:type' => 'xsd:dateTime')
86
- b.closureInformation(self.closureInformation, 'xsi:type' => 'xsd:int')
87
- b.computerID(self.computerID, 'xsi:type' => 'xsd:string')
88
- b.currentSupportLevel(self.currentSupportLevel, 'xsi:type' => 'xsd:int')
89
- b.custInt1(self.custInt1, 'xsi:type' => 'xsd:int')
90
- b.custInt2(self.custInt2, 'xsi:type' => 'xsd:int')
91
- b.custList1(self.custList1, 'xsi:type' => 'xsd:int')
92
- b.custList2(self.custList2, 'xsi:type' => 'xsd:int')
93
- b.custNotes(self.custNotes, 'xsi:type' => 'xsd:string')
94
- b.custText1(self.custText1, 'xsi:type' => 'xsd:string')
95
- b.custText2(self.custText2, 'xsi:type' => 'xsd:string')
85
+ b.changeCategory(self.change_category, 'xsi:type' => 'xsd:int')
86
+ b.closeTime(self.close_time.rfc3339, 'xsi:type' => 'xsd:dateTime')
87
+ b.closureInformation(self.closure_information, 'xsi:type' => 'xsd:int')
88
+ b.computerID(self.computer_id, 'xsi:type' => 'xsd:string')
89
+ b.currentSupportLevel(self.current_support_level, 'xsi:type' => 'xsd:int')
90
+ b.custInt1(self.cust_int1, 'xsi:type' => 'xsd:int')
91
+ b.custInt2(self.cust_int2, 'xsi:type' => 'xsd:int')
92
+ b.custList1(self.cust_list1, 'xsi:type' => 'xsd:int')
93
+ b.custList2(self.cust_list2, 'xsi:type' => 'xsd:int')
94
+ b.custNotes(self.cust_notes, 'xsi:type' => 'xsd:string')
95
+ b.custText1(self.cust_text1, 'xsi:type' => 'xsd:string')
96
+ b.custText2(self.cust_text2, 'xsi:type' => 'xsd:string')
96
97
  b.customDateFields
97
98
  #b.customFields
98
99
  b.description(self.description, 'xsi:type' => 'xsd:string')
99
- # <emailAccount xsi:type="xsd:string"></emailAccount>
100
+ b.emailAccount(self.email_account, 'xsi:type' => 'xsd:string')
100
101
  b.escalation(self.escalation, 'xsi:type' => 'xsd:int')
101
- # <followupText xsi:type="xsd:string"></followupText>
102
+ b.followupText(self.followup_text, 'xsi:type' => 'xsd:string')
102
103
  b.id(self.id, 'xsi:type' => 'xsd:int')
103
104
  b.impact(self.impact, 'xsi:type' => 'xsd:int')
104
- # <insertTime xsi:type="xsd:dateTime">
105
- # 2012-06-13T17:42:03.053Z</insertTime>
105
+ b.insertTime(self.insert_time.rfc3339, 'xsi:type' => 'xsd:dateTime')
106
106
  b.location(self.location, 'xsi:type' => 'xsd:int')
107
- b.maxSupportLevel(self.maxSupportLevel, 'xsi:type' => 'xsd:int')
107
+ b.maxSupportLevel(self.max_support_level, 'xsi:type' => 'xsd:int')
108
108
  b.notes(self.notes, 'xsi:type' => 'xsd:string')
109
- b.parentLink(self.parentLink, 'xsi:type' => 'xsd:int')
109
+ b.parentLink(self.parent_link, 'xsi:type' => 'xsd:int')
110
110
  b.priority(self.priority, 'xsi:type' => 'xsd:int')
111
- b.projectID(self.projectID, 'xsi:type' => 'xsd:int')
112
- b.reopenCounter(self.reopenCounter, 'xsi:type' => 'xsd:int')
113
- b.requestUser(self.requestUser, 'xsi:type' => 'xsd:string')
111
+ b.projectID(self.project_id, 'xsi:type' => 'xsd:int')
112
+ b.reopenCounter(self.reopen_counter, 'xsi:type' => 'xsd:int')
113
+ b.requestUser(self.request_user, 'xsi:type' => 'xsd:string')
114
114
  b.resolution(self.resolution, 'xsi:type' => 'xsd:string')
115
115
  b.solution(self.solution, 'xsi:type' => 'xsd:string')
116
116
  b.source(self.source, 'xsi:type' => 'xsd:int')
117
- b.srSubType(self.srSubType, 'xsi:type' => 'xsd:int')
118
- b.srType(self.srType, 'xsi:type' => 'xsd:int')
117
+ b.srSubType(self.sr_sub_type, 'xsi:type' => 'xsd:int')
118
+ b.srType(self.sr_type, 'xsi:type' => 'xsd:int')
119
119
  b.status(self.status, 'xsi:type' => 'xsd:int')
120
- b.subCategory(self.subCategory, 'xsi:type' => 'xsd:string')
121
- b.successRating(self.successRating, 'xsi:type' => 'xsd:int')
122
- b.taskID(self.taskID, 'xsi:type' => 'xsd:int')
123
- b.thirdLevelCategory(self.thirdLevelCategory, 'xsi:type' => 'xsd:string')
120
+ b.subCategory(self.sub_category, 'xsi:type' => 'xsd:string')
121
+ b.successRating(self.success_rating, 'xsi:type' => 'xsd:int')
122
+ b.taskID(self.task_id, 'xsi:type' => 'xsd:int')
123
+ b.thirdLevelCategory(self.third_level_category, 'xsi:type' => 'xsd:string')
124
124
  b.title(self.title, 'xsi:type' => 'xsd:string')
125
- b.updateTime(self.updateTime.rfc3339, 'xsi:type' => 'xsd:dateTime')
126
- b.updateUser(self.updateUser, 'xsi:type' => 'xsd:string')
125
+ b.updateTime(self.update_time.rfc3339, 'xsi:type' => 'xsd:dateTime')
126
+ b.updateUser(self.update_user, 'xsi:type' => 'xsd:string')
127
127
  b.urgency(self.urgency, 'xsi:type' => 'xsd:int')
128
- b.userManager(self.userManager, 'xsi:type' => 'xsd:string')
128
+ b.userManager(self.user_manager, 'xsi:type' => 'xsd:string')
129
129
  b.version(self.version, 'xsi:type' => 'xsd:int')
130
130
  b.workaround(self.workaround, 'xsi:type' => 'xsd:string')
131
131
  }
@@ -136,53 +136,60 @@ class SysAid::Ticket
136
136
 
137
137
  # Update instance variables to match what is in response
138
138
  def set_self_from_response(response)
139
+ pp "---"
140
+ pp response
141
+ pp "---"
142
+
139
143
  self.agreement = response[:agreement]
140
144
  self.archive = response[:archive]
141
- self.assignCounter = response[:assignCounter]
142
- self.assignedGroup = response[:assignGroup]
143
- self.assignedTo = response[:assignTo]
144
- self.ciid = response[:CIId]
145
+ self.assign_counter = response[:assign_counter]
146
+ self.assigned_group = response[:assign_group]
147
+ self.assigned_to = response[:assign_to]
148
+ self.ciid = response[:ci_id]
145
149
  self.category = response[:category]
146
150
  self.cc = response[:cc]
147
- self.changeCategory = response[:changeCategory]
148
- self.closeTime = Date.parse(response[:closeTime]) if response[:closeTime]
149
- self.closureInformation = response[:closureInformation]
150
- self.computerID = response[:computerID]
151
- self.currentSupportLevel = response[:currentSupportLevel]
152
- self.custInt1 = response[:custInt1]
153
- self.custInt2 = response[:custInt2]
154
- self.custList1 = response[:custList1]
155
- self.custList2 = response[:custList2]
156
- self.custNotes = response[:custNotes]
157
- self.custText1 = response[:custText1]
158
- self.custText2 = response[:custText2]
151
+ self.change_category = response[:change_category]
152
+ self.close_time = response[:close_time]
153
+ self.closure_information = response[:closure_information]
154
+ self.computer_id = response[:computer_id]
155
+ self.current_support_level = response[:current_support_level]
156
+ self.cust_int1 = response[:cust_int1]
157
+ self.cust_int2 = response[:cust_int2]
158
+ self.cust_list1 = response[:cust_list1]
159
+ self.cust_list2 = response[:cust_list2]
160
+ self.cust_notes = response[:cust_notes]
161
+ self.cust_text1 = response[:cust_text1]
162
+ self.cust_text2 = response[:cust_text2]
159
163
  self.description = response[:description]
164
+ self.email_account = response[:email_account]
160
165
  self.escalation = response[:escalation]
166
+ self.followup_text = response[:followup_text]
161
167
  self.id = response[:id]
162
168
  self.impact = response[:impact]
169
+ self.insert_time = response[:insert_time]
163
170
  self.location = response[:location]
164
- self.maxSupportLevel = response[:maxSupportLevel]
171
+ self.max_support_level = response[:max_support_level]
165
172
  self.notes = response[:notes]
166
- self.parentLink = response[:parentLink]
173
+ self.parent_link = response[:parent_link]
167
174
  self.priority = response[:priority]
168
- self.projectID = response[:projectID]
169
- self.reopenCounter = response[:reopenCounter]
170
- self.requestUser = response[:requestUser]
175
+ self.project_id = response[:project_id]
176
+ self.reopen_counter = response[:reopen_counter]
177
+ self.request_user = response[:request_user]
171
178
  self.resolution = response[:resolution]
172
179
  self.solution = response[:solution]
173
180
  self.source = response[:source]
174
- self.srSubType = response[:srSubType]
175
- self.srType = response[:srType]
181
+ self.sr_sub_type = response[:sr_sub_type]
182
+ self.sr_type = response[:sr_type]
176
183
  self.status = response[:status]
177
- self.subCategory = response[:subCategory]
178
- self.successRating = response[:successRating]
179
- self.taskID = response[:taskID]
180
- self.thirdLevelCategory = response[:thirdLevelCategory]
184
+ self.sub_category = response[:sub_category]
185
+ self.success_rating = response[:success_rating]
186
+ self.task_id = response[:task_id]
187
+ self.third_level_category = response[:third_level_category]
181
188
  self.title = response[:title]
182
- self.updateTime = Date.parse(response[:updateTime]) if response[:updateTime]
183
- self.updateUser = response[:updateUser]
189
+ self.update_time = response[:update_time]
190
+ self.update_user = response[:update_user]
184
191
  self.urgency = response[:urgency]
185
- self.userManager = response[:userManager]
192
+ self.user_manager = response[:user_manager]
186
193
  self.version = response[:version]
187
194
  self.workaround = response[:workaround]
188
195
  end
@@ -1,8 +1,8 @@
1
1
  class SysAid::User
2
2
  attr_accessor :username, :display_name, :email, :phone, :first_name, :last_name, :admin, :agreement, :building,
3
- :car_number, :cellphone, :company, :cubic, :custInt1, :custInt2, :custList1, :custList2, :custNotes,
4
- :custText1, :custText2, :department, :disable, :emailNotifications, :enableLoginToEup, :floor, :location,
5
- :manager, :notes, :sms, :userManagerName, :loginDomain, :loginUser, :secondaryEmail
3
+ :car_number, :cellphone, :company, :cubic, :cust_int1, :cust_int2, :cust_list1, :cust_list2, :cust_notes,
4
+ :cust_text1, :cust_text2, :department, :disable, :email_notifications, :enable_login_to_eup, :floor, :location,
5
+ :manager, :notes, :sms, :user_manager_name, :login_domain, :login_user, :secondary_email
6
6
 
7
7
  # Creates a SysAid::User object
8
8
  #
@@ -82,33 +82,33 @@ class SysAid::User
82
82
  b.cellphone(self.cellphone, 'xsi:type' => 'xsd:string')
83
83
  b.company(self.company, 'xsi:type' => 'xsd:int')
84
84
  b.cubic(self.cubic, 'xsi:type' => 'xsd:string')
85
- b.custInt1(self.custInt1, 'xsi:type' => 'xsd:int')
86
- b.custInt2(self.custInt2, 'xsi:type' => 'xsd:int')
87
- b.custList1(self.custList1, 'xsi:type' => 'xsd:int')
88
- b.custList2(self.custList2, 'xsi:type' => 'xsd:int')
89
- b.custNotes(self.custNotes, 'xsi:type' => 'xsd:string')
90
- b.custText1(self.custText1, 'xsi:type' => 'xsd:string')
91
- b.custText2(self.custText2, 'xsi:type' => 'xsd:string')
85
+ b.custInt1(self.cust_int1, 'xsi:type' => 'xsd:int')
86
+ b.custInt2(self.cust_int2, 'xsi:type' => 'xsd:int')
87
+ b.custList1(self.cust_list1, 'xsi:type' => 'xsd:int')
88
+ b.custList2(self.cust_list2, 'xsi:type' => 'xsd:int')
89
+ b.custNotes(self.cust_notes, 'xsi:type' => 'xsd:string')
90
+ b.custText1(self.cust_text1, 'xsi:type' => 'xsd:string')
91
+ b.custText2(self.cust_text2, 'xsi:type' => 'xsd:string')
92
92
  b.customDateFields
93
93
  b.customFields
94
94
  b.department(self.department, 'xsi:type' => 'xsd:int')
95
95
  b.disable(self.disable, 'xsi:type' => 'xsd:boolean')
96
96
  b.displayName(self.display_name, 'xsi:type' => 'xsd:string')
97
97
  b.email(self.email, 'xsi:type' => 'xsd:string')
98
- b.emailNotifications(self.emailNotifications, 'xsi:type' => 'xsd:boolean')
99
- b.enableLoginToEup(self.enableLoginToEup, 'xsi:type' => 'xsd:boolean')
98
+ b.emailNotifications(self.email_notifications, 'xsi:type' => 'xsd:boolean')
99
+ b.enableLoginToEup(self.enable_login_to_eup, 'xsi:type' => 'xsd:boolean')
100
100
  b.firstName(self.first_name, 'xsi:type' => 'xsd:string')
101
101
  b.floor(self.floor, 'xsi:type' => 'xsd:string')
102
102
  b.lastName(self.last_name, 'xsi:type' => 'xsd:string')
103
103
  b.location(self.location, 'xsi:type' => 'xsd:int')
104
- b.loginDomain(self.loginDomain, 'xsi:type' => 'xsd:string')
105
- b.loginUser(self.loginUser, 'xsi:type' => 'xsd:string')
104
+ b.loginDomain(self.login_domain, 'xsi:type' => 'xsd:string')
105
+ b.loginUser(self.login_user, 'xsi:type' => 'xsd:string')
106
106
  b.manager(self.manager, 'xsi:type' => 'xsd:boolean')
107
107
  b.notes(self.notes, 'xsi:type' => 'xsd:string')
108
108
  b.phone(self.phone, 'xsi:type' => 'xsd:string')
109
- b.secondaryEmail(self.secondaryEmail, 'xsi:type' => 'xsd:string')
109
+ b.secondaryEmail(self.secondary_email, 'xsi:type' => 'xsd:string')
110
110
  b.sms(self.sms, 'xsi:type' => 'xsd:string')
111
- b.userManagerName(self.userManagerName, 'xsi:type' => 'xsd:string')
111
+ b.userManagerName(self.user_manager_name, 'xsi:type' => 'xsd:string')
112
112
  b.userName(self.username, 'xsi:type' => 'xsd:string')
113
113
  }
114
114
  xml = builder.id(self.username) if include_id
@@ -127,29 +127,29 @@ class SysAid::User
127
127
  self.admin = response[:admin]
128
128
  self.agreement = response[:agreement]
129
129
  self.building = response[:building]
130
- self.car_number = response[:carNumber]
130
+ self.car_number = response[:car_number]
131
131
  self.cellphone = response[:cellphone]
132
132
  self.company = response[:company]
133
133
  self.cubic = response[:cubic]
134
- self.custInt1 = response[:custInt1]
135
- self.custInt2 = response[:custInt2]
136
- self.custList1 = response[:custList1]
137
- self.custList2 = response[:custList2]
138
- self.custNotes = response[:custNotes]
139
- self.custText1 = response[:custText1]
140
- self.custText2 = response[:custText2]
134
+ self.cust_int1 = response[:cust_int1]
135
+ self.cust_int2 = response[:cust_int2]
136
+ self.cust_list1 = response[:cust_list1]
137
+ self.cust_list2 = response[:cust_list2]
138
+ self.cust_notes = response[:cust_notes]
139
+ self.cust_text1 = response[:cust_text1]
140
+ self.cust_text2 = response[:cust_text2]
141
141
  self.department = response[:department]
142
142
  self.disable = response[:disable]
143
- self.emailNotifications = response[:emailNotifications]
144
- self.enableLoginToEup = response[:enableLoginToEup]
143
+ self.email_notifications = response[:email_notifications]
144
+ self.enable_login_to_eup = response[:enableLoginToEup]
145
145
  self.floor = response[:floor]
146
146
  self.location = response[:location]
147
147
  self.manager = response[:manager]
148
148
  self.notes = response[:notes]
149
149
  self.sms = response[:sms]
150
- self.userManagerName = response[:userManagerName]
151
- self.loginDomain = response[:loginDomain]
152
- self.loginUser = response[:loginUser]
153
- self.secondaryEmail = response[:secondaryEmail]
150
+ self.user_manager_name = response[:userManagerName]
151
+ self.login_domain = response[:login_domain]
152
+ self.login_user = response[:login_user]
153
+ self.secondary_email = response[:secondaryEmail]
154
154
  end
155
155
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sysaid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Thielen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon