// Show runs the show action.
8322
func (c *WorkitemtypeController) Show(ctx *app.ShowWorkitemtypeContext) error {
	err := application.Transactional(c.db, func(appl application.Application) error {
		witModel, err := appl.WorkItemTypes().Load(ctx.Context, ctx.WitID)
		if err != nil {
			return err
		}
		return ctx.ConditionalRequest(*witModel, c.config.GetCacheControlWorkItemType, func() error {
			witData := ConvertWorkItemTypeFromModel(ctx.Request, witModel)
			wit := &app.WorkItemTypeSingle{Data: &witData}
			return ctx.OK(wit)
		})
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return nil
}
1242024
func (s *Action) showHandleOutput(ctx context.Context, name, key string, sec store.Secret) error {
	var content string

	switch {
	case key != "":
		val, err := sec.Value(key)
		if err != nil {
			return s.showHandleYAMLError(ctx, name, key, err)
		}
		if IsClip(ctx) {
			return clipboard.CopyTo(ctx, name, []byte(val))
		}
		content = val
	case IsPrintQR(ctx):
		return s.showPrintQR(ctx, name, sec.Password())
	case IsClip(ctx):
		return clipboard.CopyTo(ctx, name, []byte(sec.Password()))
	default:
		switch {
		case IsPasswordOnly(ctx):
			content = sec.Password()
		case ctxutil.IsShowSafeContent(ctx) && !IsForce(ctx):
			content = sec.Body()
			if content == "" {
				if ctxutil.IsAutoClip(ctx) {
					out.Yellow(ctx, "No safe content to display, you can force display with show -f.\nCopying password instead.")
					return clipboard.CopyTo(ctx, name, []byte(sec.Password()))
				}
				return ExitError(ctx, ExitNotFound, store.ErrNoBody, store.ErrNoBody.Error())
			}
		default:
			buf, err := sec.Bytes()
			if err != nil {
				return ExitError(ctx, ExitUnknown, err, "failed to encode secret: %s", err)
			}
			content = string(buf)
		}
	}

	ctx = out.WithNewline(ctx, ctxutil.IsTerminal(ctx) && !strings.HasSuffix(content, "\n"))
	out.Yellow(ctx, content)
	return nil
}
402589
func (n *Notification) Show() (err error) {
	if !n.isSupported {
		return
	}
	if err = n.isActionable(); err != nil {
		return
	}
	_, err = synchronousEvent(n.c, n, n.w, Event{Name: eventNameNotificationCmdShow, TargetID: n.id}, EventNameNotificationEventShown)
	return
}
58762
func (c *UserController) Show(ctx *app.ShowUserContext) error {
	// retrieve the user's identity ID from the token
	identityID, err := c.tokenManager.Locate(ctx)
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err": err,
		}, "Bad Token")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("bad or missing token"))
	}
	user, identity, err := c.app.UserService().UserInfo(ctx, identityID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	if user.Banned {
		ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate")
		ctx.ResponseData.Header().Set("WWW-Authenticate", "DEPROVISIONED description=\"Account has been banned\"")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("Account has been banned"))
	}

	return ctx.ConditionalRequest(*user, c.config.GetCacheControlUser, func() error {
		// Init tenant (if access to tenant service is configured/enabled)
		if c.tenantService != nil {
			go func(ctx context.Context) {
				c.tenantService.Init(ctx)
			}(ctx)
		}
		return ctx.OK(ConvertToAppUser(ctx.RequestData, user, identity, true))
	})
}
354987
func show(c context.Context, client *prpc.Client, name string) error {
	desc, err := loadDescription(c, client)
	if err != nil {
		return fmt.Errorf("could not load server description: %s", err)
	}

	if name == "" {
		for _, s := range desc.Services {
			fmt.Println(s)
		}
		return nil
	}

	file, obj, path := descutil.Resolve(desc.Description, name)
	if obj == nil {
		return fmt.Errorf("name %q could not resolved", name)
	}

	print := newPrinter(os.Stdout)
	if err := print.SetFile(file); err != nil {
		return err
	}

	switch obj := obj.(type) {

	case *descriptor.ServiceDescriptorProto:
		print.Service(obj, -1)

	case *descriptor.MethodDescriptorProto:
		serviceIndex, methodIndex := path[1], path[3]
		print.Service(file.Service[serviceIndex], methodIndex)

		printMsg := func(name string) error {
			name = strings.TrimPrefix(name, ".")
			file, msg, _ := descutil.Resolve(desc.Description, name)
			if msg == nil {
				print.Printf("// Message %q is not found\n", name)
				return nil
			}
			if err := print.SetFile(file); err != nil {
				return err
			}
			print.Message(msg.(*descriptor.DescriptorProto))
			return nil
		}

		print.Printf("\n")
		if err := printMsg(obj.GetInputType()); err != nil {
			return err
		}
		print.Printf("\n")
		if err := printMsg(obj.GetOutputType()); err != nil {
			return err
		}

	case *descriptor.DescriptorProto:
		print.Message(obj)

	case *descriptor.FieldDescriptorProto:
		print.Field(obj)

	case *descriptor.EnumDescriptorProto:
		print.Enum(obj)

	case *descriptor.EnumValueDescriptorProto:
		print.EnumValue(obj)

	default:
		return fmt.Errorf("object of type %T is not supported", obj)
	}

	return print.Err
}
211632
func (c *NamedWorkItemsController) Show(ctx *app.ShowNamedWorkItemsContext) error {
	err := application.Transactional(c.db, func(appl application.Application) error {
		wiID, _, err := appl.WorkItems().LookupIDByNamedSpaceAndNumber(ctx, ctx.UserName, ctx.SpaceName, ctx.WiNumber)
		if err != nil {
			return errs.Wrapf(err, "Fail to load work item with number %v in %s/%s", ctx.WiNumber, ctx.UserName, ctx.SpaceName)
		}
		ctx.ResponseData.Header().Set("Location", rest.AbsoluteURL(ctx.Request, app.WorkitemHref(wiID)))
		return ctx.TemporaryRedirect()
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return nil
}
120621
func (c *AreaController) Show(ctx *app.ShowAreaContext) error {
	id, err := uuid.FromString(ctx.ID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
	}
	var a *area.Area
	err = application.Transactional(c.db, func(appl application.Application) error {
		a, err = appl.Areas().Load(ctx, id)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalRequest(*a, c.config.GetCacheControlArea, func() error {
		res := &app.AreaSingle{}
		res.Data = ConvertArea(c.db, ctx.Request, *a, addResolvedPath)
		return ctx.OK(res)
	})
}
597218
func (c *UsersController) Show(ctx *app.ShowUsersContext) error {
	return proxy.RouteHTTP(ctx, c.config.GetAuthShortServiceHostName())
}
127850
func (v *View) Hide() {
	if v.HideState == nil {
		v.HideState = &HideView{}
	}
	v.activeState = v.HideState
}
293578
func (a *Application) Action(action Action) *Application {
	a.addAction(action)
	return a
}
180201
func (c *StatusController) Show(ctx *app.ShowStatusContext) error {
	res := &app.Status{}
	res.Commit = Commit
	res.BuildTime = BuildTime
	res.StartTime = StartTime

	_, err := c.db.DB().Exec("select 1")
	if err != nil {
		var message string
		message = err.Error()
		res.Error = &message
		return ctx.ServiceUnavailable(res)
	}
	return ctx.OK(res)
}
181602
func showVersion() {
	fmt.Print(versionString())
	fmt.Print(releaseString())
	if devBuild && gitShortStat != "" {
		fmt.Printf("%s\n%s\n", gitShortStat, gitFilesModified)
	}
}
1095738
func (a *Account) Show() (*Account, *http.Response, []error) {
	k := kumoru.New()

	k.Get(fmt.Sprintf("%v/v1/accounts/%v", k.EndPoint.Authorization, a.Email))
	k.SignRequest(true)

	resp, body, errs := k.End()

	if len(errs) > 0 {
		return a, resp, errs
	}

	if resp.StatusCode >= 400 {
		errs = append(errs, fmt.Errorf("%s", resp.Status))
		return a, resp, errs
	}

	err := json.Unmarshal([]byte(body), &a)

	if err != nil {
		errs = append(errs, err)
		return a, resp, errs
	}

	return a, resp, nil
}
919356
func (c *UserServiceController) Show(ctx *app.ShowUserServiceContext) error {
	t, err := c.ShowTenant(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	return ctx.OK(convert(t))
}
607367
func (v GifmsResource) Show(c buffalo.Context) error {
	// Get the DB connection from the context
	tx, ok := c.Value("tx").(*pop.Connection)
	if !ok {
		return errors.WithStack(errors.New("no transaction found"))
	}

	// Allocate an empty Gifm
	gifm := &models.Gifm{}

	// To find the Gifm the parameter gifm_id is used.
	if err := tx.Find(gifm, c.Param("gifm_id")); err != nil {
		return c.Error(404, err)
	}

	return c.Render(200, r.Auto(c, gifm))
}
706978
func (engine *Engine) ShowSQL(show ...bool) {
	engine.logger.ShowSQL(show...)
	if len(show) == 0 {
		engine.showSQL = true
	} else {
		engine.showSQL = show[0]
	}
}
596618
func (c *WorkItemLinkController) Show(ctx *app.ShowWorkItemLinkContext) error {
	var modelLink *link.WorkItemLink
	err := application.Transactional(c.db, func(appl application.Application) error {
		var err error
		modelLink, err = appl.WorkItemLinks().Load(ctx.Context, ctx.LinkID)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalRequest(*modelLink, c.config.GetCacheControlWorkItemLink, func() error {
		// convert to rest representation
		appLink := ConvertLinkFromModel(ctx.Request, *modelLink)
		if err := enrichLinkSingle(ctx.Context, c.db, ctx.Request, &appLink); err != nil {
			return err
		}
		return ctx.OK(&appLink)
	})
}