github.com/twilio/twilio-go@v1.20.1/rest/api/v2010/model_api_v2010_recording_transcription.go (about)

     1  /*
     2   * This code was generated by
     3   * ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
     4   *  |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
     5   *  |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
     6   *
     7   * Twilio - Api
     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  // ApiV2010RecordingTranscription struct for ApiV2010RecordingTranscription
    24  type ApiV2010RecordingTranscription struct {
    25  	// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resource.
    26  	AccountSid *string `json:"account_sid,omitempty"`
    27  	// The API version used to create the transcription.
    28  	ApiVersion *string `json:"api_version,omitempty"`
    29  	// The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    30  	DateCreated *string `json:"date_created,omitempty"`
    31  	// The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    32  	DateUpdated *string `json:"date_updated,omitempty"`
    33  	// The duration of the transcribed audio in seconds.
    34  	Duration *string `json:"duration,omitempty"`
    35  	// The charge for the transcript in the currency associated with the account. This value is populated after the transcript is complete so it may not be available immediately.
    36  	Price *float32 `json:"price,omitempty"`
    37  	// The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`).
    38  	PriceUnit *string `json:"price_unit,omitempty"`
    39  	// The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) from which the transcription was created.
    40  	RecordingSid *string `json:"recording_sid,omitempty"`
    41  	// The unique string that that we created to identify the Transcription resource.
    42  	Sid    *string `json:"sid,omitempty"`
    43  	Status *string `json:"status,omitempty"`
    44  	// The text content of the transcription.
    45  	TranscriptionText *string `json:"transcription_text,omitempty"`
    46  	// The transcription type.
    47  	Type *string `json:"type,omitempty"`
    48  	// The URI of the resource, relative to `https://api.twilio.com`.
    49  	Uri *string `json:"uri,omitempty"`
    50  }
    51  
    52  func (response *ApiV2010RecordingTranscription) UnmarshalJSON(bytes []byte) (err error) {
    53  	raw := struct {
    54  		AccountSid        *string      `json:"account_sid"`
    55  		ApiVersion        *string      `json:"api_version"`
    56  		DateCreated       *string      `json:"date_created"`
    57  		DateUpdated       *string      `json:"date_updated"`
    58  		Duration          *string      `json:"duration"`
    59  		Price             *interface{} `json:"price"`
    60  		PriceUnit         *string      `json:"price_unit"`
    61  		RecordingSid      *string      `json:"recording_sid"`
    62  		Sid               *string      `json:"sid"`
    63  		Status            *string      `json:"status"`
    64  		TranscriptionText *string      `json:"transcription_text"`
    65  		Type              *string      `json:"type"`
    66  		Uri               *string      `json:"uri"`
    67  	}{}
    68  
    69  	if err = json.Unmarshal(bytes, &raw); err != nil {
    70  		return err
    71  	}
    72  
    73  	*response = ApiV2010RecordingTranscription{
    74  		AccountSid:        raw.AccountSid,
    75  		ApiVersion:        raw.ApiVersion,
    76  		DateCreated:       raw.DateCreated,
    77  		DateUpdated:       raw.DateUpdated,
    78  		Duration:          raw.Duration,
    79  		PriceUnit:         raw.PriceUnit,
    80  		RecordingSid:      raw.RecordingSid,
    81  		Sid:               raw.Sid,
    82  		Status:            raw.Status,
    83  		TranscriptionText: raw.TranscriptionText,
    84  		Type:              raw.Type,
    85  		Uri:               raw.Uri,
    86  	}
    87  
    88  	responsePrice, err := client.UnmarshalFloat32(raw.Price)
    89  	if err != nil {
    90  		return err
    91  	}
    92  	response.Price = responsePrice
    93  
    94  	return
    95  }