func CreateIotThingType()

in aws/iot.go [49:74]


func CreateIotThingType(client IotClient, iotThingType *string) *CreateIotThingTypeOutput {

	describeThingTypeOutput := GetIotThingType(client, iotThingType)

	if describeThingTypeOutput != nil {
		return &CreateIotThingTypeOutput{
			ThingTypeName: describeThingTypeOutput.ThingTypeName,
			ThingTypeArn:  describeThingTypeOutput.ThingTypeArn,
			ThingTypeId:   describeThingTypeOutput.ThingTypeId,
		}
	}

	ret, err := client.CreateThingType(context.TODO(), &iot.CreateThingTypeInput{
		ThingTypeName: iotThingType,
	})

	if err != nil {
		log.Fatalf("Failed to create thing type %s.Encountered error %s\n", *iotThingType, err)
	}

	return &CreateIotThingTypeOutput{
		ThingTypeArn:  ret.ThingTypeArn,
		ThingTypeId:   ret.ThingTypeId,
		ThingTypeName: ret.ThingTypeName,
	}
}