Skip to content

Commit

Permalink
chore(transcribe): property cleanup, default is RFC3339, nil is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Oct 2, 2024
1 parent d8a57a4 commit 47a768d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 48 deletions.
8 changes: 2 additions & 6 deletions resources/transcribe-call-analytics-category.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,8 @@ func (r *TranscribeCallAnalyticsCategory) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("Name", r.name)
properties.Set("InputType", r.inputType)
if r.createTime != nil {
properties.Set("CreateTime", r.createTime.Format(time.RFC3339))
}
if r.lastUpdateTime != nil {
properties.Set("LastUpdateTime", r.lastUpdateTime.Format(time.RFC3339))
}
properties.Set("CreateTime", r.createTime)
properties.Set("LastUpdateTime", r.lastUpdateTime)
return properties
}

Expand Down
12 changes: 3 additions & 9 deletions resources/transcribe-call-analytics-job.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,11 @@ func (r *TranscribeCallAnalyticsJob) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("Name", r.name)
properties.Set("Status", r.status)
if r.completionTime != nil {
properties.Set("CompletionTime", r.completionTime.Format(time.RFC3339))
}
if r.creationTime != nil {
properties.Set("CreationTime", r.creationTime.Format(time.RFC3339))
}
properties.Set("CompletionTime", r.completionTime)
properties.Set("CreationTime", r.creationTime)
properties.Set("FailureReason", r.failureReason)
properties.Set("LanguageCode", r.languageCode)
if r.startTime != nil {
properties.Set("StartTime", r.startTime.Format(time.RFC3339))
}
properties.Set("StartTime", r.startTime)
return properties
}

Expand Down
8 changes: 2 additions & 6 deletions resources/transcribe-language-model.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,10 @@ func (r *TranscribeLanguageModel) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("Name", r.name)
properties.Set("BaseModelName", r.baseModelName)
if r.createTime != nil {
properties.Set("CreateTime", r.createTime.Format(time.RFC3339))
}
properties.Set("CreateTime", r.createTime)
properties.Set("FailureReason", r.failureReason)
properties.Set("LanguageCode", r.languageCode)
if r.lastModifiedTime != nil {
properties.Set("LastModifiedTime", r.lastModifiedTime.Format(time.RFC3339))
}
properties.Set("LastModifiedTime", r.lastModifiedTime)
properties.Set("ModelStatus", r.modelStatus)
properties.Set("UpgradeAvailability", r.upgradeAvailability)
return properties
Expand Down
12 changes: 3 additions & 9 deletions resources/transcribe-medical-transcription-job.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,14 @@ func (r *TranscribeMedicalTranscriptionJob) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("Name", r.name)
properties.Set("Status", r.status)
if r.completionTime != nil {
properties.Set("CompletionTime", r.completionTime.Format(time.RFC3339))
}
properties.Set("CompletionTime", r.completionTime)
properties.Set("ContentIdentificationType", r.contentIdentificationType)
if r.creationTime != nil {
properties.Set("CreationTime", r.creationTime.Format(time.RFC3339))
}
properties.Set("CreationTime", r.creationTime)
properties.Set("FailureReason", r.failureReason)
properties.Set("LanguageCode", r.languageCode)
properties.Set("OutputLocationType", r.outputLocationType)
properties.Set("Specialty", r.specialty)
if r.startTime != nil {
properties.Set("StartTime", r.startTime.Format(time.RFC3339))
}
properties.Set("StartTime", r.startTime)
properties.Set("InputType", r.inputType)
return properties
}
Expand Down
4 changes: 1 addition & 3 deletions resources/transcribe-medical-vocabulary.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ func (r *TranscribeMedicalVocabulary) Properties() types.Properties {
properties.Set("Name", r.name)
properties.Set("State", r.state)
properties.Set("LanguageCode", r.languageCode)
if r.lastModifiedTime != nil {
properties.Set("LastModifiedTime", r.lastModifiedTime.Format(time.RFC3339))
}
properties.Set("LastModifiedTime", r.lastModifiedTime)
return properties
}

Expand Down
12 changes: 3 additions & 9 deletions resources/transcribe-transcription-job.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,11 @@ func (r *TranscribeTranscriptionJob) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("Name", r.name)
properties.Set("Status", r.status)
if r.completionTime != nil {
properties.Set("CompletionTime", r.completionTime.Format(time.RFC3339))
}
if r.creationTime != nil {
properties.Set("CreationTime", r.creationTime.Format(time.RFC3339))
}
properties.Set("CompletionTime", r.completionTime)
properties.Set("CreationTime", r.creationTime)
properties.Set("FailureReason", r.failureReason)
properties.Set("LanguageCode", r.languageCode)
if r.startTime != nil {
properties.Set("StartTime", r.startTime.Format(time.RFC3339))
}
properties.Set("StartTime", r.startTime)
return properties
}

Expand Down
4 changes: 1 addition & 3 deletions resources/transcribe-vocabulary-filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ func (r *TranscribeVocabularyFilter) Properties() types.Properties {
properties := types.NewProperties()
properties.Set("Name", r.name)
properties.Set("LanguageCode", r.languageCode)
if r.lastModifiedTime != nil {
properties.Set("LastModifiedTime", r.lastModifiedTime.Format(time.RFC3339))
}
properties.Set("LastModifiedTime", r.lastModifiedTime)
return properties
}
4 changes: 1 addition & 3 deletions resources/transcribe-vocabulary.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ func (r *TranscribeVocabulary) Properties() types.Properties {
properties.Set("Name", r.name)
properties.Set("State", r.state)
properties.Set("LanguageCode", r.languageCode)
if r.lastModifiedTime != nil {
properties.Set("LastModifiedTime", r.lastModifiedTime.Format(time.RFC3339))
}
properties.Set("LastModifiedTime", r.lastModifiedTime)
return properties
}

Expand Down

0 comments on commit 47a768d

Please sign in to comment.