// NewRequestCacheNamesArgs initializes RequestCacheNamesArgs with the required arguments.
544957
func NewRequestCacheNamesArgs(securityOrigin string) *RequestCacheNamesArgs {
	args := new(RequestCacheNamesArgs)
	args.SecurityOrigin = securityOrigin
	return args
}
1003283
func (c *Client) NewRequest(method, path string, body *bytes.Buffer,
	requestDate string) (*http.Request, error) {

	url, err := url.Parse(c.URL + path)
	if err != nil {
		return nil, fmt.Errorf("Error parsing base URL: %s", err)
	}

	// Build the request
	req, err := http.NewRequest(method, url.String(), body)
	if err != nil {
		return nil, fmt.Errorf("Error creating request: %s", err)
	}

	// Calculate the hexadecimal HMAC SHA1 of requestDate using sKey
	key := []byte(c.SKey)
	h := hmac.New(sha1.New, key)
	if len(requestDate) == 0 {
		requestDate = time.Now().UTC().Format(http.TimeFormat)
	}
	h.Write([]byte(requestDate))
	hmacString := hex.EncodeToString(h.Sum(nil))

	// Add the authorization header
	req.Header.Add("X-Dnsme-Apikey", c.AKey)
	req.Header.Add("X-Dnsme-Requestdate", requestDate)
	req.Header.Add("X-Dnsme-Hmac", hmacString)
	req.Header.Add("Accept", "application/json")

	// If it's a not a get, add a content-type
	if method != "GET" {
		req.Header.Add("Content-Type", "application/json")
	}
	return req, nil
}
723958
func NewRequest(method, path string) *Request {
	return &Request{
		method: method,
		url: &url.URL{
			Path: path,
		},
		header: make(http.Header),
		Params: make(url.Values),
	}
}
802165
func (c *agencyConnection) NewRequest(method, path string) (driver.Request, error) {
	c.mutex.RLock()
	defer c.mutex.RUnlock()

	if len(c.connections) == 0 {
		return nil, driver.WithStack(fmt.Errorf("no connections"))
	}
	r, err := c.connections[0].NewRequest(method, path)
	if err != nil {
		return nil, driver.WithStack(err)
	}
	return r, nil
}
1071690
func (d *domainClient) RequestCacheNames(ctx context.Context, args *RequestCacheNamesArgs) (reply *RequestCacheNamesReply, err error) {
	reply = new(RequestCacheNamesReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "CacheStorage.requestCacheNames", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "CacheStorage.requestCacheNames", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "CacheStorage", Op: "RequestCacheNames", Err: err}
	}
	return
}
1312907
func NewCCache() *CCache {
	if maxSize == 0 {
		return nil
	}

	cc := &CCache{
		metricCache:   make(map[schema.AMKey]*CCacheMetric),
		metricRawKeys: make(map[schema.MKey]map[schema.Archive]struct{}),
		accnt:         accnt.NewFlatAccnt(maxSize),
		stop:          make(chan interface{}),
		tracer:        opentracing.NoopTracer{},
	}
	go cc.evictLoop()
	return cc
}
1071354
func NewRequestNodeArgs(objectID runtime.RemoteObjectID) *RequestNodeArgs {
	args := new(RequestNodeArgs)
	args.ObjectID = objectID
	return args
}
1071464
func (c *clusterConnection) NewRequest(method, path string) (driver.Request, error) {
	c.mutex.RLock()
	servers := c.servers
	c.mutex.RUnlock()

	// It is assumed that all servers used the same protocol.
	if len(servers) > 0 {
		return servers[0].NewRequest(method, path)
	}
	return nil, driver.WithStack(driver.ArangoError{
		HasError:     true,
		Code:         http.StatusServiceUnavailable,
		ErrorMessage: "no servers available",
	})
}
44917
func (c *Client) NewRequest(params map[string]string, method string, action string) (*http.Request, error) {
	p := url.Values{}
	u, err := url.Parse(c.URL)

	if err != nil {
		return nil, fmt.Errorf("Error parsing base URL: %s", err)
	}

	// Build up our request parameters
	for k, v := range params {
		p.Add(k, v)
	}

	// Add authentication details
	p.Add("tkn", c.Token)
	p.Add("email", c.Email)

	// The "action" to take against the API
	p.Add("a", action)

	// Add the params to our URL
	u.RawQuery = p.Encode()

	// Build the request
	req, err := http.NewRequest(method, u.String(), nil)

	if err != nil {
		return nil, fmt.Errorf("Error creating request: %s", err)
	}

	return req, nil

}
119077
func NewGetApplicationCacheForFrameArgs(frameID page.FrameID) *GetApplicationCacheForFrameArgs {
	args := new(GetApplicationCacheForFrameArgs)
	args.FrameID = frameID
	return args
}
1118894
func NewRequest(addr storage.Address, skipCheck bool, peersToSkip *sync.Map) *Request {
	return &Request{
		Addr:        addr,
		SkipCheck:   skipCheck,
		peersToSkip: peersToSkip,
	}
}
1320291
func (c *CacheStorage) RequestCacheNamesWithParams(v *CacheStorageRequestCacheNamesParams) ([]*CacheStorageCache, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "CacheStorage.requestCacheNames", Params: v})
	if err != nil {
		return nil, err
	}

	var chromeData struct {
		Result struct {
			Caches []*CacheStorageCache
		}
	}

	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.Caches, nil
}
400699
func (fw *Framework) NewRequest(version string, agent string, senderid string, callerid string, ttl int, requestid string, collective string) (request protocol.Request, err error) {
	switch version {
	case protocol.RequestV1:
		request, err = v1.NewRequest(agent, senderid, callerid, ttl, requestid, collective)
	default:
		err = fmt.Errorf("Do not know how to create a Request version %s", version)
	}

	return
}
27495
func NewGetDatabaseTableNamesArgs(databaseID ID) *GetDatabaseTableNamesArgs {
	args := new(GetDatabaseTableNamesArgs)
	args.DatabaseID = databaseID
	return args
}
32598
func NewRequest() *Request {
	ctx := context.New()
	ctx.Client.Transport = DefaultTransport
	ctx.Request.Header.Set("User-Agent", UserAgent)
	return &Request{
		Context:    ctx,
		Middleware: middleware.New(),
	}
}
905973
func NewCustomRequestProcessor(address string) *RequestProcessor {
	r := NewRequestProcessor()

	if address != "" {
		r.address = address
	}

	return r
}
884563
func NewRequest(method string, params ...interface{}) *RPCRequest {
	request := &RPCRequest{
		Method:  method,
		Params:  Params(params...),
		JSONRPC: jsonrpcVersion,
	}

	return request
}