Execute MailChimp API method.

@param method MailChimp API method to be executed
@return execution result
543440
public <R> R execute(MailChimpMethod<R> method) throws IOException, MailChimpException {
		final Gson gson = MailChimpGsonFactory.createGson();

		JsonElement result = execute(buildUrl(method), gson.toJsonTree(method), method.getMetaInfo().version());
		if(result.isJsonObject()) {
			JsonElement error = result.getAsJsonObject().get("error");		
			if(error != null) {
				JsonElement code = result.getAsJsonObject().get("code");
				throw new MailChimpException(code.getAsInt(), error.getAsString());
			}
		}
		
		return gson.fromJson(result, method.getResultType());
	}
562654
function execute(method, params) {
  var output = !params ? [] : params;

  if (method == "getStandardEvents") {
    return new Promise(function promise(resolve, reject) {
      resolve(standardEvent);  
    });
  }

  return new Promise(function promise(resolve, reject) {
    exec(
      function success(res) {
        resolve(res);
      },
      function failure(err) {
        reject(err);
      },
      API_CLASS,
      method,
      output
    );
  });
}
395184
public <T> T execute(final String methodName, final Class<T> clazz, final Object... args) {
        return execute(methodName, clazz, true, args);
    }
1264864
void executeBulk(final TSDB tsdb, final HttpMethod method, HttpQuery query) {
    if (method == HttpMethod.POST || method == HttpMethod.PUT) {
      executeBulkUpdate(tsdb, method, query);
    } else if (method == HttpMethod.DELETE) {
      executeBulkDelete(tsdb, query);
    } else {
      throw new BadRequestException(HttpResponseStatus.METHOD_NOT_ALLOWED, 
          "Method not allowed", "The HTTP method [" + query.method().getName() +
          "] is not permitted for this endpoint");
    }
  }
655696
protected JSONArray callMethod(String method, Object ... args) throws Exception {
        return new QueryBuilder().retrieveResult(storedId).call(method, args).storeResult("LAST_" + getStoredId()).execute();
    }
1042548
@Deprecated
  public RequestTemplate method(String method) {
    checkNotNull(method, "method");
    try {
      this.method = HttpMethod.valueOf(method);
    } catch (IllegalArgumentException iae) {
      throw new IllegalArgumentException("Invalid HTTP Method: " + method);
    }
    return this;
  }
992228
private Object executeMethod(final Method method, final ServletContextImpl context, final Object[] params)
            throws PrivilegedActionException, IllegalAccessException, InvocationTargetException {

        if (SecurityUtil.isPackageProtectionEnabled()) {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                public Object run() throws IllegalAccessException, InvocationTargetException {
                    return method.invoke(context, params);
                }
            });
        } else {
            return method.invoke(context, params);
        }
    }
981783
protected function exec($method, $uri, $data, $content_type)
    {
        $connect = $this->getConnect($uri, $method, $content_type);
        if ($data) {
            $this->setData($connect, $data, $content_type);
        }

        $api_result = curl_exec($connect);
        $api_http_code = curl_getinfo($connect, CURLINFO_HTTP_CODE);
        $api_http_time = curl_getinfo($connect, CURLINFO_TOTAL_TIME);

        $response = array(
            "status" => $api_http_code,
            "total_time" => $api_http_time,
        );

        if ($content_type == "application/json") {
            $response["response"] = json_decode($api_result, true);
        } elseif ($content_type == "text/html") {
            $response["response"] = $api_result;
        }

        if ($response['status'] >= 400) {
            throw new Exception($response['response'], $response['status']);
        }

        curl_close($connect);

        return $response;
    }
