Do executes the "firebaserules.projects.rulesets.create" call. Exactly one of *Ruleset or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Ruleset.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

Do is referenced in 0 repositories


	//   "response": {
	//     "$ref": "Release"
	//   },
	//   "scopes": [
	//     "",
	//     ""
	//   ]
	// }


// method id "firebaserules.projects.rulesets.create":

type ProjectsRulesetsCreateCall struct {
	s          *Service
	name       string
	ruleset    *Ruleset
	urlParams_ gensupport.URLParams
	ctx_       context.Context

// Create: Create a `Ruleset` from `Source`.
// The `Ruleset` is given a unique generated name which is returned to
// the
// caller. `Source` containing syntactic or semantics errors will result
// in an
// error response indicating the first error encountered. For a detailed
// view
// of `Source` issues, use TestRuleset.
func (r *ProjectsRulesetsService) Create(name string, ruleset *Ruleset) *ProjectsRulesetsCreateCall {
	c := &ProjectsRulesetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} = name
	c.ruleset = ruleset
	return c

// Fields allows partial responses to be retrieved. See
// for more information.
func (c *ProjectsRulesetsCreateCall) Fields(s ...googleapi.Field) *ProjectsRulesetsCreateCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c

// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsRulesetsCreateCall) Context(ctx context.Context) *ProjectsRulesetsCreateCall {
	c.ctx_ = ctx
	return c

func (c *ProjectsRulesetsCreateCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := make(http.Header)
	reqHeaders.Set("User-Agent", c.s.userAgent())
	var body io.Reader = nil
	body, err := googleapi.WithoutDataWrapper.JSONReader(c.ruleset)
	if err != nil {
		return nil, err