1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package mediaconnect
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/mediaconnect/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Updates the source of a flow.
15func (c *Client) UpdateFlowSource(ctx context.Context, params *UpdateFlowSourceInput, optFns ...func(*Options)) (*UpdateFlowSourceOutput, error) {
16	if params == nil {
17		params = &UpdateFlowSourceInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "UpdateFlowSource", params, optFns, addOperationUpdateFlowSourceMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*UpdateFlowSourceOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30// A request to update the source of a flow.
31type UpdateFlowSourceInput struct {
32
33	// The flow that is associated with the source that you want to update.
34	//
35	// This member is required.
36	FlowArn *string
37
38	// The ARN of the source that you want to update.
39	//
40	// This member is required.
41	SourceArn *string
42
43	// The type of encryption used on the content ingested from this source.
44	Decryption *types.UpdateEncryption
45
46	// A description for the source. This value is not used or seen outside of the
47	// current AWS Elemental MediaConnect account.
48	Description *string
49
50	// The ARN of the entitlement that allows you to subscribe to this flow. The
51	// entitlement is set by the flow originator, and the ARN is generated as part of
52	// the originator's flow.
53	EntitlementArn *string
54
55	// The port that the flow will be listening on for incoming content.
56	IngestPort int32
57
58	// The smoothing max bitrate for RIST, RTP, and RTP-FEC streams.
59	MaxBitrate int32
60
61	// The maximum latency in milliseconds. This parameter applies only to RIST-based
62	// and Zixi-based streams.
63	MaxLatency int32
64
65	// The minimum latency in milliseconds for SRT-based streams. In streams that use
66	// the SRT protocol, this value that you set on your MediaConnect source or output
67	// represents the minimal potential latency of that connection. The latency of the
68	// stream is set to the highest number between the sender’s minimum latency and the
69	// receiver’s minimum latency.
70	MinLatency int32
71
72	// The protocol that is used by the source.
73	Protocol types.Protocol
74
75	// The stream ID that you want to use for this transport. This parameter applies
76	// only to Zixi-based streams.
77	StreamId *string
78
79	// The name of the VPC Interface to configure this Source with.
80	VpcInterfaceName *string
81
82	// The range of IP addresses that should be allowed to contribute content to your
83	// source. These IP addresses should be in the form of a Classless Inter-Domain
84	// Routing (CIDR) block; for example, 10.0.0.0/16.
85	WhitelistCidr *string
86}
87
88type UpdateFlowSourceOutput struct {
89
90	// The ARN of the flow that you want to update.
91	FlowArn *string
92
93	// The settings for the source of the flow.
94	Source *types.Source
95
96	// Metadata pertaining to the operation's result.
97	ResultMetadata middleware.Metadata
98}
99
100func addOperationUpdateFlowSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
101	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFlowSource{}, middleware.After)
102	if err != nil {
103		return err
104	}
105	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFlowSource{}, middleware.After)
106	if err != nil {
107		return err
108	}
109	if err = addSetLoggerMiddleware(stack, options); err != nil {
110		return err
111	}
112	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
113		return err
114	}
115	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
116		return err
117	}
118	if err = addResolveEndpointMiddleware(stack, options); err != nil {
119		return err
120	}
121	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
122		return err
123	}
124	if err = addRetryMiddlewares(stack, options); err != nil {
125		return err
126	}
127	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
128		return err
129	}
130	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
131		return err
132	}
133	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
134		return err
135	}
136	if err = addClientUserAgent(stack); err != nil {
137		return err
138	}
139	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
140		return err
141	}
142	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
143		return err
144	}
145	if err = addOpUpdateFlowSourceValidationMiddleware(stack); err != nil {
146		return err
147	}
148	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFlowSource(options.Region), middleware.Before); err != nil {
149		return err
150	}
151	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
152		return err
153	}
154	if err = addResponseErrorMiddleware(stack); err != nil {
155		return err
156	}
157	if err = addRequestResponseLogging(stack, options); err != nil {
158		return err
159	}
160	return nil
161}
162
163func newServiceMetadataMiddleware_opUpdateFlowSource(region string) *awsmiddleware.RegisterServiceMetadata {
164	return &awsmiddleware.RegisterServiceMetadata{
165		Region:        region,
166		ServiceID:     ServiceID,
167		SigningName:   "mediaconnect",
168		OperationName: "UpdateFlowSource",
169	}
170}
171