196413
public FieldAccessor create(final Method method) {

        ArgUtils.notNull(method, "method");

        final FieldAccessor accessor = new FieldAccessor();

        final String methodName = method.getName();
        if(ClassUtils.isGetterMethod(method) || ClassUtils.isBooleanGetterMethod(method)) {
            final String propertyName;
            if(methodName.startsWith("get")) {
                propertyName = Utils.uncapitalize(methodName.substring(3));
            } else {
                propertyName = Utils.uncapitalize(methodName.substring(2));
            }

            // 共通情報の設定
            accessor.name = propertyName;
            accessor.targetType = method.getReturnType();
            accessor.declaringClass = method.getDeclaringClass();

            // getter情報の設定
            setupWithGetter(accessor, method);

            // フィールド情報の設定
            ClassUtils.extractField(accessor.getDeclaringClass(), accessor.getName(), accessor.getType())
                    .ifPresent(field -> setupWithFiled(accessor, field));

            // setter情報の設定
            ClassUtils.extractSetter(accessor.getDeclaringClass(), accessor.getName(), accessor.getType())
                    .ifPresent(setter -> setupWithSetter(accessor, setter));

            // コンポーネントタイプの設定
            if(Collection.class.isAssignableFrom(accessor.getType())) {
                ParameterizedType type = (ParameterizedType) method.getGenericReturnType();
                accessor.componentType = Optional.of((Class<?>) type.getActualTypeArguments()[0]);

            } else if(accessor.getType().isArray()) {
                accessor.componentType = Optional.of(accessor.getType().getComponentType());

            } else if(Map.class.isAssignableFrom(accessor.getType())) {
                ParameterizedType type = (ParameterizedType) method.getGenericReturnType();
                accessor.componentType = Optional.of((Class<?>) type.getActualTypeArguments()[1]);
            }

        } else if(ClassUtils.isSetterMethod(method)) {
            final String propertyName = Utils.uncapitalize(methodName.substring(3));

            // 共通情報の設定
            accessor.name = propertyName;
            accessor.targetType = method.getParameterTypes()[0];
            accessor.declaringClass = method.getDeclaringClass();

            // setter情報の設定
            setupWithSetter(accessor, method);

            // フィールド情報の設定
            ClassUtils.extractField(accessor.getDeclaringClass(), accessor.getName(), accessor.getType())
                    .ifPresent(field -> setupWithFiled(accessor, field));

            // getter情報の設定
            if(ClassUtils.isPrimitiveBoolean(accessor.getType())) {
                ClassUtils.extractBooleanGetter(accessor.getDeclaringClass(), accessor.getName())
                        .ifPresent(getter -> setupWithGetter(accessor, getter));

            } else {
                ClassUtils.extractGetter(accessor.getDeclaringClass(), accessor.getName(), accessor.getType())
                        .ifPresent(getter -> setupWithGetter(accessor, getter));
            }

            // コンポーネントタイプの設定
            if(Collection.class.isAssignableFrom(accessor.getType())) {
                ParameterizedType type = (ParameterizedType) method.getGenericParameterTypes()[0];
                accessor.componentType = Optional.of((Class<?>) type.getActualTypeArguments()[0]);

            } else if(accessor.getType().isArray()) {
                accessor.componentType = Optional.of(accessor.getType().getComponentType());

            } else if(Map.class.isAssignableFrom(accessor.getType())) {
                ParameterizedType type = (ParameterizedType) method.getGenericParameterTypes()[0];
                accessor.componentType = Optional.of((Class<?>) type.getActualTypeArguments()[1]);
            }

        } else {
            throw new IllegalArgumentException(MessageBuilder.create("method.noAccessor")
                    .varWithClass("className", method.getDeclaringClass())
                    .var("methodName", methodName)
                    .format());
        }

        // 位置・ラベル情報のアクセッサの設定
        if(accessor.hasAnnotation(XlsMapColumns.class)) {
            accessor.mapPositionSetter = mapPositionSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            accessor.mapLabelSetter = mapLabelSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());

        } else if(accessor.hasAnnotation(XlsArrayColumns.class)
                || accessor.hasAnnotation(XlsArrayCells.class)
                || accessor.hasAnnotation(XlsLabelledArrayCells.class)
                || accessor.hasAnnotation(XlsIterateTables.class)){
            // リストや配列形式の場合
            accessor.arrayPositionSetter = arrayPositionSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            accessor.arrayLabelSetter = arrayLabelSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());

            if(accessor.hasAnnotation(XlsArrayColumns.class)
                    || accessor.hasAnnotation(XlsLabelledArrayCells.class)) {
                // インデックスが付いていないラベルの設定
                accessor.labelSetter = labelSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            }

        } else {
            // XlsMapColumnsを持たない通常のプロパティの場合
            accessor.positionSetter = positionSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            accessor.positionGetter = positionGetterFactory.create(accessor.getDeclaringClass(), accessor.getName());

            accessor.labelSetter = labelSetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
            accessor.labelGetter = labelGetterFactory.create(accessor.getDeclaringClass(), accessor.getName());
        }


        return accessor;
    }
