// FromNoopTrigger derives the request properties from the given noop trigger.
552845
func (r *RequestBuilder) FromNoopTrigger(t *scheduler.NoopTrigger) {
	r.Properties = structFromMap(map[string]string{
		"noop_trigger_data": t.Data, // for testing
	})
}
1127981
func (self *Service) ListTriggers() (TriggerListResponse, error) {
	url := "service/" + self.Uuid + "/trigger/"
	request := "GET"
	//Empty Body Request
	body := []byte(`{}`)
	var response TriggerListResponse
	var finalResponse TriggerListResponse

	data, err := TutumCall(url, request, body)
	if err != nil {
		return response, err
	}

	err = json.Unmarshal(data, &response)
	if err != nil {
		return response, err
	}

	finalResponse = response

Loop:
	for {
		if response.Meta.Next != "" {
			var nextResponse TriggerListResponse
			data, err := TutumCall(response.Meta.Next[8:], request, body)
			if err != nil {
				return nextResponse, err
			}
			err = json.Unmarshal(data, &nextResponse)
			if err != nil {
				return nextResponse, err
			}
			finalResponse.Objects = append(finalResponse.Objects, nextResponse.Objects...)
			response = nextResponse

		} else {
			break Loop
		}
	}

	return finalResponse, nil
}
1254224
func Trigger(trigger string, args ...interface{}) {
	tl.Lock()
	priorities, exists := triggers[trigger]
	tl.Unlock()

	if exists {
		for p := 0; p <= 100; p++ {
			for _, f := range priorities[p] {
				params := make([]reflect.Value, len(args))
				for idx := range args {
					params[idx] = reflect.ValueOf(args[idx])
				}
				reflect.ValueOf(f).Call(params)
			}
		}
	}

	// fire off subscriptions for all events
	if trigger != "*" {
		Trigger("*", args...)
	}
}
903777
func FromRequest(r *http.Request) *zerolog.Logger {
	return log.Ctx(r.Context())
}
679242
func FromMap(val map[string]interface{}) context.Context {
	return context.WithValue(context.Background(), constants.PropagateCtxKey, val)
}
60986
func (r *SearchRequest) From(from int) *SearchRequest {
	r.searchSource = r.searchSource.From(from)
	return r
}
1327500
func NoopTrigger(id, data string) Trigger {
	return Trigger{
		Id:      id,
		Payload: &Trigger_Noop{Noop: &api.NoopTrigger{Data: data}},
	}
}
688544
func (s *EnvironmentResourceDescription) SetTriggers(v []*Trigger) *EnvironmentResourceDescription {
	s.Triggers = v
	return s
}
1241485
func FromJSON(p string) (Args, error) {
	args := NewArgs()

	if p == "" {
		return args, nil
	}

	raw := []byte(p)
	err := json.Unmarshal(raw, &args)
	if err == nil {
		return args, nil
	}

	// Fallback to parsing arguments in the legacy slice format
	deprecated := map[string][]string{}
	if legacyErr := json.Unmarshal(raw, &deprecated); legacyErr != nil {
		return args, err
	}

	args.fields = deprecatedArgs(deprecated)
	return args, nil
}
171663
func FromOptions(opts []yarpc.CallOption) []encoding.CallOption {
	newOpts := make([]encoding.CallOption, len(opts))
	for i, o := range opts {
		newOpts[i] = encoding.CallOption(o)
	}
	return newOpts
}
1177507
func (r *RequestBuilder) FromBuildbucketTrigger(t *scheduler.BuildbucketTrigger) {
	r.Properties = t.Properties
	r.Tags = t.Tags
}
836694
func (s *DatasetSummary) SetTriggers(v []*DatasetTrigger) *DatasetSummary {
	s.Triggers = v
	return s
}
340180
func FromJSON(oautherJSON []byte) (oauther *OAuther, err error) {
	oauther = &OAuther{}
	json.Unmarshal(oautherJSON, oauther)
	return
}
1114495
func (s *BatchGetTriggersOutput) SetTriggersNotFound(v []*string) *BatchGetTriggersOutput {
	s.TriggersNotFound = v
	return s
}
1119116
func findDeployTrigger(dst []appsv1.DeploymentTriggerPolicy, trigger appsv1.DeploymentTriggerPolicy) int {
	for i := range dst {
		if reflect.DeepEqual(dst[i], trigger) {
			return i
		}
	}
	return -1
}
213730
func (self *Service) GetTrigger(trigger_uuid string) (Trigger, error) {

	url := ""
	if string(trigger_uuid[0]) == "/" {
		url = trigger_uuid[8:]
	} else {
		url = "service/" + self.Uuid + "/trigger/" + trigger_uuid + "/"
	}

	request := "GET"
	body := []byte(`{}`)
	var response Trigger

	data, err := TutumCall(url, request, body)
	if err != nil {
		return response, err
	}

	err = json.Unmarshal(data, &response)
	if err != nil {
		return response, err
	}

	return response, nil
}
394107
func FromRequest(r *http.Request) XStater {
	if r == nil {
		return nop
	}
	return FromContext(r.Context())
}