github.com/twilio/twilio-go@v1.20.1/rest/flex/v1/model_flex_v1_insights_assessments.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  // FlexV1InsightsAssessments struct for FlexV1InsightsAssessments
    24  type FlexV1InsightsAssessments struct {
    25  	// The unique SID identifier of the Account.
    26  	AccountSid *string `json:"account_sid,omitempty"`
    27  	// The SID of the assessment
    28  	AssessmentSid *string `json:"assessment_sid,omitempty"`
    29  	// Offset of the conversation
    30  	Offset *float32 `json:"offset,omitempty"`
    31  	// The flag indicating if this assessment is part of report
    32  	Report *bool `json:"report,omitempty"`
    33  	// The weightage given to this comment
    34  	Weight *float32 `json:"weight,omitempty"`
    35  	// The id of the Agent
    36  	AgentId *string `json:"agent_id,omitempty"`
    37  	// Segment Id of conversation
    38  	SegmentId *string `json:"segment_id,omitempty"`
    39  	// The name of the user.
    40  	UserName *string `json:"user_name,omitempty"`
    41  	// The email id of the user.
    42  	UserEmail *string `json:"user_email,omitempty"`
    43  	// The answer text selected by user
    44  	AnswerText *string `json:"answer_text,omitempty"`
    45  	// The id of the answer selected by user
    46  	AnswerId *string `json:"answer_id,omitempty"`
    47  	// Assessment Details associated with an assessment
    48  	Assessment *interface{} `json:"assessment,omitempty"`
    49  	Timestamp  *float32     `json:"timestamp,omitempty"`
    50  	Url        *string      `json:"url,omitempty"`
    51  }
    52  
    53  func (response *FlexV1InsightsAssessments) UnmarshalJSON(bytes []byte) (err error) {
    54  	raw := struct {
    55  		AccountSid    *string      `json:"account_sid"`
    56  		AssessmentSid *string      `json:"assessment_sid"`
    57  		Offset        *interface{} `json:"offset"`
    58  		Report        *bool        `json:"report"`
    59  		Weight        *interface{} `json:"weight"`
    60  		AgentId       *string      `json:"agent_id"`
    61  		SegmentId     *string      `json:"segment_id"`
    62  		UserName      *string      `json:"user_name"`
    63  		UserEmail     *string      `json:"user_email"`
    64  		AnswerText    *string      `json:"answer_text"`
    65  		AnswerId      *string      `json:"answer_id"`
    66  		Assessment    *interface{} `json:"assessment"`
    67  		Timestamp     *interface{} `json:"timestamp"`
    68  		Url           *string      `json:"url"`
    69  	}{}
    70  
    71  	if err = json.Unmarshal(bytes, &raw); err != nil {
    72  		return err
    73  	}
    74  
    75  	*response = FlexV1InsightsAssessments{
    76  		AccountSid:    raw.AccountSid,
    77  		AssessmentSid: raw.AssessmentSid,
    78  		Report:        raw.Report,
    79  		AgentId:       raw.AgentId,
    80  		SegmentId:     raw.SegmentId,
    81  		UserName:      raw.UserName,
    82  		UserEmail:     raw.UserEmail,
    83  		AnswerText:    raw.AnswerText,
    84  		AnswerId:      raw.AnswerId,
    85  		Assessment:    raw.Assessment,
    86  		Url:           raw.Url,
    87  	}
    88  
    89  	responseOffset, err := client.UnmarshalFloat32(raw.Offset)
    90  	if err != nil {
    91  		return err
    92  	}
    93  	response.Offset = responseOffset
    94  
    95  	responseWeight, err := client.UnmarshalFloat32(raw.Weight)
    96  	if err != nil {
    97  		return err
    98  	}
    99  	response.Weight = responseWeight
   100  
   101  	responseTimestamp, err := client.UnmarshalFloat32(raw.Timestamp)
   102  	if err != nil {
   103  		return err
   104  	}
   105  	response.Timestamp = responseTimestamp
   106  
   107  	return
   108  }