github.com/twilio/twilio-go@v1.20.1/rest/flex/v1/model_flex_v1_insights_assessments_comment.go (about) 1 /* 2 * This code was generated by 3 * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ 4 * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ 5 * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ 6 * 7 * Twilio - Flex 8 * This is the public Twilio REST API. 9 * 10 * NOTE: This class is auto generated by OpenAPI Generator. 11 * https://openapi-generator.tech 12 * Do not edit the class manually. 13 */ 14 15 package openapi 16 17 import ( 18 "encoding/json" 19 20 "github.com/twilio/twilio-go/client" 21 ) 22 23 // FlexV1InsightsAssessmentsComment struct for FlexV1InsightsAssessmentsComment 24 type FlexV1InsightsAssessmentsComment struct { 25 // The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. 26 AccountSid *string `json:"account_sid,omitempty"` 27 // The SID of the assessment. 28 AssessmentSid *string `json:"assessment_sid,omitempty"` 29 // The comment added for assessment. 30 Comment *interface{} `json:"comment,omitempty"` 31 // The offset 32 Offset *float32 `json:"offset,omitempty"` 33 // The flag indicating if this assessment is part of report 34 Report *bool `json:"report,omitempty"` 35 // The weightage given to this comment 36 Weight *float32 `json:"weight,omitempty"` 37 // The id of the agent. 38 AgentId *string `json:"agent_id,omitempty"` 39 // The id of the segment. 40 SegmentId *string `json:"segment_id,omitempty"` 41 // The name of the user. 42 UserName *string `json:"user_name,omitempty"` 43 // The email id of the user. 44 UserEmail *string `json:"user_email,omitempty"` 45 // The timestamp when the record is inserted 46 Timestamp *float32 `json:"timestamp,omitempty"` 47 Url *string `json:"url,omitempty"` 48 } 49 50 func (response *FlexV1InsightsAssessmentsComment) UnmarshalJSON(bytes []byte) (err error) { 51 raw := struct { 52 AccountSid *string `json:"account_sid"` 53 AssessmentSid *string `json:"assessment_sid"` 54 Comment *interface{} `json:"comment"` 55 Offset *interface{} `json:"offset"` 56 Report *bool `json:"report"` 57 Weight *interface{} `json:"weight"` 58 AgentId *string `json:"agent_id"` 59 SegmentId *string `json:"segment_id"` 60 UserName *string `json:"user_name"` 61 UserEmail *string `json:"user_email"` 62 Timestamp *interface{} `json:"timestamp"` 63 Url *string `json:"url"` 64 }{} 65 66 if err = json.Unmarshal(bytes, &raw); err != nil { 67 return err 68 } 69 70 *response = FlexV1InsightsAssessmentsComment{ 71 AccountSid: raw.AccountSid, 72 AssessmentSid: raw.AssessmentSid, 73 Comment: raw.Comment, 74 Report: raw.Report, 75 AgentId: raw.AgentId, 76 SegmentId: raw.SegmentId, 77 UserName: raw.UserName, 78 UserEmail: raw.UserEmail, 79 Url: raw.Url, 80 } 81 82 responseOffset, err := client.UnmarshalFloat32(raw.Offset) 83 if err != nil { 84 return err 85 } 86 response.Offset = responseOffset 87 88 responseWeight, err := client.UnmarshalFloat32(raw.Weight) 89 if err != nil { 90 return err 91 } 92 response.Weight = responseWeight 93 94 responseTimestamp, err := client.UnmarshalFloat32(raw.Timestamp) 95 if err != nil { 96 return err 97 } 98 response.Timestamp = responseTimestamp 99 100 return 101 }