How to use the @azure-tools/codegen.camelCase function in @azure-tools/codegen

To help you get started, we’ve selected a few @azure-tools/codegen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / autorest.go / src / generator / convenience / client.ts View on Github external
text += 'func DefaultClientOptions() ClientOptions {\n';
  text += '\treturn ClientOptions{\n';
  text += '\t\tHTTPClient: azcore.DefaultHTTPClientTransport(),\n';
  text += '\t\tRetry: azcore.DefaultRetryOptions(),\n';
  text += '\t}\n';
  text += '}\n\n';

  // Client
  if (session.model.info.description) {
    text += `// Client - ${session.model.info.description}\n`;
  }
  text += 'type Client struct {\n';
  text += `\t${urlVar} *url.URL\n`;
  text += `\t${pipelineVar} azcore.Pipeline\n`;
  for (const op of values(session.model.operationGroups)) {
    text += `\t${camelCase(op.language.go!.clientName)} ${op.language.go!.clientName}\n`;
  }
  text += '}\n\n';

  const endpoint = getDefaultEndpoint(session.model.globalParameters);
  if (endpoint) {
    text += '// DefaultEndpoint is the default service endpoint.\n';
    text += `const DefaultEndpoint = "${endpoint}"\n\n`;
    text += '// NewDefaultClient creates an instance of the Client type using the DefaultEndpoint.\n';
    text += 'func NewDefaultClient(options *ClientOptions) (*Client, error) {\n';
    text += '\treturn NewClient(DefaultEndpoint, options)\n';
    text += '}\n\n';
  }

  text += '// NewClient creates an instance of the Client type with the specified endpoint.\n';
  text += 'func NewClient(endpoint string, options *ClientOptions) (*Client, error) {\n';
  text += '\tif options == nil {\n';