// NewRequestDatabaseNamesArgs initializes RequestDatabaseNamesArgs with the required arguments.
194750
func NewRequestDatabaseNamesArgs(securityOrigin string) *RequestDatabaseNamesArgs {
	args := new(RequestDatabaseNamesArgs)
	args.SecurityOrigin = securityOrigin
	return args
}
661754
func (s *GlobalCluster) SetDatabaseName(v string) *GlobalCluster {
	s.DatabaseName = &v
	return s
}
105829
func NewCreateTargetArgs(url string) *CreateTargetArgs {
	args := new(CreateTargetArgs)
	args.URL = url
	return args
}
1225517
func (c *IndexedDB) RequestDatabaseNames(securityOrigin string) ([]string, error) {
	var v IndexedDBRequestDatabaseNamesParams
	v.SecurityOrigin = securityOrigin
	return c.RequestDatabaseNamesWithParams(&v)
}
100386
func (c *httpClient) CreateDatabase(ctx context.Context, database string) error {
	query := fmt.Sprintf(`CREATE DATABASE "%s"`,
		escapeIdentifier.Replace(database))

	req, err := c.makeQueryRequest(query)

	resp, err := c.client.Do(req.WithContext(ctx))
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	queryResp := &QueryResponse{}
	dec := json.NewDecoder(resp.Body)
	err = dec.Decode(queryResp)

	if err != nil {
		if resp.StatusCode == 200 {
			c.createdDatabases[database] = true
			return nil
		}

		return &APIError{
			StatusCode: resp.StatusCode,
			Title:      resp.Status,
		}
	}

	// Even with a 200 response there can be an error
	if resp.StatusCode == http.StatusOK && queryResp.Error() == "" {
		c.createdDatabases[database] = true
		return nil
	}

	return &APIError{
		StatusCode:  resp.StatusCode,
		Title:       resp.Status,
		Description: queryResp.Error(),
	}
}
223378
func (p Params) AsNamedArgsForInvocation() string {
	if len(p) == 0 {
		return ""
	}

	params := []string{}
	for i := range p {
		if p[i].IsVariadic {
			params = append(params, unexport(p[i].Name)+"...")
		} else {
			params = append(params, unexport(p[i].Name))
		}
	}
	return strings.Join(params, ", ")
}
239578
func NewData(datasourceArgs, headerArgs []string) (*Data, error) {
	headers, err := parseHeaderArgs(headerArgs)
	if err != nil {
		return nil, err
	}

	data := &Data{
		Sources:      make(map[string]*Source),
		extraHeaders: headers,
	}

	for _, v := range datasourceArgs {
		s, err := parseSource(v)
		if err != nil {
			return nil, errors.Wrapf(err, "error parsing datasource")
		}
		s.header = headers[s.Alias]
		// pop the header out of the map, so we end up with only the unreferenced ones
		delete(headers, s.Alias)

		data.Sources[s.Alias] = s
	}
	return data, nil
}
676060
func (s *CreateEndpointInput) SetDatabaseName(v string) *CreateEndpointInput {
	s.DatabaseName = &v
	return s
}
261186
func NewGetAttributesArgs(nodeID NodeID) *GetAttributesArgs {
	args := new(GetAttributesArgs)
	args.NodeID = nodeID
	return args
}
1132205
func NewAddBindingArgs(name string) *AddBindingArgs {
	args := new(AddBindingArgs)
	args.Name = name
	return args
}
446741
func (rt *registryRoundTripper) NewRequest(method, path string,
	query *url.Values, body interface{}) (*http.Request, error) {

	req, err := rt.DefaultRequestDoer.NewRequest(method, path, query, body)

	if err != nil {
		return nil, err
	}

	if rt.holder.HasToken() {
		req.Header.Set("Authorization", "Bearer "+string(rt.holder.Token()))
	}

	req.Header.Set("User-Agent", "Torus-Daemon/"+rt.version)
	req.Header.Set("X-Registry-Version", rt.apiVersion)

	return req, nil
}
34221
func (c *IndexedDB) RequestDatabaseWithParams(v *IndexedDBRequestDatabaseParams) (*IndexedDBDatabaseWithObjectStores, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "IndexedDB.requestDatabase", Params: v})
	if err != nil {
		return nil, err
	}

	var chromeData struct {
		Result struct {
			DatabaseWithObjectStores *IndexedDBDatabaseWithObjectStores
		}
	}

	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}

	// test if error first
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}

	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}

	return chromeData.Result.DatabaseWithObjectStores, nil
}
719808
func NewDatabaseAPI(client *Client) *DatabaseAPI {
	return &DatabaseAPI{
		&baseAPI{
			client: client,
			FuncGetResourceURL: func() string {
				return "appliance"
			},
			FuncBaseSearchCondition: func() *sacloud.Request {
				res := &sacloud.Request{}
				res.AddFilter("Class", "database")
				return res
			},
		},
	}
}
733208
func (d *domainClient) GetDatabaseTableNames(ctx context.Context, args *GetDatabaseTableNamesArgs) (reply *GetDatabaseTableNamesReply, err error) {
	reply = new(GetDatabaseTableNamesReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Database.getDatabaseTableNames", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Database.getDatabaseTableNames", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Database", Op: "GetDatabaseTableNames", Err: err}
	}
	return
}
781816
func (d *domainClient) RequestDatabase(ctx context.Context, args *RequestDatabaseArgs) (reply *RequestDatabaseReply, err error) {
	reply = new(RequestDatabaseReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "IndexedDB.requestDatabase", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "IndexedDB.requestDatabase", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "IndexedDB", Op: "RequestDatabase", Err: err}
	}
	return
}
1071354
func NewRequestNodeArgs(objectID runtime.RemoteObjectID) *RequestNodeArgs {
	args := new(RequestNodeArgs)
	args.ObjectID = objectID
	return args
}
804181
func NewGetMetadataArgs(SharedFolderId string) *GetMetadataArgs {
	s := new(GetMetadataArgs)
	s.SharedFolderId = SharedFolderId
	return s
}