// PostAncestry performs the analysis of all layers from the provided path.
777429
func (c *Clair) PostAncestry(ctx context.Context, name string, layers []*clairpb.PostAncestryRequest_PostLayer) error {
	c.Logf("clair.ancestry.post name=%s", name)

	if c.grpcConn == nil {
		return ErrNilGRPCConn
	}

	client := clairpb.NewAncestryServiceClient(c.grpcConn)

	resp, err := client.PostAncestry(ctx, &clairpb.PostAncestryRequest{
		AncestryName: name,
		Layers:       layers,
		Format:       "Docker",
	})
	if err != nil {
		return err
	}

	if resp == nil {
		return errors.New("ancestry response was nil")
	}

	if resp.GetStatus() != nil {
		c.Logf("clair.ancestry.post ClairStatus=%#v", *resp.GetStatus())
	}

	return nil
}
920560
func PathSend(db XODB, v0 pgtypes.Path) ([]byte, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.path_send($1)`

	// run query
	var ret []byte
	XOLog(sqlstr, v0)
	err = db.QueryRow(sqlstr, v0).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
1022484
func (t *Type) postProcess(name string, apiDef *APIDefinition) error {
	t.Name = name
	t._apiDef = apiDef

	if t.IsJSONType() {
		return t.postProcessJSONSchema()
	}

	// process type in properties
	for name := range t.Properties {
		t.parseOptionalProperty(name)
		t.createTypeFromPropProperty(name, apiDef)
		t.createTypeFromPropItems(name, apiDef)
	}
	return nil
}
927126
func (e Endpoints) PostProfile(ctx context.Context, p Profile) error {
	request := postProfileRequest{Profile: p}
	response, err := e.PostProfileEndpoint(ctx, request)
	if err != nil {
		return err
	}
	resp := response.(postProfileResponse)
	return resp.Err
}
354440
func (b *backend) pathLoginRenew(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
	authType, ok := req.Auth.Metadata["auth_type"]
	if !ok {
		// backwards compatibility for clients that have leases from before we added auth_type
		authType = ec2AuthType
	}

	if authType == ec2AuthType {
		return b.pathLoginRenewEc2(ctx, req, data)
	} else if authType == iamAuthType {
		return b.pathLoginRenewIam(ctx, req, data)
	} else {
		return nil, fmt.Errorf("unrecognized auth_type: %q", authType)
	}
}
326774
func (up *tenantURLProvider) GetEnvironmentMapping() map[string]string {
	result := make(map[string]string)
	// Exclude internal namespaces where the user cannot deploy applications

	// Deployments API will receive requests by environment name (e.g. "run", "stage").
	// These names correspond to the "type" attribute in Namespaces.
	for envNS, attr := range up.namespaces {
		envName := attr.Type
		if envName == nil || len(*envName) == 0 {
			log.Error(nil, map[string]interface{}{
				"namespace": envNS,
			}, "namespace has no type")
		} else {
			result[*envName] = envNS
		}
	}
	return result
}
982501
func (js *JSONSchema) PostUnmarshal() {
	for name, prop := range js.Properties {
		prop.Required = js.isRequired(name)
		js.Properties[name] = prop
	}
}
1025590
func (c *Controller) PostLogin(form formValue) mvc.Result {
	var (
		username = form("username")
		password = form("password")
	)

	user, err := c.verify(username, password)
	if err != nil {
		return c.fireError(err)
	}

	c.Session.Set(sessionIDKey, user.ID)
	return pathMyProfile
}
800324
func (l *Client) PostQueryValidateSegment(query string) (interface{}, error) {
	res := ApiResp{}
	djson := json.RawMessage{}
	v := url.Values{}
	v.Set("segments", "true")

	// make the request
	err := l.PostType("text/plain", queryValidateEndpoint, v, query, &res, &djson)
	var data interface{}
	// unmarshal response `data` field into appropriate type depending on response status & message
	// add cases?
	switch res.Status {
	case float64(400):
		if res.Message == "Invalid schema errors" {
			d := []string{}
			e := json.Unmarshal(djson, &d)
			if e != nil {
				return nil, e
			}
			data = d
		}
	}
	if err != nil {
		return data, err
	}
	return data, nil
}
883284
func PostRequest(baseURL string, object *jsh.Object) (*http.Request, error) {
	u, err := url.Parse(baseURL)
	if err != nil {
		return nil, fmt.Errorf("Error parsing URL: %s", err.Error())
	}

	setPath(u, object.Type)

	request, err := NewRequest("POST", u.String(), nil)
	if err != nil {
		return nil, fmt.Errorf("Error building POST request: %s", err.Error())
	}

	err = prepareBody(request, object)
	if err != nil {
		return nil, err
	}

	return request, nil
}
665508
func (ldr *AEBackupInformationListLoader) PostProcess(c context.Context) error {
	for _, entity := range ldr.List {
		if err := entity.FetchChildren(c); err != nil {
			return err
		}
	}
	return nil
}
1066357
func (api *Client) PostEphemeral(channelID, userID string, options ...MsgOption) (string, error) {
	return api.PostEphemeralContext(
		context.Background(),
		channelID,
		userID,
		options...,
	)
}
1022042
func (s *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

	if err := httputils.ParseForm(r); err != nil {
		return err
	}

	var (
		image    = r.Form.Get("fromImage")
		repo     = r.Form.Get("repo")
		tag      = r.Form.Get("tag")
		message  = r.Form.Get("message")
		err      error
		output   = ioutils.NewWriteFlusher(w)
		platform *specs.Platform
	)
	defer output.Close()

	w.Header().Set("Content-Type", "application/json")

	version := httputils.VersionFromContext(ctx)
	if versions.GreaterThanOrEqualTo(version, "1.32") {
		apiPlatform := r.FormValue("platform")
		if apiPlatform != "" {
			sp, err := platforms.Parse(apiPlatform)
			if err != nil {
				return err
			}
			if err := system.ValidatePlatform(sp); err != nil {
				return err
			}
			platform = &sp
		}
	}

	if image != "" { //pull
		metaHeaders := map[string][]string{}
		for k, v := range r.Header {
			if strings.HasPrefix(k, "X-Meta-") {
				metaHeaders[k] = v
			}
		}

		authEncoded := r.Header.Get("X-Registry-Auth")
		authConfig := &types.AuthConfig{}
		if authEncoded != "" {
			authJSON := base64.NewDecoder(base64.URLEncoding, strings.NewReader(authEncoded))
			if err := json.NewDecoder(authJSON).Decode(authConfig); err != nil {
				// for a pull it is not an error if no auth was given
				// to increase compatibility with the existing api it is defaulting to be empty
				authConfig = &types.AuthConfig{}
			}
		}
		err = s.backend.PullImage(ctx, image, tag, platform, metaHeaders, authConfig, output)
	} else { //import
		src := r.Form.Get("fromSrc")
		// 'err' MUST NOT be defined within this block, we need any error
		// generated from the download to be available to the output
		// stream processing below
		os := ""
		if platform != nil {
			os = platform.OS
		}
		err = s.backend.ImportImage(src, repo, os, tag, message, r.Body, output, r.Form["changes"])
	}
	if err != nil {
		if !output.Flushed() {
			return err
		}
		output.Write(streamformatter.FormatError(err))
	}

	return nil
}
295459
func (sl *DiskSessionLogger) PostSessionSlice(slice SessionSlice) error {
	sl.Lock()
	defer sl.Unlock()

	for i := range slice.Chunks {
		_, err := sl.writeChunk(slice.SessionID, slice.Chunks[i])
		if err != nil {
			return trace.Wrap(err)
		}
	}
	return sl.flush()
}
128764
func (rt *ResourceType) postProcess(name string, traitsMap map[string]Trait, apiDef *APIDefinition) {
	rt.Name = name
	rt.setMethods(traitsMap, apiDef)
	rt.setOptionalMethods()

	// TODO : inherit from other resource type

	// TODO : apply traits
}
740009
func (l *listenerManager) postInitPlugins(event apid.Event) {
	var plinfoDetails []pluginDetail
	if pie, ok := event.(apid.PluginsInitializedEvent); ok {
		/*
		 * Store the plugin details in the heap. Needed during
		 * Bearer token generation request.
		 */
		for _, plugin := range pie.Plugins {
			name := plugin.Name
			version := plugin.Version
			if schemaVersion, ok := plugin.ExtraData["schemaVersion"].(string); ok {
				inf := pluginDetail{
					Name:          name,
					SchemaVersion: schemaVersion}
				plinfoDetails = append(plinfoDetails, inf)
				log.Debugf("plugin %s is version %s, schemaVersion: %s", name, version, schemaVersion)
			}
		}
		if plinfoDetails == nil {
			log.Panic("No Plugins registered!")
		}

		pgInfo, err := json.Marshal(plinfoDetails)
		if err != nil {
			log.Panicf("Unable to marshal plugin data: %v", err)
		}
		apidPluginDetails = string(pgInfo[:])

		log.Debug("start post plugin init")

		l.tokenMan.start()
		go l.bootstrap(apidInfo.LastSnapshot)

		log.Debug("Done post plugin init")
	}
}
243996
func (properties *Properties) PostUnmarshalJSON() error {
	properties.Init()

	for key, property := range properties.Properties.Items {
		properties.Properties.Items[key].parent = properties
		if err := property.PostUnmarshalJSON(); err != nil {
			return err
		}
	}

	properties.Complete <- true

	return nil
}