654862
private void callHandleMethod(Method method, Object instance, ApiZone apiZone,
            Object userAgent) {
        ReflectMethodUtil.invokeHandleMethod(method, instance, context, apiZone, userAgent);
    }
794327
public Object execute(String qualifiedClassName, String methodName, Object... args) {

        try {

            return findMethod(qualifiedClassName, methodName)
                    .invoke(injector.getInstance(getClass(qualifiedClassName)), args);
        } catch (Exception e) {
            LOGGER.error("Exception encountered while executing java method" + e);
            throw new RuntimeException(e);
        }
    }
1337586
public static Request create(String method,
                               String url,
                               Map<String, Collection<String>> headers,
                               byte[] body,
                               Charset charset) {
    checkNotNull(method, "httpMethod of %s", method);
    HttpMethod httpMethod = HttpMethod.valueOf(method.toUpperCase());
    return create(httpMethod, url, headers, body, charset);
  }
532806
public HttpConnection setMethod(Method method) {
		// method
		try {
			this.conn.setRequestMethod(method.toString());
		} catch (ProtocolException e) {
			throw new HttpException(e);
		}

		// do input and output
		this.conn.setDoInput(true);
		if (Method.POST.equals(method) //
				|| Method.PUT.equals(method)//
				|| Method.PATCH.equals(method)//
				|| Method.DELETE.equals(method)) {
			this.conn.setDoOutput(true);
			this.conn.setUseCaches(false);
		}
		return this;
	}
1164680
public RequestBuilder request(HttpMethod method, String url) {
        return request(method.asString(), url);
    }
24640
def execute_request(method)
    begin
      response = client.call(method) do |locals|
        xml = Builder::XmlMarkup.new
        xml.instruct!(:xml, :encoding => 'UTF-8')
        result = begin
          xml.s :Envelope,
              "xmlns" => config[:namespace],
              "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema",
              "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
              "xmlns:s" => "http://www.w3.org/2003/05/soap-envelope",
              "xmlns:a" => "http://schemas.xmlsoap.org/ws/2004/08/addressing",
              "xmlns:o" => "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" do

            xml.s :Header do
              xml.a :Action, method, "s:mustUnderstand" => "1"
              xml.a :MessageID, "uuid:#{Guid.new.to_s}"
              xml.a :ReplyTo do
                xml.a :Address, "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"
              end
              xml.a :To, config[:endpoint], "s:mustUnderstand" => "1"
              xml.o :Security, "s:mustUnderstand" => "1" do
                xml.o :UsernameToken, "o:Id" => "test" do
                  xml.o :Username, config[:username]
                  xml.o :Password, config[:password]
                end
              end
            end

            xml.s :Body do
              yield(xml)
            end
          end
        end

        locals.xml result
      end


      if response.http_error?
        raise HTTPError, response.http_error.to_s
      end

      if response.soap_fault?
        raise SOAPFault, response.soap_fault.to_s
      end

      response
    rescue ::Timeout::Error => e
      timeout = ::ExactTargetSDK::TimeoutError.new("#{e.message}; open_timeout: #{config[:open_timeout]}; read_timeout: #{config[:read_timeout]}")
      timeout.set_backtrace(e.backtrace)
      raise timeout
    rescue Exception => e
      raise ::ExactTargetSDK::UnknownError, e
    end
  end
331966
@Override
    public void setMethod(byte[] method) throws UnsupportedMethodException {
        MethodValues val = MethodValues.match(method, 0, method.length);
        if (null == val) {
            throw new UnsupportedMethodException("Illegal method " + GenericUtils.getEnglishString(method));
        }
        setMethod(val);
    }
1164407
function (method, methodName) {
        if (new RegExp("\\.\\$super\\b").exec(method)) {
            return this._createSuperified(method, methodName, _gpfClassMethodExtractSuperMembers(method));
        }
        return method;
    }