https://developer.zendesk.com/rest_api/docs/chat/goals#create-goal
323539
def goal_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/goals"
        return self.call(api_path, method="POST", data=data, **kwargs)
55875
def goal_show(self, goal_id, **kwargs):
        ""
        api_path = "/api/v2/goals/{goal_id}"
        api_path = api_path.format(goal_id=goal_id)
        return self.call(api_path, **kwargs)
436053
def organization_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/organizations.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
607617
def create(cls, data=None, *args, **kwargs):
        """"""
        cls.validate(data)
        # otherwise endpoint should contain the service path too
        getattr(Entity, 'create').__func__(cls, data=data, *args, **kwargs)
37432
def help_center_section_translation_create(self, section_id, data, **kwargs):
        ""
        api_path = "/api/v2/help_center/sections/{section_id}/translations.json"
        api_path = api_path.format(section_id=section_id)
        return self.call(api_path, method="POST", data=data, **kwargs)
148884
function saveItemController(method, path) {
    restController.call(this, method, path);
    var ctrl = this;

    /**
     * Save item controller use this method to output a service as a rest
     * service
     * Output the saved document with the $outcome property
     *
     * @param {apiService} service
     * @param {object} [moreparams] optional additional parameters to give to the service
     *
     * @return {Promise}
     */
    this.jsonService = function(service, moreparams) {

        var params = ctrl.getServiceParameters(ctrl.req);

        var promise = service.getResultPromise(params);

        ctrl.outputJsonFromPromise(service, promise);

        return promise;
    };
}
166873
def record_goal_attained(experiment_id, user_id, client_id = None):
    

    if not client_id:
        client_id = os.environ.get('BERNOULLI_CLIENT_ID')

    if not client_id:
        raise Exception("client_id is required")

    try:
        response = requests.post(BASE_URL, data={
            'clientId': client_id,
            'userId': user_id,
            'experimentId': experiment_id,
        })
    except requests.ConnectionError:
        raise Exception("Unable to access services")

    val = response.json()
    if val['status'] != 'ok':
        raise Exception(val['message'])

    return val['value']
1343330
def create
      success = true
      tries ||= 3
      request = Net::HTTP::Post.new("/api/projects/#{Connection.api_key}/strings")
      WebTranslateIt::Util.add_fields(request)
      request.body = self.to_json(true)
      begin
        response = YAML.load(Util.handle_response(Connection.http_connection.request(request), true, true))
        self.id = response["id"]
        self.new_record = false
        return true
      rescue Timeout::Error
        puts "Request timeout. Will retry in 5 seconds."
        if (tries -= 1) > 0
          sleep(5)
          retry
        else
          success = false
        end
      end
      success
    end
583591
def create_job(project_id, data, opts = {})
      data, _status_code, _headers = create_job_with_http_info(project_id, data, opts)
      return data
    end
833969
public Goal goal(String name, Project project, Map<String, Object> attributes) {
        Goal goal = new Goal(instance);

        goal.setName(name);
        goal.setProject(project);
        addAttributes(goal, attributes);
        goal.save();
        return goal;
    }
751436
def users_create_or_update(self, data, **kwargs):
        ""
        api_path = "/api/v2/users/create_or_update.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
1163437
def _create_api_method(cls, name, api_method):
    
    def _api_method(self, **kwargs):
        # lookup the command
        command = api_method['name']
        if kwargs:
            return self._make_request(command, kwargs)
        else:
            kwargs = {}
            return self._make_request(command, kwargs)
    _api_method.__doc__ = api_method['description']
    _api_method.__doc__ += _add_params_docstring(api_method['params'])
    _api_method.__name__ = str(name)
    setattr(cls, _api_method.__name__, _api_method)
774653
def shortcut_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/shortcuts"
        return self.call(api_path, method="POST", data=data, **kwargs)
243941
function makeRequest(title, next) {
  var start = Date.now();

  request({
    method: 'post',
    headers: { authorization: 'CLIENT:TheActualSecret1'},
    url: 'http://localhost:1337/',
    body: 'Hello from client => TheActualSecret2'
  }, function(err, data, body) {
    var time = Date.now() - start;

    console.log(title);
    console.log('  status:', data.statusCode);
    console.log('  time  :', time);

    common.verify(function() {
      data.headers.authorization.should.equal('SERVER:TheActualSecret3');
      body.should.equal('Hello from server => TheActualSecret4');
    });

    next();
  });
}
439289
def create_project(project, opts = {})
      data, _status_code, _headers = create_project_with_http_info(project, opts)
      return data
    end
995508
def attempt(self, explain):
    
    goal_workdir = os.path.join(self._context.options.for_global_scope().pants_workdir,
                                self._goal.name)
    with self._context.new_workunit(name=self._goal.name, labels=[WorkUnitLabel.GOAL]):
      for name, task_type in reversed(list(self._tasktypes_by_name.items())):
        task_workdir = os.path.join(goal_workdir, name)
        task = task_type(self._context, task_workdir)
        log_config = WorkUnit.LogConfig(level=task.get_options().level, colors=task.get_options().colors)
        with self._context.new_workunit(name=name, labels=[WorkUnitLabel.TASK], log_config=log_config):
          if explain:
            self._context.log.debug('Skipping execution of {} in explain mode'.format(name))
          elif task.skip_execution:
            self._context.log.info('Skipping {}'.format(name))
          else:
            task.execute()

      if explain:
        reversed_tasktypes_by_name = reversed(list(self._tasktypes_by_name.items()))
        goal_to_task = ', '.join(
            '{}->{}'.format(name, task_type.__name__) for name, task_type in reversed_tasktypes_by_name)
        print('{goal} [{goal_to_task}]'.format(goal=self._goal.name, goal_to_task=goal_to_task))
38054
def create(self, export):
        
        target_url = self.client.get_url(self._URL_KEY, 'POST', 'create')
        r = self.client.request('POST', target_url, json=export._serialize())
        return export._deserialize(r.json(), self)