codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/AwsHttpPresignURLClientGenerator.java
private void writePresignClientType(
            GoWriter writer,
            Model model,
            SymbolProvider symbolProvider,
            ServiceShape serviceShape
    ) {
        writer.addUseImports(SmithyGoDependency.CONTEXT);
        writer.addUseImports(AwsGoDependency.AWS_SIGNER_V4);

        writer.writeDocs(String.format("%s represents the presign url client", PRESIGN_CLIENT));
        writer.openBlock("type $T struct {", "}", presignClientSymbol, () -> {
            writer.write("client *Client");
            writer.write("options $T", presignOptionsSymbol);
        });
        writer.write("");

        // generate NewPresignClient
        writer.writeDocs(
                String.format("%s generates a presign client using provided API Client and presign options",
                        NEW_CLIENT)
        );
        writer.openBlock("func $L(c *Client, optFns ...func($P)) $P {", "}",
                NEW_CLIENT, presignOptionsSymbol, presignClientSymbol, () -> {
                    writer.write("var options $T", presignOptionsSymbol);
                    processFunctionalOptions(writer, "optFns", "options");

                    writer.openBlock("if len(options.ClientOptions) != 0 {", "}", () -> {
                        writer.write("c = New(c.options, options.ClientOptions...)");
                    });
                    writer.write("");

                    writer.openBlock("if options.Presigner == nil {", "}", () -> {
                        writer.write("options.Presigner = $L(c.options)", AwsSignatureVersion4.NEW_SIGNER_FUNC_NAME);
                    });
                    writer.write("");

                    if (isS3ServiceShape(model, serviceShape)) {
                        writer.openBlock("if options.presignerV4a == nil {", "}", () -> {
                            writer.write("options.presignerV4a = $L(c.options)", AwsSignatureVersion4.NEW_SIGNER_V4A_FUNC_NAME);
                        });
                        writer.write("");
                    }

                    writer.openBlock("return &$L{", "}", presignClientSymbol, () -> {
                        writer.write("client: c,");
                        writer.write("options: options,");
                    });
                });
        writer.write("");
    }
/**
     * Writes the Presign client's type and methods.
     *
     * @param writer writer to write to
     */
Writes the Presign client's type and methods.
@param writer writer to write to
Writes the Presign client ' s type and methods . @param writer writer to write to
private void writePresignClientType(
            GoWriter writer,
            Model model,
            SymbolProvider symbolProvider,
            ServiceShape serviceShape
    ) {
        writer.addUseImports(SmithyGoDependency.CONTEXT);
        writer.addUseImports(AwsGoDependency.AWS_SIGNER_V4);
        writer.writeDocs(String.format("%s represents the presign url client", PRESIGN_CLIENT));
        writer.openBlock("type $T struct {", "}", presignClientSymbol, () -> {
            writer.write("client *Client");
            writer.write("options $T", presignOptionsSymbol);
        });
        writer.write("");
        writer.writeDocs(
                String.format("%s generates a presign client using provided API Client and presign options",
                        NEW_CLIENT)
        );
        writer.openBlock("func $L(c *Client, optFns ...func($P)) $P {", "}",
                NEW_CLIENT, presignOptionsSymbol, presignClientSymbol, () -> {
                    writer.write("var options $T", presignOptionsSymbol);
                    processFunctionalOptions(writer, "optFns", "options");
                    writer.openBlock("if len(options.ClientOptions) != 0 {", "}", () -> {
                        writer.write("c = New(c.options, options.ClientOptions...)");
                    });
                    writer.write("");
                    writer.openBlock("if options.Presigner == nil {", "}", () -> {
                        writer.write("options.Presigner = $L(c.options)", AwsSignatureVersion4.NEW_SIGNER_FUNC_NAME);
                    });
                    writer.write("");
                    if (isS3ServiceShape(model, serviceShape)) {
                        writer.openBlock("if options.presignerV4a == nil {", "}", () -> {
                            writer.write("options.presignerV4a = $L(c.options)", AwsSignatureVersion4.NEW_SIGNER_V4A_FUNC_NAME);
                        });
                        writer.write("");
                    }
                    writer.openBlock("return &$L{", "}", presignClientSymbol, () -> {
                        writer.write("client: c,");
                        writer.write("options: options,");
                    });
                });
        writer.write("");
    }
private void writePresignClientType ( GoWriter writer , Model model , SymbolProvider symbolProvider , ServiceShape serviceShape ) { writer . addUseImports ( SmithyGoDependency . CONTEXT ) ; writer . addUseImports ( AwsGoDependency . AWS_SIGNER_V4 ) ; writer . writeDocs ( String . format ( "%s represents the presign url client" , PRESIGN_CLIENT ) ) ; writer . openBlock ( "type $T struct {" , "}" , presignClientSymbol , ( ) -> { writer . write ( "client *Client" ) ; writer . write ( "options $T" , presignOptionsSymbol ) ; } ) ; writer . write ( "" ) ; writer . writeDocs ( String . format ( "%s generates a presign client using provided API Client and presign options" , NEW_CLIENT ) ) ; writer . openBlock ( "func $L(c *Client, optFns ...func($P)) $P {" , "}" , NEW_CLIENT , presignOptionsSymbol , presignClientSymbol , ( ) -> { writer . write ( "var options $T" , presignOptionsSymbol ) ; processFunctionalOptions ( writer , "optFns" , "options" ) ; writer . openBlock ( "if len(options.ClientOptions) != 0 {" , "}" , ( ) -> { writer . write ( "c = New(c.options, options.ClientOptions...)" ) ; } ) ; writer . write ( "" ) ; writer . openBlock ( "if options.Presigner == nil {" , "}" , ( ) -> { writer . write ( "options.Presigner = $L(c.options)" , AwsSignatureVersion4 . NEW_SIGNER_FUNC_NAME ) ; } ) ; writer . write ( "" ) ; if ( isS3ServiceShape ( model , serviceShape ) ) { writer . openBlock ( "if options.presignerV4a == nil {" , "}" , ( ) -> { writer . write ( "options.presignerV4a = $L(c.options)" , AwsSignatureVersion4 . NEW_SIGNER_V4A_FUNC_NAME ) ; } ) ; writer . write ( "" ) ; } writer . openBlock ( "return &$L{" , "}" , presignClientSymbol , ( ) -> { writer . write ( "client: c," ) ; writer . write ( "options: options," ) ; } ) ; } ) ; writer . write ( "" ) ; }
Writes the Presign client's type and methods.
Writes the Presign client ' s type and methods .
// generate NewPresignClient