// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ivs import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) type CreateChannelInput struct { _ struct{} `type:"structure"` // Channel latency mode. Default: LOW. LatencyMode ChannelLatencyMode `locationName:"latencyMode" type:"string" enum:"true"` // Channel name. Name *string `locationName:"name" type:"string"` // See Channel$tags. Tags map[string]string `locationName:"tags" type:"map"` // Channel type, which determines the allowable resolution and bitrate. STANDARD: // The stream is transcoded; resolution (width, in landscape orientation) can // be up to 1080p or the input source resolution, whichever is lower; and bitrate // can be up to 8.5 Mbps. BASIC: The stream is transfixed; resolution can be // up to 480p; and bitrate can be up to 1.5 Mbps. Default: STANDARD. Type ChannelType `locationName:"type" type:"string" enum:"true"` } // String returns the string representation func (s CreateChannelInput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s CreateChannelInput) MarshalFields(e protocol.FieldEncoder) error { e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{}) if len(s.LatencyMode) > 0 { v := s.LatencyMode metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "latencyMode", protocol.QuotedValue{ValueMarshaler: v}, metadata) } if s.Name != nil { v := *s.Name metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "name", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.Tags != nil { v := s.Tags metadata := protocol.Metadata{} ms0 := e.Map(protocol.BodyTarget, "tags", metadata) ms0.Start() for k1, v1 := range v { ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)}) } ms0.End() } if len(s.Type) > 0 { v := s.Type metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "type", protocol.QuotedValue{ValueMarshaler: v}, metadata) } return nil } type CreateChannelOutput struct { _ struct{} `type:"structure"` // Object specifying a channel. Channel *Channel `locationName:"channel" type:"structure"` // Object specifying a stream key. StreamKey *StreamKey `locationName:"streamKey" type:"structure"` } // String returns the string representation func (s CreateChannelOutput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s CreateChannelOutput) MarshalFields(e protocol.FieldEncoder) error { if s.Channel != nil { v := s.Channel metadata := protocol.Metadata{} e.SetFields(protocol.BodyTarget, "channel", v, metadata) } if s.StreamKey != nil { v := s.StreamKey metadata := protocol.Metadata{} e.SetFields(protocol.BodyTarget, "streamKey", v, metadata) } return nil } const opCreateChannel = "CreateChannel" // CreateChannelRequest returns a request value for making API operation for // Amazon Interactive Video Service. // // Creates a new channel and an associated stream key to start streaming. // // // Example sending a request using CreateChannelRequest. // req := client.CreateChannelRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/ivs-2020-07-14/CreateChannel func (c *Client) CreateChannelRequest(input *CreateChannelInput) CreateChannelRequest { op := &aws.Operation{ Name: opCreateChannel, HTTPMethod: "POST", HTTPPath: "/CreateChannel", } if input == nil { input = &CreateChannelInput{} } req := c.newRequest(op, input, &CreateChannelOutput{}) return CreateChannelRequest{Request: req, Input: input, Copy: c.CreateChannelRequest} } // CreateChannelRequest is the request type for the // CreateChannel API operation. type CreateChannelRequest struct { *aws.Request Input *CreateChannelInput Copy func(*CreateChannelInput) CreateChannelRequest } // Send marshals and sends the CreateChannel API request. func (r CreateChannelRequest) Send(ctx context.Context) (*CreateChannelResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &CreateChannelResponse{ CreateChannelOutput: r.Request.Data.(*CreateChannelOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // CreateChannelResponse is the response type for the // CreateChannel API operation. type CreateChannelResponse struct { *CreateChannelOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // CreateChannel request. func (r *CreateChannelResponse) SDKResponseMetdata() *aws.Response { return r.response }